diff --git a/omnij-rpc/build.gradle b/omnij-rpc/build.gradle index 77ad77c0..9e720de4 100644 --- a/omnij-rpc/build.gradle +++ b/omnij-rpc/build.gradle @@ -53,38 +53,37 @@ sourceSets { } } -/** Base class for integration tests - */ -class IntegrationTest extends Test { - public IntegrationTest() { - testClassesDirs = project.sourceSets.integrationTest.output.classesDirs - classpath = project.sourceSets.integrationTest.runtimeClasspath - outputs.upToDateWhen { false } - testLogging { - exceptionFormat = 'full' - displayGranularity = -1 - } - beforeSuite { descriptor -> - if (descriptor.className != null) { - logger.lifecycle("\033[1m$descriptor.name\033[0m") // bold - } - } - beforeTest { descriptor -> - logger.lifecycle(" $descriptor.name") +/** Base class for integration tests */ +abstract class IntegrationTest extends Test {} + +tasks.withType(IntegrationTest).configureEach { + testClassesDirs = project.sourceSets.integrationTest.output.classesDirs + classpath = project.sourceSets.integrationTest.runtimeClasspath + outputs.upToDateWhen { false } + testLogging { + exceptionFormat = 'full' + displayGranularity = -1 + } + beforeSuite { descriptor -> + if (descriptor.className != null) { + logger.lifecycle("\033[1m$descriptor.name\033[0m") // bold } } + beforeTest { descriptor -> + logger.lifecycle(" $descriptor.name") + } } -/** Base class for integration tests in regtest mode - */ -class RegTest extends IntegrationTest { - public RegTest() { - systemProperty 'regtest', true - systemProperty 'java.util.logging.config.file', "${project.projectDir}/src/integ/logging.properties" - systemProperties ([ 'omni.test.rpcTestUser': project.rpcTestUser, - 'omni.test.rpcTestPassword': project.rpcTestPassword, - ]) - } + +/** Base class for integration tests in regtest mode */ +abstract class RegTest extends IntegrationTest {} + +tasks.withType(RegTest).configureEach { + systemProperty 'regtest', true + systemProperty 'java.util.logging.config.file', "${project.projectDir}/src/integ/logging.properties" + systemProperties ([ 'omni.test.rpcTestUser': project.rpcTestUser, + 'omni.test.rpcTestPassword': project.rpcTestPassword, + ]) } tasks.register('integrationTest', IntegrationTest) {