RE: JUnit Tests failing after config change

2013-07-25 Thread Michael Chandler
Oh man.  That's exactly it.  Obviously, when I'm not running in the Tomcat 
environment, I'm missing a few things.

Thanks for pointing that out Gabriel.  I'm right back on track!  Cheers!

Mike

-Original Message-
From: Gabriel Landon [mailto:glan...@piti.pf] 
Sent: Thursday, July 25, 2013 11:08 AM
To: users@wicket.apache.org
Subject: Re: JUnit Tests failing after config change

Mike,
Maybe you could just add this in you pom.xml :


javax.servlet
servlet-api
2.5
test


Regards,

Gabriel.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JUnit-Tests-failing-after-config-change-tp4660493p4660495.html
Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: JUnit Tests failing after config change

2013-07-25 Thread Gabriel Landon
Mike,
Maybe you could just add this in you pom.xml :


javax.servlet
servlet-api
2.5
test


Regards,

Gabriel.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JUnit-Tests-failing-after-config-change-tp4660493p4660495.html
Sent from the Users forum mailing list archive at Nabble.com.

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



JUnit Tests failing after config change

2013-07-25 Thread Michael Chandler
In order to support the use of the @SpringBean annotation, I've made some 
adjustments to my Wicket application that work beautifully right out of the 
gate.  The documentation and assistance from this list helped get me up to 
speed and working quickly.  HOWEVER, my JUnit tests are now failing when 
attempting to create my Wicket application bean, as follows:

Error creating bean with name 'wicketApplication' defined in class path 
resource [applicationContext.xml]: Initialization of bean failed; nested 
exception is java.lang.NoClassDefFoundError: javax/servlet/ServletContext

Since these tests aren't Wicket specific, I can comment out the bean definition 
in applicationContext.xml and the tests run flawlessly, but that's certainly 
not an acceptable fix.  The error indicates that I'm missing some dependencies 
(I'm guessing) but as a Maven project with Eclipse properly configured, I would 
think I would bomb when running the app normally and not just when running 
tests.

Anyone have any ideas on what's going wrong here?

To sum up, here are the modifications I made to make use of @SpringBean

Included the following in web.xml:


org.springframework.web.context.ContextLoaderListener



wicket.wicketFilter

org.apache.wicket.protocol.http.WicketFilter



applicationFactoryClassName

org.apache.wicket.spring.SpringWebApplicationFactory



Referenced my primary WicketApplication class as a bean in 
applicationContext.xml:


And in my WicketApplication, I included the following in my init() method:
getComponentInstantiationListeners().add(new SpringComponentInjector(this));

The results were great and I've been trucking along... but then I ran my unit 
tests and found that exception.  Does anyone have any advice?

A more complete stack trace follows if it's helpful:

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'wicketApplication' defined in class path resource 
[applicationContext.xml]: Initialization of bean failed; nested exception is 
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at 
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at 
com.oa.frontoffice.service.BeanService.(BeanService.java:9)
at 
com.oa.frontoffice.service.BeanService.getInstance(BeanService.java:17)
at 
com.oa.frontoffice.gateway.HotListGateway.(HotListGateway.java:22)
at 
com.oa.frontoffice.gateway.TestHotListGatewayIntegration.setUp(TestHotListGatewayIntegration.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at 
org.eclipse.jdt.internal.junit4.run