[jboss-user] [JBoss Seam] - Re: Integration Testing with TestNG and embeddedEjb
b.reeve
do-not-reply at jboss.com
Tue Oct 16 13:29:19 EDT 2007
My Seam application has Spring beans injected into some of the components. When i try to do an integration testing, I get this exception
| Error writing 'searchTerm' on type com.test.seam.ui.backing.SearchBean_$$_javassist_0
| at javax.el.BeanELResolver.setValue(BeanELResolver.java:112)
| at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
| at com.sun.el.parser.AstValue.setValue(AstValue.java:140)
| at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:255)
| at org.jboss.seam.util.UnifiedELValueBinding.setValue(UnifiedELValueBinding.java:44)
| at org.jboss.seam.mock.SeamTest$Request.setValue(SeamTest.java:374)
| at test.testNG.UITestNG$1.updateModelValues(UITestNG.java:55)
| at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:476)
| at test.testNG.UITestNG.testRegister(UITestNG.java:74)
| Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: searchBean.searchService
| at org.jboss.seam.Component.getValueToInject(Component.java:1919)
| at org.jboss.seam.Component.injectAttributes(Component.java:1368)
| at org.jboss.seam.Component.inject(Component.java:1195)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| atcom.test.seam.ui.backing.SearchBean_$$_javassist_0.setSearchTerm(SearchBean_$$_javassist_0.java)
| at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
| ... 30 more
|
I have added the SpringContextLoader in the components.xml file and my application context is getting loaded.
Correct me if I am wrong, I believe that I dont have to specify @In(required=false) because I want the service object to be injected when the seam component is installed. So, is there anything other than this that i need to do to get the Spring beans injected into my Seam component during Integration testing. Please help, I am totally struggling with this.
Thanks.....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095742#4095742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095742
More information about the jboss-user
mailing list