2 Replies Latest reply on Nov 23, 2014 4:08 PM by john.genoese

    Running Arquilian Tests in Eclipse

    marcusdidiusfalco

      Hello,

       

      I have set up a test project with the jboss-javaee6-webapp-archetype. I contains one arquillian test.

      When I use maven

      mvn clean test -Parq-jbossas-remote

      the test succeeds.

      However when I try to start the test from Eclipse (Kepler Release) with "Run As Junit" I get the following error

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

          at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:160)

          at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111)

          at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97)

          at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)

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

          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.lang.reflect.InvocationTargetException

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

          at java.lang.reflect.Constructor.newInstance(Unknown Source)

          at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)

          ... 10 more

      Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container jboss

          at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:85)

          at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:76)

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

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          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.ManagerImpl.bindAndFire(ManagerImpl.java:236)

          at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)

          at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:71)

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

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          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.ManagerImpl.start(ManagerImpl.java:261)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)

          ... 15 more

      Caused by: java.lang.IllegalArgumentException: DeployableContainer must be specified

          at org.jboss.arquillian.core.spi.Validate.notNull(Validate.java:44)

          at org.jboss.arquillian.container.impl.ContainerImpl.<init>(ContainerImpl.java:71)

          at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:76)

          ... 39 more

       

      Thanks for any suggestions

        • 1. Re: Running Arquilian Tests in Eclipse
          aslak

          Have you activated the Maven profile that contains the Container Adapter (e.g. jbossas-arquillian-remote) in Eclipse when you run the test?

          • 2. Re: Running Arquilian Tests in Eclipse
            john.genoese

            aslak.aslak.conduct.no's answer is correct. On the chance that it was just misunderstood or not understood completely, I will elaborate:

            1) Under Project Properties, which you get to by right-clicking on the project root, you see an entry for Maven. Clicking on the word Maven itself will show you the dialog where the active Maven profiles are specified. That's what Aslak is referring to.

            maven.png

            2) Make sure that the profile(s) you specify here are actually in the project's POM.

             

            This got me working just fine.