1 2 Previous Next 17 Replies Latest reply on Jul 1, 2012 9:03 PM by alexh_97

    Persistence Extension tests run and pass but don't appear to actually execute...

    alexh_97 Newbie

      So I was happily running my brand spanking new integration test class with Arquillian 1.0.0.Final, Persistence Etension 1.0.0.Alpha4 and TestNG 6.3.1 on JBoss 7.1.0.Final.  The tests ran and appeared to pass but then I noticed that the database was unmodified and the test that was supposed to fail (because of a bug in the code being tested) instead passed.

       

      My test implementation is a bit different from the simple example given in the docs.  I don't inject an EntityManager directly into the test code.  Instead, I run a true integration test where the EntityManager is injected into one of the EJBs that is called during the test.

      Adding an @Transactional annotation to the tests didn't help.

       

      I have to mention that my persistence.xml has two persistence contexts in it, but only one is actually used during this particular test.

       

      Any ideas or suggestions would be greatly appreciated.

        • 1. Re: Persistence Extension tests run and pass but don't appear to actually execute...
          Bartosz Majsak Master

          If you could extract it to some simplified project I could work on that any time soon and go back with the findings. Sorry to hear that it doesn't work in your case.

          • 2. Re: Persistence Extension tests run and pass but don't appear to actually execute...
            alexh_97 Newbie

            I'll try to get that to you ASAP.

             

            Another observation:  if I set a breakpoint in one of the @Test methods that are also annotated with @UsingDataSet - they never get hit.  A breakpoint set in the same test class in the @Deployment method does get hit.

            • 3. Re: Persistence Extension tests run and pass but don't appear to actually execute...
              Bartosz Majsak Master

              Do you have your debugger connected to JBoss? @Deployment is executed on client side, that's why it always gets hit from IDE, but the test itself is run on different jvm (if you are not using embedded container), hence you might not be able to hit the breakpoint.

              • 4. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                alexh_97 Newbie

                Yes, my debugger is connected to JBoss and I am able to set and hit breakpoints in @Test methods of a similar test class that is using plain DBUnit (w/o the extension).

                • 5. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                  Bartosz Majsak Master

                  Just for a dirty check - can you try with JUnit instead? Maybe there is something in APE which makes TestNG unhappy

                  • 6. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                    alexh_97 Newbie

                    Hmm... Interesting...

                     

                    Using JUnit I get the following exception:

                     

                    16:20:18,551 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-2) Failed: <my_test_class_path_here>: org.jboss.arquillian.persistence.exception.DataSourceNotDefinedException: DataSource not defined! Please declare in arquillian.xml or by using @DataSource annotation.

                              at org.jboss.arquillian.persistence.metadata.PersistenceExtensionFeatureResolver.getDataSourceName(PersistenceExtensionFeatureResolver.java:183) [arquillian-service:]

                              at org.jboss.arquillian.persistence.lifecycle.PersistenceTestTrigger.createDataSource(PersistenceTestTrigger.java:108) [arquillian-service:]

                              at org.jboss.arquillian.persistence.lifecycle.PersistenceTestTrigger.beforeTest(PersistenceTestTrigger.java:90) [arquillian-service:]

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                              at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                              at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]

                              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]

                              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240) [arquillian-service:]

                              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) [arquillian-service:]

                              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [arquillian-service:]

                              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [arquillian-service:]

                              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [arquillian-service:]

                              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [arquillian-service:]

                              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [arquillian-service:]

                              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199) [arquillian-service:]

                              at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [arquillian-service:]

                              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147) [arquillian-service:]

                              at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [arquillian-service:]

                              at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [arquillian-service:]

                              at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65) [arquillian-service:]

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]

                              at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]

                              at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]

                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [rt.jar:1.6.0_22]

                              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [rt.jar:1.6.0_22]

                              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [rt.jar:1.6.0_22]

                              at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:489)

                              at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:243)

                              at org.jboss.remoting3.jmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                              at org.jboss.remoting3.jmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]

                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]

                              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]

                    • 7. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                      Bartosz Majsak Master

                      Yeah, that's the current limitation of APE Ideally datasource should be taken from persistence.xml (and will be in the nearest future by using shrinkwrap descriptors), but for now you need to specify it (as suggested in exception msg). Another thing is that it's not supporting multiple DS yet :/ But I know it is more than needed, so I will focus on it after Alpha5 release with bunch of fixes [hopefully will deal with that over the weekend]

                      • 8. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                        alexh_97 Newbie

                        I added the following to my arquillian.xml:

                         

                        <arquillian xmlns="http://jboss.org/schema/arquillian"

                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                            xsi:schemaLocation="

                                http://jboss.org/schema/arquillian

                                http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

                            <extension qualifier="persistence">

                                <property name="defaultDataSource">java:jboss/datasources/my_ds_name</property>

                                <property name="userTransactionJndi">java:jboss/UserTransaction</property>

                            </extension>

                            <extension qualifier="persistence-dbunit">

                                    <property name="datatypeFactory">org.dbunit.ext.mysql.MySqlDataTypeFactory</property>

                                    <property name="caseSensitiveTableNames">true</property>

                                    <property name="metadataHandler">org.dbunit.ext.mysql.MySqlMetadataHandler</property>

                                  </extension>

                        </arquillian>

                         

                         

                        But now I'm getting this exception.  I'm using @Cleanup(strategy = CleanupStrategy.USED_TABLES_ONLY)  on my test method

                         

                        17:07:16,475 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-9) Failed: com.cartera.members.service.MemberLoginIntegrationTest.testSuccessfulMemberLogin: org.jboss.arquillian.persistence.data.dbunit.exception.DBUnitDataSetHandlingException: Unable to clean database.

                                  at org.jboss.arquillian.persistence.data.dbunit.cleanup.UsedTablesOnlyCleanupStrategyExecutor.cleanupDatabase(UsedTablesOnlyCleanupStrategyExecutor.java:51) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.data.dbunit.DBUnitDataHandler.cleanDatabase(DBUnitDataHandler.java:190) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.data.dbunit.DBUnitDataHandler.cleanup(DBUnitDataHandler.java:122) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.data.dbunit.DBUnitDataStateLogger.aroundCleanup(DBUnitDataStateLogger.java:108) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.lifecycle.DataCleanupHandler.prepareDatabase(DataCleanupHandler.java:60) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.data.dbunit.DBUnitPersistenceTestLifecycleHandler.createDatabaseConnection(DBUnitPersistenceTestLifecycleHandler.java:80) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.lifecycle.ErrorCollectorHandler.createErrorCollector(ErrorCollectorHandler.java:38) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) [arquillian-service:]

                                  at org.jboss.arquillian.persistence.lifecycle.PersistenceTestTrigger.beforeTest(PersistenceTestTrigger.java:91) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135) [arquillian-service:]

                                  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115) [arquillian-service:]

                                  at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240) [arquillian-service:]

                                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) [arquillian-service:]

                                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [arquillian-service:]

                                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [arquillian-service:]

                                  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [arquillian-service:]

                                  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [arquillian-service:]

                                  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [arquillian-service:]

                                  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199) [arquillian-service:]

                                  at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [arquillian-service:]

                                  at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147) [arquillian-service:]

                                  at org.junit.runner.JUnitCore.run(JUnitCore.java:157) [arquillian-service:]

                                  at org.junit.runner.JUnitCore.run(JUnitCore.java:136) [arquillian-service:]

                                  at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65) [arquillian-service:]

                                  at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128) [arquillian-service:]

                                  at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107) [arquillian-service:]

                                  at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:226) [arquillian-service:]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                                  at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [rt.jar:1.6.0_22]

                                  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [rt.jar:1.6.0_22]

                                  at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:489)

                                  at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:243)

                                  at org.jboss.remoting3.jmx.protocol.v1.ServerProxy$InvokeHandler.handle(ServerProxy.java:1034)

                                  at org.jboss.remoting3.jmx.protocol.v1.ServerProxy$MessageReciever$1.run(ServerProxy.java:215)

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]

                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]

                                  at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]

                        Caused by: java.lang.NullPointerException

                                  at org.jboss.arquillian.persistence.data.dbunit.cleanup.UsedTablesOnlyCleanupStrategyExecutor.cleanupDatabase(UsedTablesOnlyCleanupStrategyExecutor.java:46) [arquillian-service:]

                                  ... 159 more

                         

                        BTW, I tried converting it back to TestNG and it went back to pretending it passed w/o actually running the test.

                        • 9. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                          Bartosz Majsak Master

                          Please share a project so I can understand the problem and possibly fix it for you Thank you very much for the feedback.

                           

                          Or... maybe a pull request with failing test in int-test module?

                          • 10. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                            alexh_97 Newbie

                            Bartosz,

                             

                            Here's a super-simple project that allowed me to reproduce the issues I'm seeing with my production code.

                            The setup is:

                            • Java SE SDK 1.6.22
                            • Maven 3.0.3
                            • JBoss 7.1.0.Final
                            • MySQL 5.5

                             

                            You'll need to set up a datasource and edit arquillian.xml and persistence.xml to change the JNDI name.

                            In MySQL I created 2 schemas: "test" (contains table "foo") and "test1" (contains table "bar").  SQL scripts to create the tables are in the dbscripts folder.

                             

                            Problems I'm seeing:

                            • If you run with TestNG (uncomment pom.xml and test class appropriately) the test pretends to pass, but it looks like the @Test method is never called
                            • If you run with JUnit I see two problems:
                              • if @Cleanup is enabled I get
                                23:33:38,315 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-2) Failed: com.example.logic.FooBarBeanTest.testGetAllFooRecords: org.jboss.arquillian.persistence.data.dbunit.exception.DBUnitDataSetHandlingException: Unable to clean database.
                                ....
                                Caused by: java.lang.NullPointerException
                                at org.jboss.arquillian.persistence.data.dbunit.cleanup.UsedTablesOnlyCleanupStrategyExecutor.cleanupDatabase(UsedTablesOnlyCleanupStrategyExecutor.java:46) [arquillian-service:]



                              • if @Cleanup is disabled I get
                                23:28:17,538 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-1) Failed: com.example.logic.FooBarBeanTest.testGetAllFooRecords: org.jboss.arquillian.persistence.data.dbunit.exception.DBUnitDataSetHandlingException: Failed while seeding database.
                                ...
                                Caused by: org.dbunit.dataset.NoSuchTableException: test.foo
                            • I also tried adding the CLEAN_INSERT seed strategy property to arquillian.xml instead of using @Cleanup, but that doesn't seem to work either (I get an exception saying it can't construct a seed strategy from this value)

                             

                            I'm using Eclipse as my IDE.

                             

                            Let me know if you need anything else.

                            • 11. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                              Bartosz Majsak Master

                              Hi Alex,

                               

                              many thanks for spending time on preparing this high quality feedback. Much appreciated. That's the community spirit! I will have a look at what is going on and try to incorporate your examples to my integration test suite.

                               

                              I will keep you updated.

                               

                              Cheers,

                              Bartosz

                              • 13. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                                Bartosz Majsak Master

                                Hi Alex,

                                 

                                I'm working on that at this very moment. I was on holidays last two weeks hence late response. Please give me few more days and I should have Alpha5 ready

                                 

                                Cheers,

                                Bartosz

                                • 14. Re: Persistence Extension tests run and pass but don't appear to actually execute...
                                  alexh_97 Newbie

                                  No worries Bartosz!  Let me know if there's anything elese I can do to help.

                                  1 2 Previous Next