Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
Thanks bro!  I think I hated annotations until today.  Was the
StrutsTestCase moved into a plug-in recently?

On Thu, Jun 11, 2009 at 10:41 AM, Wes Wannemacher  wrote:

> Scott, it is just complaining because you are trying to do something
> Spring-ish in your unit test, but Spring is not initialized... Try
> annotating the test class with something like the following -
>
> @RunWith(SpringJUnit4ClassRunner.class)
> @ContextConfiguration(locations={"classpath*:applicationContext-test.xml"})
> public class ...
>
>
> That's the easy way, but if you are using an older JDK|JUnit then
> you'll have to figure out how to start Spring.
>
> -Wes
>
> On Thu, Jun 11, 2009 at 11:25 AM, stanlick wrote:
> >
> > I am on a project with a new combination of jars and testing Struts
> > interceptors.  I have added the struts2-junit-plugin-2.1.2.jar and also
> > spring-test.jar.  When I run my subclass test of StrutsTestCase I get the
> > following exception:
> >
> > SEVERE:   [20:44.438] ** FATAL ERROR STARTING UP STRUTS-SPRING
> > INTEGRATION **
> > Looks like the Spring listener was not configured for your web app!
> > Nothing will work until WebApplicationContextUtils returns a valid
> > ApplicationContext.
> > You might need to add the following to web.xml:
> >
> >
> >
> org.springframework.web.context.ContextLoaderListener
> >
> >
> >
> > Why is the web.xml being considered?
> >
> > Peace,
> > Scott
> > --
> > View this message in context:
> http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread Wes Wannemacher
Scott, it is just complaining because you are trying to do something
Spring-ish in your unit test, but Spring is not initialized... Try
annotating the test class with something like the following -

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:applicationContext-test.xml"})
public class ...


That's the easy way, but if you are using an older JDK|JUnit then
you'll have to figure out how to start Spring.

-Wes

On Thu, Jun 11, 2009 at 11:25 AM, stanlick wrote:
>
> I am on a project with a new combination of jars and testing Struts
> interceptors.  I have added the struts2-junit-plugin-2.1.2.jar and also
> spring-test.jar.  When I run my subclass test of StrutsTestCase I get the
> following exception:
>
> SEVERE:   [20:44.438] ** FATAL ERROR STARTING UP STRUTS-SPRING
> INTEGRATION **
> Looks like the Spring listener was not configured for your web app!
> Nothing will work until WebApplicationContextUtils returns a valid
> ApplicationContext.
> You might need to add the following to web.xml:
>    
>
> org.springframework.web.context.ContextLoaderListener
>    
>
>
> Why is the web.xml being considered?
>
> Peace,
> Scott
> --
> View this message in context: 
> http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org