From 6d2f8fee5f63ae96833fb051299520e41d1a881c Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Tue, 8 Jan 2019 09:50:45 +0000 Subject: [PATCH] CORDA-2345: Removed TestCordapp.scanPackage to allow in future different ways of finding CorDapps other can package scanning (#4508) --- .../src/main/kotlin/net/corda/testing/node/TestCordapp.kt | 6 +++--- .../kotlin/net/corda/testing/node/internal/CustomCordapp.kt | 2 -- .../net/corda/testing/node/internal/TestCordappImpl.kt | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/TestCordapp.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/TestCordapp.kt index 7bfb67d338..92cc1f1a78 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/TestCordapp.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/TestCordapp.kt @@ -9,6 +9,9 @@ import net.corda.testing.node.internal.TestCordappImpl * Encapsulates a CorDapp that exists on the current classpath, which can be pulled in for testing. Use [TestCordapp.findCordapp] * to locate an existing CorDapp. * + * This is a replacement API to [DriverParameters.extraCordappPackagesToScan] and [MockNetwork.cordappPackages] as they create custom jars + * which do not preserve any CorDapp metadata. + * * @see DriverParameters.cordappsForAllNodes * @see NodeParameters.additionalCordapps * @see MockNetworkParameters.cordappsForAllNodes @@ -16,9 +19,6 @@ import net.corda.testing.node.internal.TestCordappImpl */ @DoNotImplement abstract class TestCordapp { - /** The package used to find the CorDapp. This may not be the root package of the CorDapp. */ - abstract val scanPackage: String - /** Returns the config for on this CorDapp, defaults to empty if not specified. */ abstract val config: Map diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/CustomCordapp.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/CustomCordapp.kt index 7b420a566c..00ecf42dd5 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/CustomCordapp.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/CustomCordapp.kt @@ -39,8 +39,6 @@ data class CustomCordapp( override val jarFile: Path get() = getJarFile(this) - override val scanPackage: String get() = throw UnsupportedOperationException() - override fun withConfig(config: Map): CustomCordapp = copy(config = config) override fun withOnlyJarContents(): CustomCordapp = CustomCordapp(packages = packages, classes = classes) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappImpl.kt index bc8f199fa4..8098afd101 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappImpl.kt @@ -18,7 +18,7 @@ import kotlin.streams.toList * the [scanPackage] may reference a gradle CorDapp project on the local system. In this scenerio the project's "jar" task is executed to * build the CorDapp jar. This allows us to inherit the CorDapp's MANIFEST information without having to do any extra processing. */ -data class TestCordappImpl(override val scanPackage: String, override val config: Map) : TestCordappInternal() { +data class TestCordappImpl(val scanPackage: String, override val config: Map) : TestCordappInternal() { override fun withConfig(config: Map): TestCordappImpl = copy(config = config) override fun withOnlyJarContents(): TestCordappImpl = copy(config = emptyMap())