14 Replies Latest reply on Feb 28, 2014 11:32 AM by Tommy Tynjä

    Aquillian jacoco extension can't test code overage of external ear/war

    Andy Ma Newbie

      Hi All,

       

      We have some integration test with Arquillian, and we use Jacoco agent to generate the execution data for Sonar, but the coverage data can not hit the external ear/war packages we deployed with ShrinkWrap.create(ZipImporter.class, "...").importFrom("external jar file").as(WebArchive.class), we already added the arquillian-jacoco extension and jacoco core library to currrent project.

       

      Detail:

       

      We have Project named "platform-rest-ittest" which used to do some integration test for web project "platform-rest", we have the following deployment:

       

      static private EnterpriseArchive getIt(String name)
        {
          return ShrinkWrap.create(ZipImporter.class, name)
              .importFrom(new File(MODULE_PATH + "/" + name))
              .as(EnterpriseArchive.class);
        }
      
      
        static private WebArchive getItWeb(String name)
        {
          return ShrinkWrap.create(ZipImporter.class, name)
              .importFrom(new File(MODULE_PATH + "/" + name)).as(WebArchive.class);
        }
      
        @Deployment(name = "platform-biz-ear", order = 3, testable = false)
        static public EnterpriseArchive createDep1()
        {
          return getIt("platform-biz-ear-1.0-SNAPSHOT.ear");
        }
      
        @Deployment(name = "platform-biz-ia5-ear", order = 4, testable = false)
        static public EnterpriseArchive createDep2()
        {
          return getIt("platform-biz-ia5-ear-1.0-SNAPSHOT.ear");
        }
      
         @Deployment(name = "platform-biz-dde-ear", order = 5, testable = false)
        static public EnterpriseArchive createDep3()
        {
          return getIt("platform-biz-dde-ear-1.0-SNAPSHOT.ear");
        }
      
        @Deployment(name = "platform-biz-preview-ear", order = 6, testable = false)
        static public EnterpriseArchive createDep4()
        {
          return getIt("platform-biz-preview-ear-1.0-SNAPSHOT.ear");
        }
      
        @Deployment(name = "platform-rest", order = 7, testable = false)
        static public WebArchive createDep5()
        {
          return getItWeb("platform-rest-1.0-SNAPSHOT.war");
        }
      

      The test class file is like:

       

       ...
      
      @RunWith(Arquillian.class)
      @RunAsClient
      public class BasicStartupTest extends PatientSelectTestBase
      {
        private static final Logger LOG = LoggerFactory
            .getLogger(BasicStartupTest.class);
      
      
        private static PatientSelectTestDatabase testDataBase = null;
      
        @Deployment(name = "datasource", order = 1, testable = false)  
        public static JavaArchive setupTestDatabase() 
        {
          if (testDataBase == null)
          {
            testDataBase = new PatientSelectTestDatabase();
          }
      
          return testDataBase.getDataSourceDeployment();
        }
      
      
        @Test
        public void testGetStudies()
        {
          Client client = new ResteasyClientBuilder().build();
      
          String target = getJAXRSPrefix() + "studies";
      
          LOG.info("trying to get studies from " + target);
      
          RESTStudies studies = client.target(target)
                             .request(MediaType.APPLICATION_JSON).get(RESTStudies.class); 
      
          assertEquals(204, studies.objects.size());
        }
      
      

      Aquillian.xml:

       

      <arquillian xmlns="http://jboss.org/schema/arquillian"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="
              http://jboss.org/schema/arquillian
              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
      
                 <defaultProtocol type="Servlet 3.0" />
                  <container qualifier="jbossas-7-managed" default="true">
                          <configuration>
                                    <property name="jbossHome">build/jboss-as-7.1.1.Final</property>
                                    <property name="javaVmArguments">-Djboss.socket.binding.port-offset=330 -Djboss.management.native.port=19054</property>
                                    <property name="managementPort">19384</property>
                          </configuration>
                </container>
      
        <engine>
          <property name="deploymentExportPath">target/</property>
        </engine>
      </arquillian>
      
      

      We use Gradle not Maven in project "platform-rest-ittest", and we added the arquillian-jacoco dependency to build.gradle, also added the jacoco agent to junit test like:

       

      dependencies {
                  ......
                  testCompile libraries.junit
                  testCompile('org.jboss.as:jboss-as-arquillian-container-managed:7.1.1.Final') { exclude group: 'org.jboss.shrinkwrap.resolver' }
                  testCompile 'org.jboss.arquillian.junit:arquillian-junit-container:1.0.3.Final'
                  testCompile 'org.jboss.arquillian.protocol:arquillian-protocol-servlet:1.0.3.Final'
                  testCompile 'org.jboss.shrinkwrap:shrinkwrap-api:1.1.1' 
      
      
             testRuntime 'org.jboss.arquillian.extension:arquillian-jacoco:1.0.0.Alpha5'
             testRuntime 'org.jacoco:org.jacoco.core:0.6.2.201302030002'
             jacoco files(rootProject.ext.buildScriptsPath + '/../../Extern/sonar/jacocoagent.jar')
      }
      
      test { 
                jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${rootProject.buildDir}/ittest.jacoco.exec"
      }
      
      

      The result is we has the generated ittest.jacoco.exec file, but the coverage can not hit the code of any external ear or war, the test should hit some code in project "platform-rest" which is imported from "platform-rest-1.0-SNAPSHOT.war", also some code should be coverred in other ear archives.

       

      So my questions:

      1. Did I use arquillian-jacoco extension the wrong way, if I remove the it, I got the same result, seems it didn't work. Does it only used for maven?

      2. What does arquillian-jacoco really do?

      3. Is it possible to test the code coverage of any external archives with arquillian deployment? Most information I searched on internet is talking to single project.

       

      Any one knows this kind of issue?

        • 1. Re: Aquillian jacoco extension can't test code overage of external ear/war
          Andy Ma Newbie

          When run junit from eclipse with debug, I found JacocoConfiguration.isJacocoAgentActive() returns false in JacocoExtension.register(...), does it mean the jacoco agent is not running, I already add the argument for junit configuration like:

          -javaagent:d:/Projects/Head/Extern/sonar/jacocoagent.jar=destfile=${project_loc}/target/ittest.jacoco.exec

          how to active the jacoco agent?

          • 2. Re: Aquillian jacoco extension can't test code overage of external ear/war
            Aslak Knutsen Master

            One problem here is that the Jacoco extension will only process nested jar/wars if they are of type ArchiveAssets (which they are if they are added via ie. war.addLibrary(archive)). When you're using the ZipImporter they will all be a different type of Asset. This is a bad assumption on the Jacoco extensions side.

             

            The issue is probably here: https://github.com/arquillian/arquillian-extension-jacoco/blob/master/src/main/java/org/jboss/arquillian/extension/jacoco/client/ApplicationArchiveInstrumenter.java#L65

             

            That part should be replaced with something like if asset.getPath().endsWith(".jar|.war|.rar") subArchive = archive.getAs(asset.getPath(), GenericArchive.class)

             

            Could you please file a issue here: https://issues.jboss.org/browse/ARQ on the "Extension - Jacoco" component?

             

             

            I've never tried to run Jacoco from IDE without launching it via the Emma plugin.

            • 3. Re: Aquillian jacoco extension can't test code overage of external ear/war
              Andy Ma Newbie

              Hi Aslak,

               

              Thank you for you reply, I already created the jira issue https://issues.jboss.org/browse/ARQ-1387.

              So I wander without using ZipImporter, is there any other method I can use for testing the coverage of external jar/war/ear?

              • 4. Re: Aquillian jacoco extension can't test code overage of external ear/war
                Aslak Knutsen Master

                If you do something similar to:

                 

                importedArchive.getAsType(Genericrchive.class, Filters.include("*\\.(war|jar|ear|rar)"))

                 

                within the @Deployment method before you return, you force ShrinkWrap to import all the sub archives as ArchiveAsset's as well, which, at least in theory, should make Jacoco see them.

                • 5. Re: Aquillian jacoco extension can't test code overage of external ear/war
                  Andy Ma Newbie

                  Hi Aslak,

                   

                  I change it like follow, my ear contains some jar files, no other archive type:

                  static private EnterpriseArchive getIt(String name)

                    {

                      EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class, name)

                          .importFrom(new File(MODULE_PATH + "/" + name))

                          .as(EnterpriseArchive.class);

                     

                      ear.getAsType(JavaArchive.class, Filters.include("org\\.mypackage\\..*\\.jar"));

                   

                      return ear;

                    }

                   

                  It seems still not work, the result is the same.

                  But from debugging the code I see when call getAsType, it will detele the old jar with ZipFileEntryAsset type and add the jar file as new JavaArchive to ear in ArchiveBase.class file.

                  try {

                              stream = asset.openStream();

                              X archive = ShrinkWrap.create(formatBinding.getImporter(), path.get()).importFrom(stream).as(type);

                              delete(path);

                              add(new ArchiveAsset(archive, formatBinding.getExporter()), path);

                   

                   

                              return archive;

                          }

                  How about the class files in the ear archive deployed with ZipImporter, any changes for it too?

                  Why the test still can't hit the code in EAR archive? Can you give some more advice?

                  • 6. Re: Aquillian jacoco extension can't test code overage of external ear/war
                    Andy Ma Newbie

                    I am using arquillian-jacoco:1.0.0.Alpha5 and jacoco.core:0.6.2.201302030002, our projects are not maven based, so any reason from following cases:

                    1. Do we use the wrong jacoco.core version, I tried to debug within eclipse IDE with version org.jacoco.core-0.6.0.201210061924, the junit test is ok, but console report errors like:

                    java.lang.NoSuchMethodException: org.jacoco.agent.rt.internal_1023626.core.runtime.RuntimeData.getExecutionData([Ljava.lang.Object;)

                              at java.lang.Class.getDeclaredMethod(Unknown Source)

                              at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.copyToAgentExecutionStore(CoverageDataReceiver.java:46)

                              at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.storeCoverageData(CoverageDataReceiver.java:30)

                              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)

                       Seems this error complains there's no org.jacoco.core.runtime.RuntimeData, and it is true.

                    if use jacoco.core:0.6.2.201302030002, also has errors:

                        java.lang.NoSuchMethodError: org.jacoco.core.runtime.IRuntime.setSessionId(Ljava/lang/String;)V

                        at org.jboss.arquillian.extension.jacoco.container.StartCoverageData.createRuntime(StartCoverageData.java:43)

                        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)

                      Seems arquillian-jacoco:1.0.0.Alpha5 not support jacoco.core:0.6.2.201302030002.

                    2. Is it the reason we use testable=false, for @Deployment ? When I set testable = ture, I can debug to code https://github.com/arquillian/arquillian-extension-jacoco/blob/master/src/main/java/org/jboss/arquillian/extension/jacoco/client/ApplicationArchiveInstrumenter.java#L65, otherwise not, but the deployment will fail.

                    • 7. Re: Aquillian jacoco extension can't test code overage of external ear/war
                      Bartosz Majsak Master

                      Hi Andy,

                       

                      latest jacoco extension didn't work for me with 0.6.2... but it did with 0.6.0. Have you tried this version?

                      http://arquillian.org/blog/2012/11/27/arquillian-extension-jacoco-1-0-0-Alpha5/

                       

                      HTH

                      Bartosz

                      • 8. Re: Aquillian jacoco extension can't test code overage of external ear/war
                        Andy Ma Newbie

                        Yes, with org.jacoco.core-0.6.0.201210061924, the junit test can run, but some errors found in console:

                        java.lang.NoSuchMethodException: org.jacoco.agent.rt.internal_1023626.core.runtime.RuntimeData.getExecutionData([Ljava.lang.Object;)

                                  at java.lang.Class.getDeclaredMethod(Unknown Source)

                                  at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.copyToAgentExecutionStore(CoverageDataReceiver.java:46)

                                  at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.storeCoverageData(CoverageDataReceiver.java:30)

                                  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)

                         

                           Seems this error complains there's no org.jacoco.core.runtime.RuntimeData.

                        • 9. Re: Aquillian jacoco extension can't test code overage of external ear/war
                          Andy Ma Newbie

                          Hi Aslak,

                           

                          I just read one question here https://community.jboss.org/thread/228344  , and your reply mentioned than jacoco can not cover code deployed with testable equals false, so I guess this is the real reason I can't get the coverage even I did as you suggested. But simply change testable to true will make the deployment fail. I think currently we can't get the coverage with this limitation.

                          Thanks a lot.

                          • 10. Re: Aquillian jacoco extension can't test code overage of external ear/war
                            javag Newbie

                            Hi Bartosh,

                            I'm trying to run arquillian-jacoco extension 1.0.0.Alpha5 with latest release of org.jacoco.core 0.6.3.201306030806 - it doesn't seem to work together...

                            i also tried all the version combinations you suggested in this post, and each one has its own missing methods exceptions (although different ones).

                            Do you have any idea how can we get out of this swamp?

                             

                            ======================================================================================================================

                             

                            org.jboss.shrinkwrap.api.exporter.ArchiveExportException: java.lang.NoSuchMethodError: org.jacoco.core.instr.Instrumenter.instrument(Ljava/io/InputStream;)[B

                                      at org.jboss.shrinkwrap.impl.base.exporter.FutureCompletionInputStream.awaitOnFutureOnDone(FutureCompletionInputStream.java:125)

                                      at org.jboss.shrinkwrap.impl.base.exporter.FutureCompletionInputStream.read(FutureCompletionInputStream.java:81)

                                      at java.io.PipedInputStream.read(PipedInputStream.java:378)

                                      at org.jboss.shrinkwrap.impl.base.exporter.FutureCompletionInputStream.read(FutureCompletionInputStream.java:92)

                                      at java.io.InputStream.read(InputStream.java:101)

                                      at org.jboss.shrinkwrap.impl.base.io.IOUtil.copy(IOUtil.java:138)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl.exportTo(AbstractStreamExporterImpl.java:120)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl.exportTo(AbstractStreamExporterImpl.java:148)

                                      at org.jboss.arquillian.container.impl.client.deployment.ArchiveDeploymentExporter.callback(ArchiveDeploymentExporter.java:82)

                                      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.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:155)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

                                      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.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

                                      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.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.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.proceed(EventContextImpl.java:88)

                                      at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

                                      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.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

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

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

                                      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

                                      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.client.ContainerEventController.execute(ContainerEventController.java:101)

                                      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.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.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

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

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

                                      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.lang.NoSuchMethodError: org.jacoco.core.instr.Instrumenter.instrument(Ljava/io/InputStream;)[B

                                      at org.jboss.arquillian.extension.jacoco.client.InstrumenterAsset.openStream(InstrumenterAsset.java:53)

                                      at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase.processNode(StreamExporterDelegateBase.java:227)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:105)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.processNode(AbstractExporterDelegate.java:109)

                                      at org.jboss.shrinkwrap.impl.base.exporter.AbstractExporterDelegate.doExport(AbstractExporterDelegate.java:95)

                                      at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase.access$001(StreamExporterDelegateBase.java:50)

                                      at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase$1.call(StreamExporterDelegateBase.java:121)

                                      at org.jboss.shrinkwrap.impl.base.exporter.StreamExporterDelegateBase$1.call(StreamExporterDelegateBase.java:116)

                                      at org.jboss.shrinkwrap.impl.base.exporter.zip.JdkZipExporterDelegate$1.call(JdkZipExporterDelegate.java:124)

                                      at org.jboss.shrinkwrap.impl.base.exporter.zip.JdkZipExporterDelegate$1.call(JdkZipExporterDelegate.java:118)

                                      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

                                      at java.util.concurrent.FutureTask.run(FutureTask.java:166)

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                      at java.lang.Thread.run(Thread.java:722)

                            • 11. Re: Aquillian jacoco extension can't test code overage of external ear/war
                              javag Newbie

                              Hi Andy,

                              I'm working with WebLogic remote container trying to run arquillian tests with ecl-emma/jacoco coverage. I'm getting into the same trouble of NoSuchMethodError you desribed in your posts. I've tried ALL the versions of jacoco.core and none of them gets working with arquillian-jacoco 1.0.0.Alpha5. On this forum I've found some people who sucseed to integrate jacoco.core 0.6.0.201210061924 and it still not clear for me what's the difference - my pom looks very similar to their but still got exceptions...

                              Have you finally managed to solve this?

                              • 12. Re: Aquillian jacoco extension can't test code overage of external ear/war
                                javag Newbie

                                Hi Aslak,

                                I'm working with WebLogic remote container trying to run arquillian tests with ecl-emma/jacoco coverage. I'm getting NoSuchMethodError exceptions desribed in this thread. I've tried ALL the versions of jacoco.core and none of them gets working with arquillian-jacoco 1.0.0.Alpha5, each time NoSuchMethodError exception is caught on different class/method. On this forum I've found some people who sucseed to integrate jacoco.core 0.6.0.201210061924 and it still not clear for me what's the difference - my pom looks very similar to their but still got exceptions...

                                May be you can help?

                                 

                                Thank you in advance.

                                 

                                =============================================================================================

                                 

                                java.lang.NoSuchMethodException: org.jacoco.agent.rt.internal_9dd1198.core.runtime.RuntimeData.getExecutionData([Ljava.lang.Object;)

                                          at java.lang.Class.getDeclaredMethod(Class.java:1954)

                                          at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.copyToAgentExecutionStore(CoverageDataReceiver.java:46)

                                          at org.jboss.arquillian.extension.jacoco.client.CoverageDataReceiver.storeCoverageData(CoverageDataReceiver.java:30)

                                          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.deployment.command.DeploymentCommandObserver.onException(DeploymentCommandObserver.java:51)

                                          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.container.test.impl.client.container.command.ContainerCommandObserver.onException(ContainerCommandObserver.java:43)

                                          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.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.RemoteTestExecuter$1.fired(RemoteTestExecuter.java:149)

                                          at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor$1.run(ServletMethodExecutor.java:105)

                                          at java.util.TimerThread.mainLoop(Timer.java:555)

                                          at java.util.TimerThread.run(Timer.java:505)

                                • 13. Re: Aquillian jacoco extension can't test code overage of external ear/war
                                  Andy Ma Newbie

                                  Hi Dmitry,

                                   

                                  Because currently arquillian-jacoco extension doesn't support for un-testable deployment, we finally give up of using it, so we didn't do more research on it now.

                                  • 14. Re: Aquillian jacoco extension can't test code overage of external ear/war
                                    Tommy Tynjä Newbie

                                    I've not been able to get Arquillian tests to even run on Tomcat 7 when using Jacoco 0.6.x against Arquillian-Jacoco-extension 1.0.0.Alpha5. Tests on Tomcat 7 seems to run only with Jacoco 0.5.x.