Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-659

Testclass is missing in test.ear when bundling EnterpriseArchive with Arquillian.

XMLWordPrintable

      if shrink wrapping in the following way:

          @Deployment
          public static EnterpriseArchive createTestArchive() {
      
              JavaArchive jar = ShrinkWrap.create(JavaArchive.class,"test.jar").addClasses(
                      SomeClass1.class,
                      SomeClass2.class)
                      .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
              
              File file = new File("src/test/resources/arquillian-application.xml");
              
              EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
                      .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
                      .artifact("org.demo.test:util:1.0-SNAPSHOT").resolveAs(GenericArchive.class))
                      .setApplicationXML(file)
                      .addAsLibraries(jar)
      
              return ear;
          }
      

      then the actual test class (the one extending Arquillian.class) is nowhere to be found in

      test.ear

      .
      This means a "no class def found" exception is beeing thrown by the container upon test execution after deployment.

              bartosz-1 Bartosz Majsak
              hpgisler Hanspeter Gisler (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: