From 5081fcc9a8a92ee3d59c8f52d1f5817f673c6880 Mon Sep 17 00:00:00 2001 From: Stefano Franz Date: Thu, 3 Jan 2019 15:58:16 +0000 Subject: [PATCH] break out the FungibleAsset testing schemas into module to prevent having to publish a test-jar. --- build.gradle | 1 + finance/contracts/build.gradle | 9 +---- finance/test-contracts/build.gradle | 34 +++++++++++++++++++ .../schemas/test/SampleCashSchemaV1.kt | 0 .../schemas/test/SampleCashSchemaV2.kt | 0 .../schemas/test/SampleCashSchemaV3.kt | 0 .../test/SampleCommercialPaperSchemaV1.kt | 0 .../test/SampleCommercialPaperSchemaV2.kt | 0 node/build.gradle | 1 + .../asset/test/DummyFungibleContract.kt | 0 settings.gradle | 1 + 11 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 finance/test-contracts/build.gradle rename finance/{contracts/src/test => test-contracts/src/main}/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt (100%) rename finance/{contracts/src/test => test-contracts/src/main}/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt (100%) rename finance/{contracts/src/test => test-contracts/src/main}/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt (100%) rename finance/{contracts/src/test => test-contracts/src/main}/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt (100%) rename finance/{contracts/src/test => test-contracts/src/main}/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt (100%) rename {finance/contracts => node}/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt (100%) diff --git a/build.gradle b/build.gradle index 3a20bd5e99..9fabeb5162 100644 --- a/build.gradle +++ b/build.gradle @@ -366,6 +366,7 @@ bintrayConfig { 'corda-finance', // maintained for backwards compatibility only 'corda-finance-workflows', 'corda-finance-contracts', + 'corda-finance-test-contracts', 'corda-node', 'corda-node-api', 'corda-test-common', diff --git a/finance/contracts/build.gradle b/finance/contracts/build.gradle index 77207e090a..22b43cca69 100644 --- a/finance/contracts/build.gradle +++ b/finance/contracts/build.gradle @@ -15,6 +15,7 @@ dependencies { // cordapp project(':finance:workflows') // cordapp project(':finance:contracts') cordaCompile project(':core') + cordaCompile project(':core') compile project(':confidential-identities') // For JSON @@ -32,11 +33,6 @@ configurations { testArtifacts.extendsFrom testRuntime } -task testJar(type: Jar) { - classifier "tests" - from sourceSets.test.output -} - jar { baseName 'corda-finance-contracts' manifest { @@ -45,9 +41,6 @@ jar { } } -artifacts { - testArtifacts testJar -} cordapp { signing { enabled false diff --git a/finance/test-contracts/build.gradle b/finance/test-contracts/build.gradle new file mode 100644 index 0000000000..763a546c34 --- /dev/null +++ b/finance/test-contracts/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'kotlin' +// Java Persistence API support: create no-arg constructor +// see: http://stackoverflow.com/questions/32038177/kotlin-with-jpa-default-constructor-hell +apply plugin: 'kotlin-jpa' +apply plugin: CanonicalizerPlugin + +description 'Corda finance module - testing contracts' + +dependencies { + compile project(':core') + compile project(':confidential-identities') + + // For JSON + compile "com.fasterxml.jackson.core:jackson-databind:${jackson_version}" + + compile project(':test-utils') + compile project(path: ':core', configuration: 'testArtifacts') + compile "junit:junit:$junit_version" + + // AssertJ: for fluent assertions for testing + compile "org.assertj:assertj-core:$assertj_version" +} + +jar { + baseName 'corda-finance-test-contracts' + manifest { + attributes('Corda-Revision': 'n/a') + attributes('Corda-Vendor': 'Corda Open Source') + } +} + +publish { + name jar.baseName +} \ No newline at end of file diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt b/finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt rename to finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV1.kt diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt b/finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt rename to finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV2.kt diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt b/finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt rename to finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCashSchemaV3.kt diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt b/finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt rename to finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV1.kt diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt b/finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt rename to finance/test-contracts/src/main/kotlin/net/corda/finance/schemas/test/SampleCommercialPaperSchemaV2.kt diff --git a/node/build.gradle b/node/build.gradle index fc3e12c65b..292bf38313 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -185,6 +185,7 @@ dependencies { compile "com.palominolabs.metrics:metrics-new-relic:${metrics_new_relic_version}" testCompile(project(':test-cli')) + testCompile(project(':finance:test-contracts')) } tasks.withType(JavaCompile) { diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt b/node/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt similarity index 100% rename from finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt rename to node/src/test/kotlin/net/corda/finance/contracts/asset/test/DummyFungibleContract.kt diff --git a/settings.gradle b/settings.gradle index 34aa7dbc4e..0462feb7af 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,6 +5,7 @@ include 'confidential-identities' include 'finance' // maintained for backwards compatibility only include 'finance:contracts' include 'finance:workflows' +include 'finance:test-contracts' include 'isolated' include 'core' include 'docs'