Testing in Seam, Ant succeeds, TestNG plugin fails
mikael.brodd Oct 1, 2010 11:48 AMHi,
I am trying to get the integration testing going in my environment. I have begun with the examples from the book Seam in Action, using the existing source code downloadable from http://code.google.com/p/seaminaction/
I start out with testing via 'ant test', and it works fine.
Then I install the testNG plugin in eclipse, follow the readMe.txt in the open18/src/test directory, adding jar:s and bootstrap directory to classpath.
Then I add
-Dsun.lang.ClassLoader.allowArraySyntax=true
to JVM argument when running the test, to fix bug in JDK 1.6
But running the integration test with the plugin fails with the following stack trace. Ideas?
[Parser] Running:
C:\Documents and Settings\xmikbro\Local Settings\Temp\testng-eclipse-1505632501\testng-customsuite.xml
WARN [org.jboss.seam.security.RuleBasedIdentity] no security rule base available - please install a RuleBase with the name 'securityRules' if permission checks are required.
INFO [org.open18.action.RegisterAction] registerAction.register() action called
INFO [org.open18.action.RegisterAction] Registering golfer twoputt
FAILED: registerValidGolfer
java.lang.AssertionError: javax.el.ELException: java.lang.NullPointerException
at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:488)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:537)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:524)
at org.open18.test.RegisterGolferIntegrationTest.registerValidGolfer(RegisterGolferIntegrationTest.java:46)
Caused by: javax.el.ELException: java.lang.NullPointerException
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.jboss.seam.mock.BaseSeamTest$Request.invokeMethod(BaseSeamTest.java:496)
at org.open18.test.RegisterGolferIntegrationTest$1.invokeApplication(RegisterGolferIntegrationTest.java:34)
at org.jboss.seam.mock.BaseSeamTest$Request.invokeApplicationPhase(BaseSeamTest.java:660)
at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:609)
at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:184)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:530)
... 34 more
Caused by: java.lang.NullPointerException
at org.open18.action.RegisterAction.register(RegisterAction.java:38)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at org.open18.action.RegisterAction_$$_javassist_2.register(RegisterAction_$$_javassist_2.java)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
... 44 more
... Removed 30 stack frames
===============================================
org.open18.test.RegisterGolferIntegrationTest
Tests run: 1, Failures: 1, Skips: 0
===============================================
===============================================
open18
Total tests run: 1, Failures: 1, Skips: 0
===============================================
I am trying to get the integration testing going in my environment. I have begun with the examples from the book Seam in Action, using the existing source code downloadable from http://code.google.com/p/seaminaction/
I start out with testing via 'ant test', and it works fine.
Then I install the testNG plugin in eclipse, follow the readMe.txt in the open18/src/test directory, adding jar:s and bootstrap directory to classpath.
Then I add
-Dsun.lang.ClassLoader.allowArraySyntax=true
to JVM argument when running the test, to fix bug in JDK 1.6
But running the integration test with the plugin fails with the following stack trace. Ideas?
[Parser] Running:
C:\Documents and Settings\xmikbro\Local Settings\Temp\testng-eclipse-1505632501\testng-customsuite.xml
WARN [org.jboss.seam.security.RuleBasedIdentity] no security rule base available - please install a RuleBase with the name 'securityRules' if permission checks are required.
INFO [org.open18.action.RegisterAction] registerAction.register() action called
INFO [org.open18.action.RegisterAction] Registering golfer twoputt
FAILED: registerValidGolfer
java.lang.AssertionError: javax.el.ELException: java.lang.NullPointerException
at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:488)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:537)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:524)
at org.open18.test.RegisterGolferIntegrationTest.registerValidGolfer(RegisterGolferIntegrationTest.java:46)
Caused by: javax.el.ELException: java.lang.NullPointerException
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.jboss.seam.mock.BaseSeamTest$Request.invokeMethod(BaseSeamTest.java:496)
at org.open18.test.RegisterGolferIntegrationTest$1.invokeApplication(RegisterGolferIntegrationTest.java:34)
at org.jboss.seam.mock.BaseSeamTest$Request.invokeApplicationPhase(BaseSeamTest.java:660)
at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:609)
at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:184)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:530)
... 34 more
Caused by: java.lang.NullPointerException
at org.open18.action.RegisterAction.register(RegisterAction.java:38)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at org.open18.action.RegisterAction_$$_javassist_2.register(RegisterAction_$$_javassist_2.java)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
... 44 more
... Removed 30 stack frames
===============================================
org.open18.test.RegisterGolferIntegrationTest
Tests run: 1, Failures: 1, Skips: 0
===============================================
===============================================
open18
Total tests run: 1, Failures: 1, Skips: 0
===============================================