Hello,
I’m trying to migrate some integration test from maven to gradle, and I’ve a few questions.
After reading the gradle documentation, I transformed this
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<forkMode>always</forkMode>
<argLine>-Xmx1024m -XX:MaxPermSize=512m -XX:-UseSplitVerifier</argLine>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
<excludes>
<exclude>com/.../test/*IntegrationTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.5.2.v20111006</version>
<configuration>
<webAppConfig>
<contextPath>/xsa-pom</contextPath>
</webAppConfig>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<systemProperties>
<systemProperty>
<name>jetty.port</name>
<value>9099</value>
</systemProperty>
</systemProperties>
<stopPort>9090</stopPort>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>ch.finnova</groupId>
<artifactId>edbs6</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cronto</groupId>
<artifactId>crontoengine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
to this (inside subproject{})
test {
useJUnit()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// explicitly include or exclude tests
include '**/*IntegrationTest.java'
exclude 'com/.../test/*IntegrationTest.java'
// set heap size for the test JVM(s)
minHeapSize = "Xms256m"
maxHeapSize = "Xmx768m"
// set JVM arguments for the test JVM(s)
jvmArgs '-Xmx1024m', '-XX:MaxPermSize=512m', '-XX:-UseSplitVerifier'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}
Is it correct?
I receive compilation errors like
required: Class<? extends Runner> found: Class<SpringJUnit4ClassRunner>
But I don’t understand if it is related to some error in the gradle script or not. I think yes because with maven the tests run fine
Thank you very much