I would like to see the test coverage for IT tests run with Arquillian. I ran into this extension: https://github.com/arquillian/arquillian-extension-jacoco
What I dont understand is why CoverageBean class tested by JacocoInegrationTestCase is not visible in the reports. Thats what I would expect.
Can somebody provide the example project, with 1 integration test running on Arquillian and tested class for which the test coverage report is generated, please?
Thanks
@RunWith(Arquillian.class)
public class JacocoInegrationTestCase
{
@Deployment
public static JavaArchive createDeployment() throws Exception
{
return ShrinkWrap.create(JavaArchive.class, "test.jar")
.addClasses(CoverageBean.class, JacocoInegrationTestCase.class);
}
@EJB
private CoverageBean bean;
@Test
public void shouldBeAbleToGenerateSomeTestCoverage() throws Exception
{
Assert.assertNotNull(bean);
bean.test(true);
} }
@Stateless
public class CoverageBean
{
public void test(Boolean value)
{
String test = "test";
if(value)
{
if(test.length() == 4)
{
long start = System.currentTimeMillis();
test = String.valueOf(start);
}
}
else
{
long start = System.currentTimeMillis();
test = String.valueOf(start);
}
} }
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>integration-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<environmentVariables>
<JBOSS_HOME>${jbossHome}</JBOSS_HOME>
</environmentVariables>
<skip>false</skip>
<includes>
<include>org/jboss/arquillian/extension/jacoco/test/unit/ * </include>
<include>org/jboss/arquillian/extension/jacoco/test/integration/ * </include>
</includes>
</configuration>
</execution>
EDIT: I have also try this project (https://github.com/CSchulz/arquillian-jacoco-showcase), looks very promissing but it runs against the distribution verison of Wildfly.. But in my project we are running Arquillian tests agains the installed instance of JBOSS EAP 6, with database connection and other security configuration. Is anybody able to change it in order to use the installed (deployed) version of JBOSS? Thanks