0

I am using the last version of jacoco-maven-plugin (0.7.8) and last version of arquillian-jacoco (1.0.0.Alpha9) but when executing IT test i have a stackOverFlowError in BeforeClass Arquillian (I am using maven, testNG, wildfly, jacoco,arquillian all in latest libraries):

Tests run: 12, Failures: 1, Errors: 0, Skipped: 11, Time elapsed: 54.616 sec     <<< FAILURE! - in com.real.hr.services.impl.test.PayEseConnectorServiceImplIT
arquillianBeforeClass(com.real.hr.services.impl.test.PayEseConnectorServiceImplIT)  Time elapsed: 54.263 sec  <<< FAILURE!
org.jboss.arquillian.container.spi.client.container.DeploymentException: Cannot deploy: arquillian-RflowHR.war
Caused by: java.lang.Exception: 

"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"arquillian-RflowHR.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"arquillian-RflowHR.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"arquillian-RflowHR.war\"
Caused by: java.lang.StackOverflowError"

Failed tests: PayEseConnectorServiceImplIT>Arquillian.arquillianBeforeClass:109 » Deployment

When i comment :

<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-jacoco</artifactId>
    <version>1.0.0.Alpha9</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.jacoco</groupId>
    <artifactId>org.jacoco.core</artifactId>
    <version>0.7.8</version>
    <scope>test</scope>
</dependency> 

It's working fine but not Integration test are covered below my configuration:

<!-- jacoco -->
<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-jacoco</artifactId>
    <version>1.0.0.Alpha9</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.jacoco</groupId>
    <artifactId>org.jacoco.core</artifactId>
    <version>0.7.8</version>
    <scope>test</scope>
</dependency>
</dependencies>
<profiles>
 <profile>
        <id>test-coverage</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.8</version>
                    <executions>
                         <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>            
                    </executions>
                </plugin>

            </plugins>
        </build>
    </profile>
    <profile>
        <id>integration-tests-wildfly</id>
        <build>
            <plugins>
             <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <systemPropertyVariables>
                            <jboss.server.log.dir>${jboss.home.dir}/standalone/log</jboss.server.log.dir>
                            <arquillian.launch>jbossas-managed</arquillian.launch>
                            <jbossas.startup.timeout>240</jbossas.startup.timeout>
                        </systemPropertyVariables>
                        <includes>
                            <include>**/*IT.java</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
                <groupId>org.wildfly.arquillian</groupId>
                <artifactId>wildfly-arquillian-container-managed</artifactId>
                <version>2.0.2.Final</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

Any Help?

cyril
  • 872
  • 6
  • 29
  • maybe a clue i have in my ArquillianDeploymentHelper those lines: File[] libs = pom.importDependencies(scopes).resolve().using(TransitiveStrategy.INSTANCE).asFile(); WebArchive archive = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME) .addAsLibraries(libs), i think jacoco try to instrument all libraries class wich cause stackoverflowError in server i don't know how to configure to not execute on runtime because on jacoco report there is not all libraries, only my test classes – cyril Jan 20 '17 at 10:46

1 Answers1

0

adding the following code in arquillian.xml works for me:

 <extension qualifier="jacoco">
    <property name="includes">com.your.top.package.*</property>
</extension>

indeed only your classes will be used in instrumentation

cyril
  • 872
  • 6
  • 29