build: setup integrationTest, enable gRPC
@@ -12,7 +12,19 @@ repositories {
mavenCentral()
}
+configurations {
+ integrationTestImplementation.extendsFrom testImplementation
+ integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
+}
+
dependencies {
+ implementation "javax.annotation:javax.annotation-api:1.3.2"
+
+ // Converts between Java 8 CompletableFuture and Guava ListenableFuture
+ // https://guava.dev/releases/25.0-jre/api/docs/com/google/common/util/concurrent/FluentFuture.html
+ // https://github.com/lukas-krecan/future-converter#java8-guava
+ implementation "net.javacrumbs.future-converter:future-converter-java8-guava:1.2.0"
+
// NOTE: BouncyCastle is frozen at v1.60 for compatibility with Corda <https://www.corda.net/>
// <https://github.com/corda/corda/blob/2c10b6c3b9dace7831b5da73a065c3269a703d85/constants.properties#L23>
implementation "org.bouncycastle:bcprov-jdk15on:1.60"
@@ -27,12 +39,19 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.1"
testImplementation "org.assertj:assertj-core:3.15.0"
+
+ integrationTestRuntimeOnly "io.grpc:grpc-netty-shaded:1.28.1"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.11.4"
}
+ plugins {
+ grpc {
+ artifact = "io.grpc:protoc-gen-grpc-java:1.28.1"
+ }
+ }
generateProtoTasks {
all().each { task ->
task.builtins {
@@ -40,6 +59,12 @@ protobuf {
option "lite"
}
}
+
+ task.plugins {
+ grpc {
+ option "lite"
+ }
+ }
}
}
}
@@ -48,6 +73,27 @@ tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
+sourceSets {
+ integrationTest {
+ java.srcDir "$projectDir/src/integrationTest/java"
+
+ compileClasspath += sourceSets.main.output
+ runtimeClasspath += sourceSets.main.output
+ }
+}
+
+idea {
+ module {
+ sourceDirs -= file('src/integrationTest/java')
+ testSourceDirs += file('src/integrationTest/java')
+ }
+}
+
+task integrationTest(type: Test) {
+ testClassesDirs = sourceSets.integrationTest.output.classesDirs
+ classpath = sourceSets.integrationTest.runtimeClasspath
+}
+
tasks.withType(Test) {
useJUnitPlatform()
@@ -62,6 +108,6 @@ tasks.withType(Test) {
// emit logs per passed or failed test
testLogging {
- events "passed", "skipped", "failed"
+ events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
