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

Incomplete arquillian-testng.jar for TestNG 6.10+

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • 1.1.13.Final
    • Base Implementation, Daemon
    • None
    • Hide

      1. git clone https://github.com/starksm64/arq-testnq-tests
      2. cd arq-testnq-tests
      3. mvn test -Dtest=ex.ExceptionTest
      4. mvn test -Dtest=arq.URLPackageScannerTest

      Show
      1. git clone https://github.com/starksm64/arq-testnq-tests 2. cd arq-testnq-tests 3. mvn test -Dtest=ex.ExceptionTest 4. mvn test -Dtest=arq.URLPackageScannerTest

    Description

      I have created a simple cdi test that illustrates a problem I'm seeing with TestNG based remote tests running in Wildfly-Swarm. The issue is that the arquillian-testng.jar that is attached to the test WebArchive is missing the majority of TestNG classes, and so the test fails to load in the container runtime.

      I have created a https://github.com/starksm64/arq-testnq-tests repository with two tests that illustrate the problem.

      There is a ex.ExceptionTest that illustrates the inability to deploy the test due to NoClassDefFoundError:

      2017-09-20 16:49:37,560 ERROR [stderr] (nioEventLoopGroup-3-1) java.lang.NoClassDefFoundError: Failed to link ex/ExceptionTest (Module "deployment.exTest.war:main" from Service Module Loader): Failed to link org/jboss/arquillian/testng/Arquillian (Module "deployment.exTest.war:main" from Service Module Loader): Failed to link org/testng/IHookable (Module "deployment.exTest.war:main" from Service Module Loader): org/testng/ITestNGListener
      2017-09-20 16:49:37,560 ERROR [stderr] (nioEventLoopGroup-3-1) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2017-09-20 16:49:37,560 ERROR [stderr] (nioEventLoopGroup-3-1) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      2017-09-20 16:49:37,560 ERROR [stderr] (nioEventLoopGroup-3-1) 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      2017-09-20 16:49:37,560 ERROR [stderr] (nioEventLoopGroup-3-1) 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.Module.loadModuleClass(Module.java:606)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
      2017-09-20 16:49:37,561 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.wildfly.swarm.arquillian.daemon.TestRunner.executeTest(TestRunner.java:45)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.wildfly.swarm.arquillian.daemon.server.Server.executeTest(Server.java:250)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.wildfly.swarm.arquillian.daemon.server.Server$StringCommandHandler.channelRead0(Server.java:361)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at org.wildfly.swarm.arquillian.daemon.server.Server$StringCommandHandler.channelRead0(Server.java:303)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)
      2017-09-20 16:49:37,562 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
      2017-09-20 16:49:37,563 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
      2017-09-20 16:49:37,564 ERROR [stderr] (nioEventLoopGroup-3-1) 	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
      2017-09-20 16:49:37,564 ERROR [stderr] (nioEventLoopGroup-3-1) 	at java.lang.Thread.run(Thread.java:748)
      
      

      The test includes a TestNGArchiveProcessor AuxiliaryArchiveProcessor implementation that dumps out the arquillian-testng.jar seen in the WebArchive. It shows only the following org.testng package classes when run form within the Intellij IDEA IDE:

      *-testng.jar contents: arquillian-testng.jar:
      /org/
      /org/testng/
      /org/testng/IDEARemoteTestNG.class
      /org/testng/IDEATestNGConfigurationListener.class
      /org/testng/IDEATestNGInvokedMethodListener.class
      /org/testng/IDEATestNGListener.class
      /org/testng/IDEATestNGRemoteListener$DelegatedResult.class
      /org/testng/IDEATestNGRemoteListener$ExposedTestResult.class
      /org/testng/IDEATestNGRemoteListener.class
      /org/testng/IDEATestNGSuiteListener.class
      /org/testng/IDEATestNGTestListener.class
      /org/testng/MapSerializerUtil$1.class
      /org/testng/MapSerializerUtil$EscapeInfoProvider.class
      /org/testng/MapSerializerUtil.class
      /org/testng/RemoteTestNGStarter.class
      /org/testng/TestNGExpectedPatterns.class
      /org/testng/TestNGForkedSplitter.class
      /org/testng/TestNGForkedStarter.class
      /org/testng/TestNGTestDiscoveryListener.class
      /org/testng/TestNGXmlSuiteHelper$Logger$1.class
      /org/testng/TestNGXmlSuiteHelper$Logger.class
      /org/testng/TestNGXmlSuiteHelper.class
      

      When run from the command line the arquillian-testng.jar contains no org.testng package classes.

      The underlying problem seems to be how the org.jboss.shrinkwrap.impl.base.URLPackageScanner includes package classes. I have a simple arq.URLPackageScannerTest in the that illustrates how URLPackageScanner fails to located org.testng classes.

      Attachments

        Issue Links

          Activity

            People

              arubinge@redhat.com Andrew Rubinger (Inactive)
              starksm64 Scott Stark (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: