2 Replies Latest reply on Oct 9, 2013 1:09 PM by THIAGO VARGAS

    Problem with arquillian persistence

    THIAGO VARGAS Newbie

      Hi guys,

       

      I have a problem, look at the code below:

       

      It's a arquillian test.

       

       

      @Test
      //@UsingDataSet("datasets/processo.xml")
      public void testList() throws Exception{
      ClientResponse<Processos> response = new ClientRequest(AREA_CONTEXT).accept(MediaType.APPLICATION_JSON).get(Processos.class);;
      Assert.assertEquals(200, response.getStatus());
      Processos processos = response.getEntity(Processos.class);
      Assert.assertNotNull(processos);
      Assert.assertNotNull(processos.getProcessos());
      }

       

      As the above code, if the words "@ UsingDataSet (" datasets / processo.xml ")" is not commented, the inclusion of the contents of datasets work well, but when running junit test generates the following error:

       

       

      Out 08, 2013 5:40:03 PM org.jboss.arquillian.protocol.jmx.JMXMethodExecutor invoke

      SEVERE: Failed: org.arquillian.exemple.AreaRestTest.testList

      java.lang.reflect.UndeclaredThrowableException

        at com.sun.proxy.$Proxy17.runTestMethod(Unknown Source)

        at org.jboss.arquillian.protocol.jmx.JMXMethodExecutor.invoke(JMXMethodExecutor.java:71)

        at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:120)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

        at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

        at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

        at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

        at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

        at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

        at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)

        at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

        at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

        at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

        at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)

        at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

        at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

        at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

        at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: java.io.IOException: Unable to invoke invoke(), status=WAITING

        at org.jboss.remotingjmx.protocol.v1.ClientConnection$TheConnection.invoke(ClientConnection.java:1218)

        at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:305)

        ... 76 more

       

       

      17:40:04,181 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011403: Stopping Persistence Unit Service 'Test.war#sigaPU'

      17:40:05,507 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment Test.war in 1552ms

      17:40:05,776 INFO  [org.jboss.as.repository] (management-handler-thread - 5) JBAS014901: Content removed from location C:\Users\jexp21\git\siga\siga-test\target\jboss-as-7.1.1.Final\standalone\data\content\16\e5965498e0ee2f129d7ea13f5faea8bcf22fea\content

      17:40:05,779 INFO  [org.jboss.as.server] (management-handler-thread - 5) JBAS018558: Undeployed "Test.war"

      17:40:05,816 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment arquillian-service in 5ms

      17:40:06,100 INFO  [org.jboss.as.repository] (management-handler-thread - 6) JBAS014901: Content removed from location C:\Users\jexp21\git\siga\siga-test\target\jboss-as-7.1.1.Final\standalone\data\content\e7\24ee0f85d5549eb4b1e48f329457a86a2dc93d\content

      17:40:06,104 INFO  [org.jboss.as.server] (management-handler-thread - 6) JBAS018558: Undeployed "arquillian-service"

       

       

       

      The curious thing is that the test with the "@UsingDataSet" achieves its goal (inserts, clean, and etc. the data of the dataset in the database), but it generates the error. Without @UsingDataSet, and the database populated previously, the test works well.

      Then suppose that something goes wrong with the Arquillian persistence.

      Any ideas anyone?