2 Replies Latest reply on Feb 24, 2017 6:47 PM by Thomas Morrow

    Using Arquillian without mvn, forge, or ant+ivy

    Thomas Morrow Newbie

      I realize the following scenario is off the beaten path,  but I don't have any choice.  I would love some sort of suggestion on how to approach this problem.  Even if it is only a take a look at this webpage, etc.  All of the solutions seem to use a build/dependency tool besides ant.

      I'm  working on a project where the systems we work on can't be connected to the internet.  We also can't bring in any new executables without a large paperwork trail.  It would take many months to bring in open source executable software.  I can however bring in libraries or jar files.  Our development environment contains wildfly, mysql, hibernate and netbeans as an ide.   I would like to add Arquillian to that.  If there are any other pertinent details I'm leaving out please let me know. 

       

      I have been successful with getting mvn to work with the arquillian guides using a remote wildfly container on a computer connected to the internet.  I have also been able to get mvn to export all of the dependencies for the guides to a separate directory.

       

      I'm trying to create a typical ant netbeans project that will run a really simple arquillian project.  It is basically a hello world project.  I created a java ee project, created a simple class Happy and then added all of the dependencies from mvn to the Test Libraries folder.  I then added an arquillian.xml under TestPackages/resources.  For a simple test,  I added HappyTest based on the code from the Getting Started Guide.

       

      I put the code in github here.

       

      My Test class looks like the following

       

      @RunWith(Arquillian.class)
      public class HappyTest {
          
          @Deployment
          public static JavaArchive createDeployment() {
              return ShrinkWrap.create(JavaArchive.class)
                      .addClass(Happy.class)
                      .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
          }
          
          @Inject
          Happy happy;
          
          @Test
          public void beHappy() {
              Assert.assertEquals("the thing",
                      happy.getSomething());
              
          }
      }
      

       

       

       

       

       

      When running the test I get the below errors

       

      Do I need some sort of other dependency to do this?  Or do I need to change my build files to do this correctly?

       

      Thanks

       

      Testcase: org.arquillian.example.HappyTest:Caused an ERROR

      Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.JavaArchive org.arquillian.example.HappyTest.createDeployment()

      java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.JavaArchive org.arquillian.example.HappyTest.createDeployment()

      at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:181)
      at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:103)
      at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:64)
      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      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:145)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      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.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)
      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:202)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:431)
      at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:55)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:219)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:167)

      Caused by: java.lang.reflect.InvocationTargetException

      at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:177)

      Caused by: java.lang.IllegalArgumentException: WEB-INF/classes/org/arquillian/example/HappyTest.class not found in classloader sun.misc.Launcher$AppClassLoader@1c6b6478

      at org.jboss.shrinkwrap.api.asset.ClassLoaderAsset.<init>(ClassLoaderAsset.java:70)
      at org.jboss.shrinkwrap.impl.base.URLPackageScanner.foundClass(URLPackageScanner.java:165)
      at org.jboss.shrinkwrap.impl.base.URLPackageScanner.handle(URLPackageScanner.java:157)
      at org.jboss.shrinkwrap.impl.base.URLPackageScanner.handle(URLPackageScanner.java:145)
      at org.jboss.shrinkwrap.impl.base.URLPackageScanner.scanPackage(URLPackageScanner.java:113)
      at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackage(ContainerBase.java:1520)
      at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackages(ContainerBase.java:1497)
      at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addClasses(ContainerBase.java:1358)
      at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addClass(ContainerBase.java:1285)
      at org.arquillian.example.HappyTest.createDeployment(HappyTest.java:19)

       

      Message was edited by: Thomas Morrow

       

      Message was edited by: Thomas Morrow to add a little more detail