1 Reply Latest reply on May 25, 2009 11:01 PM by Lawrence Li

    Issues with integration test

    Lawrence Li Newbie

      I'm using JBoss Seam 2.1.2 CR1 and I've used Seam-gen to generate my project.  So far, I haven't had any problem with my project but I'm now having issues executing integration tests.  I'm trying to use the default HSQL DB specified for integration tests.  The problem I have so far involves the entityManager component, most likely because of some configuration issue.  I have a simple integration test that I'm trying to execute.  However, when I execute the test, I get the following error:


      [Parser] Running:
        /home/lsli/workspace/myproject/src/test/com/myproject/test/AuthenticatorTest.xml
      
      INFO  [org.quartz.simpl.SimpleThreadPool] Job execution threads will use class loader of thread: main
      INFO  [org.quartz.core.QuartzScheduler] Quartz Scheduler v.1.5.2 created.
      INFO  [org.quartz.simpl.RAMJobStore] RAMJobStore initialized.
      INFO  [org.quartz.impl.StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
      INFO  [org.quartz.impl.StdSchedulerFactory] Quartz scheduler version: 1.5.2
      INFO  [org.quartz.core.QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
      ERROR [org.jboss.seam.security.jaas.SeamLoginModule] Error invoking login method
      javax.el.ELException: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
           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.core.Expressions$2.invoke(Expressions.java:175)
           at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
           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:585)
           at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
           at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
           at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
           at java.security.AccessController.doPrivileged(Native Method)
           at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
           at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:344)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:332)
           at org.jboss.seam.security.Identity.login(Identity.java:259)
           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:585)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
           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.AbstractSeamTest$Request.invokeMethod(AbstractSeamTest.java:463)
           at org.jboss.seam.mock.AbstractSeamTest$Request.invokeAction(AbstractSeamTest.java:472)
           at com.myproject.test.AuthenticatorTest$6.invokeApplication(AuthenticatorTest.java:124)
           at org.jboss.seam.mock.AbstractSeamTest$Request.invokeApplicationPhase(AbstractSeamTest.java:646)
           at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:595)
           at org.jboss.seam.mock.AbstractSeamTest$Request.access$100(AbstractSeamTest.java:177)
           at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:497)
           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.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           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.IdentityFilter.doFilter(IdentityFilter.java:40)
           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.AbstractSeamTest$Request.run(AbstractSeamTest.java:491)
           at com.myproject.test.AuthenticatorTest.test_authenticator_failure(AuthenticatorTest.java:133)
           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:585)
           at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
           at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
           at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
           at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
           at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
           at org.testng.TestRunner.runWorkers(TestRunner.java:712)
           at org.testng.TestRunner.privateRun(TestRunner.java:582)
           at org.testng.TestRunner.run(TestRunner.java:477)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
           at org.testng.SuiteRunner.run(SuiteRunner.java:198)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
           at org.testng.TestNG.run(TestNG.java:708)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
           at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
           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:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.unwrap(Component.java:2275)
           at org.jboss.seam.Component.getInstance(Component.java:2041)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
           at org.jboss.seam.Component.getValueToInject(Component.java:2301)
           at org.jboss.seam.Component.injectAttributes(Component.java:1736)
           at org.jboss.seam.Component.inject(Component.java:1554)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           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:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.myproject.action.session.Authenticator_$$_javassist_seam_2.authenticate(Authenticator_$$_javassist_seam_2.java)
           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:585)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
           ... 71 more
      Caused by: javax.naming.NameNotFoundException: entityManager not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
           ... 101 more
      ERROR [org.jboss.seam.security.jaas.SeamLoginModule] Error invoking login method
      javax.el.ELException: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
           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.core.Expressions$2.invoke(Expressions.java:175)
           at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
           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:585)
           at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
           at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
           at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
           at java.security.AccessController.doPrivileged(Native Method)
           at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
           at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:344)
           at org.jboss.seam.security.Identity.authenticate(Identity.java:332)
           at org.jboss.seam.security.Identity.login(Identity.java:259)
           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:585)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
           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.AbstractSeamTest$Request.invokeMethod(AbstractSeamTest.java:463)
           at org.jboss.seam.mock.AbstractSeamTest$Request.invokeAction(AbstractSeamTest.java:472)
           at com.myproject.test.AuthenticatorTest$2.invokeApplication(AuthenticatorTest.java:50)
           at org.jboss.seam.mock.AbstractSeamTest$Request.invokeApplicationPhase(AbstractSeamTest.java:646)
           at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:595)
           at org.jboss.seam.mock.AbstractSeamTest$Request.access$100(AbstractSeamTest.java:177)
           at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:497)
           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.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           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.IdentityFilter.doFilter(IdentityFilter.java:40)
           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.AbstractSeamTest$Request.run(AbstractSeamTest.java:491)
           at com.myproject.test.AuthenticatorTest.test_authenticator(AuthenticatorTest.java:59)
           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:585)
           at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
           at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
           at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
           at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
           at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
           at org.testng.TestRunner.runWorkers(TestRunner.java:712)
           at org.testng.TestRunner.privateRun(TestRunner.java:582)
           at org.testng.TestRunner.run(TestRunner.java:477)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
           at org.testng.SuiteRunner.run(SuiteRunner.java:198)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
           at org.testng.TestNG.run(TestNG.java:708)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
           at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
           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:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.unwrap(Component.java:2275)
           at org.jboss.seam.Component.getInstance(Component.java:2041)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
           at org.jboss.seam.Component.getValueToInject(Component.java:2301)
           at org.jboss.seam.Component.injectAttributes(Component.java:1736)
           at org.jboss.seam.Component.inject(Component.java:1554)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           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:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.myproject.action.session.Authenticator_$$_javassist_seam_2.authenticate(Authenticator_$$_javassist_seam_2.java)
           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:585)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
           ... 71 more
      Caused by: javax.naming.NameNotFoundException: entityManager not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
           ... 101 more
      PASSED: test_authenticator_failure
      FAILED: test_authenticator
      java.lang.AssertionError: java.lang.NullPointerException
           at org.jboss.seam.mock.AbstractSeamTest$Request.onException(AbstractSeamTest.java:455)
           at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:504)
           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.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           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.IdentityFilter.doFilter(IdentityFilter.java:40)
           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.AbstractSeamTest$Request.run(AbstractSeamTest.java:491)
           at com.myproject.test.AuthenticatorTest.test_authenticator(AuthenticatorTest.java:59)
      Caused by: java.lang.NullPointerException
           at com.myproject.test.AuthenticatorTest$2.renderResponse(AuthenticatorTest.java:56)
           at org.jboss.seam.mock.AbstractSeamTest$Request.renderResponsePhase(AbstractSeamTest.java:623)
           at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:608)
           at org.jboss.seam.mock.AbstractSeamTest$Request.access$100(AbstractSeamTest.java:177)
           at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:497)
           ... 36 more
      ... Removed 22 stack frames
      



      When I modify the log4j.xml file so that more logging is enabled, I do not notice any strange errors except for a the following warning:


      WARN  [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      



      What am I doing wrong?  I haven't really changed anything in the configuration files generated by seam-gen.


      Here's my persistence-test.xml:


      <?xml version="1.0" encoding="UTF-8"?>
           <!-- Persistence deployment descriptor for tests -->
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
           version="1.0">
      
           <persistence-unit name="myproject">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>java:/DefaultDS</jta-data-source>
                <properties>
                     <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                     <property name="hibernate.show_sql" value="true" />
                     <property name="hibernate.cache.use_second_level_cache"
                          value="false" />
                     <property name="jboss.entity.manager.factory.jndi.name"
                          value="java:/myprojectManagerFactory" />
                </properties>
           </persistence-unit>
      
      </persistence>
      

        • 1. Re: Issues with integration test
          Lawrence Li Newbie

          Looks like there is an issue with the seam gen Ant build script.  It's missing a filterset in a copy task (a filterset with a refid of seam should be added):


          <target name="buildtest" depends="init,compiletest,copytestclasses" description="Build the tests">
                    <copy todir="${test.dir}">
                         <filterset refid="seam" /> ...



          Another issue is that the test targets do not copy over the component.xml files in the source code and the following copy tasks should be added:


          <fileset dir="${src.model.dir}">
                              <include name="**/*.component.xml" />
                              <include name="**/components.xml" />
                         </fileset>
                         <fileset dir="${src.action.dir}">
                              <include name="**/*.component.xml" />
                              <include name="**/components.xml" />
                         </fileset>



          Once I added these changes, everything worked.