diff --git a/core/src/test/kotlin/net/corda/core/crypto/PartialMerkleTreeTest.kt b/core/src/test/kotlin/net/corda/core/crypto/PartialMerkleTreeTest.kt index 044dc32aa2..cb3fbb54f4 100644 --- a/core/src/test/kotlin/net/corda/core/crypto/PartialMerkleTreeTest.kt +++ b/core/src/test/kotlin/net/corda/core/crypto/PartialMerkleTreeTest.kt @@ -21,7 +21,7 @@ import kotlin.test.* class PartialMerkleTreeTest { @Rule @JvmField - private val testSerialization = SerializationEnvironmentRule() + val testSerialization = SerializationEnvironmentRule() private val nodes = "abcdef" private val hashed = nodes.map { node -> withTestSerialization { diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/Schema.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/Schema.kt index b336aa41f8..bb38933ed0 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/Schema.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/Schema.kt @@ -17,16 +17,6 @@ import java.util.* import net.corda.nodeapi.internal.serialization.carpenter.Field as CarpenterField import net.corda.nodeapi.internal.serialization.carpenter.Schema as CarpenterSchema -/** - * R3 AMQP assigned enterprise number - * - * see [here](https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers) - * - * Repeated here for brevity: - * 50530 - R3 - Mike Hearn - mike&r3.com - */ -const val DESCRIPTOR_TOP_32BITS: Long = 0xc5620000 - const val DESCRIPTOR_DOMAIN: String = "net.corda" // "corda" + majorVersionByte + minorVersionMSB + minorVersionLSB diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/amqp/EvolvabilityTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/amqp/EvolvabilityTests.kt index 9476a97131..69a5316a5e 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/amqp/EvolvabilityTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/amqp/EvolvabilityTests.kt @@ -79,7 +79,6 @@ class EvolvabilityTests { // Original version of the class as it was serialised // data class C(val a: Int) // File(URI("$localPath/$resource")).writeBytes( SerializationOutput(sf).serialize(C(A)) - .bytes) data class C(val a: Int, val b: Int?) diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index f0da5de35e..a9af07e7ad 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -566,7 +566,7 @@ abstract class AbstractNode(config: NodeConfiguration, protected abstract fun myAddresses(): List open protected fun checkNetworkMapIsInitialized() { - if (!services.networkMapCache.loadDBSuccess || configuration.noNetworkMapServiceMode) { + if (!services.networkMapCache.loadDBSuccess ) { // TODO: There should be a consistent approach to configuration error exceptions. throw NetworkMapCacheEmptyException() } diff --git a/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt b/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt index 8b28ed9667..00f376726e 100644 --- a/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt @@ -5,21 +5,21 @@ import com.jcraft.jsch.JSchException import net.corda.core.internal.Emoji import net.corda.core.utilities.loggerFor import net.corda.node.VersionInfo -import net.corda.node.services.config.FullNodeConfiguration +import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.config.RelayConfiguration import net.corda.nodeapi.internal.ServiceInfo import org.fusesource.jansi.Ansi import org.fusesource.jansi.AnsiConsole import java.io.IOException -class EnterpriseNode(configuration: FullNodeConfiguration, +class EnterpriseNode(configuration: NodeConfiguration, versionInfo: VersionInfo) : Node(configuration, versionInfo) { companion object { private val logger by lazy { loggerFor() } } class Startup(args: Array) : NodeStartup(args) { - override fun preNetworkRegistration(conf: FullNodeConfiguration) { + override fun preNetworkRegistration(conf: NodeConfiguration) { super.preNetworkRegistration(conf) conf.relay?.let { connectToRelay(it, conf.p2pAddress.port) } } @@ -66,7 +66,7 @@ D""".trimStart() return tips[(Math.random() * tips.size).toInt()] } - override fun createNode(conf: FullNodeConfiguration, versionInfo: VersionInfo) = EnterpriseNode(conf, versionInfo) + override fun createNode(conf: NodeConfiguration, versionInfo: VersionInfo) = EnterpriseNode(conf, versionInfo) private fun connectToRelay(config: RelayConfiguration, localBrokerPort: Int) { with(config) { diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index 95ca06a443..c75ac90ce0 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -174,7 +174,7 @@ open class Node(override val configuration: NodeConfiguration, private fun getAdvertisedAddress(): NetworkHostAndPort { return with(configuration) { if (relay != null) { - NetworkHostAndPort(relay.relayHost, relay.remoteInboundPort) + NetworkHostAndPort(relay!!.relayHost, relay!!.remoteInboundPort) } else { val useHost = if (detectPublicIp) { tryDetectIfNotPublicHost(p2pAddress.host) ?: p2pAddress.host diff --git a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt index 7bfa127fe3..bfc0947bd2 100644 --- a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt +++ b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt @@ -40,6 +40,7 @@ interface NodeConfiguration : NodeSSLConfiguration { // TODO Move into DevModeOptions val useTestClock: Boolean get() = false val detectPublicIp: Boolean get() = true + val relay: RelayConfiguration? } data class NotaryConfig(val validating: Boolean, @@ -94,7 +95,7 @@ data class NodeConfigurationImpl( override val useHTTPS: Boolean, override val p2pAddress: NetworkHostAndPort, override val rpcAddress: NetworkHostAndPort?, - val relay: RelayConfiguration?, + override val relay: RelayConfiguration?, // TODO This field is slightly redundant as p2pAddress is sufficient to hold the address of the node's MQ broker. // Instead this should be a Boolean indicating whether that broker is an internal one started by the node or an external one override val messagingServerAddress: NetworkHostAndPort?, diff --git a/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt b/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt index 57e29a88a5..c948f27732 100644 --- a/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt +++ b/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt @@ -13,7 +13,6 @@ import net.corda.core.utilities.debug import net.corda.core.utilities.loggerFor import net.corda.core.utilities.MAX_HASH_HEX_SIZE import net.corda.node.utilities.AppendOnlyPersistentMap -import net.corda.node.utilities.MAX_HASH_HEX_SIZE import net.corda.node.utilities.NODE_DATABASE_PREFIX import org.bouncycastle.cert.X509CertificateHolder import java.io.ByteArrayInputStream diff --git a/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt b/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt index b1dcd7f342..135d320266 100644 --- a/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt +++ b/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt @@ -7,7 +7,6 @@ import net.corda.core.node.services.KeyManagementService import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.utilities.MAX_HASH_HEX_SIZE import net.corda.node.utilities.AppendOnlyPersistentMap -import net.corda.node.utilities.MAX_HASH_HEX_SIZE import net.corda.node.utilities.NODE_DATABASE_PREFIX import org.bouncycastle.operator.ContentSigner import java.security.KeyPair diff --git a/node/src/main/kotlin/net/corda/node/utilities/CordaPersistence.kt b/node/src/main/kotlin/net/corda/node/utilities/CordaPersistence.kt index a8c85d105d..77055c6073 100644 --- a/node/src/main/kotlin/net/corda/node/utilities/CordaPersistence.kt +++ b/node/src/main/kotlin/net/corda/node/utilities/CordaPersistence.kt @@ -20,14 +20,6 @@ import java.util.concurrent.CopyOnWriteArrayList */ const val NODE_DATABASE_PREFIX = "node_" -/** - * The maximum supported field-size for hash HEX-encoded outputs (e.g. database fields). - * This value is enough to support hash functions with outputs up to 512 bits (e.g. SHA3-512), in which - * case 128 HEX characters are required. - * 130 was selected instead of 128, to allow for 2 extra characters that will be used as hash-scheme identifiers. - */ -internal const val MAX_HASH_HEX_SIZE = 130 - //HikariDataSource implements Closeable which allows CordaPersistence to be Closeable class CordaPersistence(var dataSource: HikariDataSource, private val schemaService: SchemaService, private val createIdentityService: () -> IdentityService, databaseProperties: Properties) : Closeable { diff --git a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt index 292c87ac8b..0976f53bad 100644 --- a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt @@ -51,5 +51,6 @@ class NodeConfigurationImplTest { notary = null, certificateChainCheckPolicies = emptyList(), devMode = true, - activeMQServer = ActiveMqServerConfiguration(BridgeConfiguration(0, 0, 0.0))) + activeMQServer = ActiveMqServerConfiguration(BridgeConfiguration(0, 0, 0.0)), + relay = null) } diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/CommercialPaperTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/CommercialPaperTests.kt index dade7aa141..ae341985d2 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/CommercialPaperTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/CommercialPaperTests.kt @@ -216,8 +216,7 @@ class CommercialPaperTestsGeneric { // @Test @Ignore - fun `issue move and then redeem`() { - initialiseTestSerialization() + fun `issue move and then redeem`() = withTestSerialization{ val aliceDatabaseAndServices = MockServices.makeTestDatabaseAndMockServices(keys = listOf(ALICE_KEY)) val databaseAlice = aliceDatabaseAndServices.first aliceServices = aliceDatabaseAndServices.second @@ -297,6 +296,5 @@ class CommercialPaperTestsGeneric { validRedemption.toLedgerTransaction(aliceServices).verify() // soft lock not released after success either!!! (as transaction not recorded) } - resetTestSerialization() } } diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashTests.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashTests.kt index 8a67039948..9d27df3756 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashTests.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/contracts/asset/CashTests.kt @@ -80,7 +80,7 @@ fun ServiceHub.fillWithSomeTestCash(howMuch: Amount, } -class CashTests : TestDependencyInjectionBase() { +class CashTests { private val defaultRef = OpaqueBytes(ByteArray(1, { 1 })) private val defaultIssuer = MEGA_CORP.ref(defaultRef) private val inState = Cash.State( @@ -102,7 +102,7 @@ class CashTests : TestDependencyInjectionBase() { private lateinit var vaultStatesUnconsumed: List> @Before - fun setUp() { + fun setUp() = withTestSerialization { LogHelper.setLevel(NodeVaultService::class) megaCorpServices = MockServices(listOf("com.r3.corda.enterprise.perftestcordapp.contracts.asset"), MEGA_CORP_KEY) val databaseAndServices = makeTestDatabaseAndMockServices(cordappPackages = listOf("com.r3.corda.enterprise.perftestcordapp.contracts.asset"), keys = listOf(MINI_CORP_KEY, MEGA_CORP_KEY, OUR_KEY)) @@ -123,7 +123,6 @@ class CashTests : TestDependencyInjectionBase() { database.transaction { vaultStatesUnconsumed = miniCorpServices.vaultService.queryBy().states } - resetTestSerialization() } @After @@ -205,8 +204,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateIssueRaw() { - initialiseTestSerialization() + fun generateIssueRaw() = withTestSerialization { // Test generation works. val tx: WireTransaction = TransactionBuilder(notary = null).apply { Cash().generateIssue(this, 100.DOLLARS `issued by` MINI_CORP.ref(12, 34), owner = AnonymousParty(ALICE_PUBKEY), notary = DUMMY_NOTARY) @@ -221,8 +219,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateIssueFromAmount() { - initialiseTestSerialization() + fun generateIssueFromAmount() = withTestSerialization { // Test issuance from an issued amount val amount = 100.DOLLARS `issued by` MINI_CORP.ref(12, 34) val tx: WireTransaction = TransactionBuilder(notary = null).apply { @@ -290,8 +287,7 @@ class CashTests : TestDependencyInjectionBase() { * cash inputs. */ @Test(expected = IllegalStateException::class) - fun `reject issuance with inputs`() { - initialiseTestSerialization() + fun `reject issuance with inputs`() = withTestSerialization { // Issue some cash var ptx = TransactionBuilder(DUMMY_NOTARY) @@ -302,6 +298,7 @@ class CashTests : TestDependencyInjectionBase() { ptx = TransactionBuilder(DUMMY_NOTARY) ptx.addInputState(tx.tx.outRef(0)) Cash().generateIssue(ptx, 100.DOLLARS `issued by` MINI_CORP.ref(12, 34), owner = MINI_CORP, notary = DUMMY_NOTARY) + Unit } @Test @@ -566,8 +563,7 @@ class CashTests : TestDependencyInjectionBase() { * Try exiting an amount which matches a single state. */ @Test - fun generateSimpleExit() { - initialiseTestSerialization() + fun generateSimpleExit() = withTestSerialization { val wtx = makeExit(miniCorpServices, 100.DOLLARS, MEGA_CORP, 1) assertEquals(WALLET[0].ref, wtx.inputs[0]) assertEquals(0, wtx.outputs.size) @@ -582,8 +578,7 @@ class CashTests : TestDependencyInjectionBase() { * Try exiting an amount smaller than the smallest available input state, and confirm change is generated correctly. */ @Test - fun generatePartialExit() { - initialiseTestSerialization() + fun generatePartialExit() = withTestSerialization { val wtx = makeExit(miniCorpServices, 50.DOLLARS, MEGA_CORP, 1) val actualInput = wtx.inputs.single() // Filter the available inputs and confirm exactly one has been used @@ -600,53 +595,52 @@ class CashTests : TestDependencyInjectionBase() { * Try exiting a currency we don't have. */ @Test - fun generateAbsentExit() { - initialiseTestSerialization() + fun generateAbsentExit() = withTestSerialization { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, MEGA_CORP, 1) } + Unit } /** * Try exiting with a reference mis-match. */ @Test - fun generateInvalidReferenceExit() { - initialiseTestSerialization() + fun generateInvalidReferenceExit() = withTestSerialization { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, MEGA_CORP, 2) } + Unit } /** * Try exiting an amount greater than the maximum available. */ @Test - fun generateInsufficientExit() { - initialiseTestSerialization() + fun generateInsufficientExit() = withTestSerialization { assertFailsWith { makeExit(miniCorpServices, 1000.DOLLARS, MEGA_CORP, 1) } + Unit } /** * Try exiting for an owner with no states */ @Test - fun generateOwnerWithNoStatesExit() { - initialiseTestSerialization() + fun generateOwnerWithNoStatesExit() = withTestSerialization { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, CHARLIE, 1) } + Unit } /** * Try exiting when vault is empty */ @Test - fun generateExitWithEmptyVault() { - initialiseTestSerialization() + fun generateExitWithEmptyVault() = withTestSerialization { assertFailsWith { val tx = TransactionBuilder(DUMMY_NOTARY) Cash().generateExit(tx, Amount(100, Issued(CHARLIE.ref(1), GBP)), emptyList(), OUR_IDENTITY_1) } + Unit } @Test - fun generateSimpleDirectSpend() { - initialiseTestSerialization() + fun generateSimpleDirectSpend() = withTestSerialization { val wtx = database.transaction { makeSpend(100.DOLLARS, THEIR_IDENTITY_1) @@ -660,8 +654,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateSimpleSpendWithParties() { - initialiseTestSerialization() + fun generateSimpleSpendWithParties() = withTestSerialization { database.transaction { val tx = TransactionBuilder(DUMMY_NOTARY) @@ -672,8 +665,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateSimpleSpendWithChange() { - initialiseTestSerialization() + fun generateSimpleSpendWithChange() = withTestSerialization { val wtx = database.transaction { makeSpend(10.DOLLARS, THEIR_IDENTITY_1) @@ -698,8 +690,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateSpendWithTwoInputs() { - initialiseTestSerialization() + fun generateSpendWithTwoInputs() = withTestSerialization { val wtx = database.transaction { makeSpend(500.DOLLARS, THEIR_IDENTITY_1) @@ -715,8 +706,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateSpendMixedDeposits() { - initialiseTestSerialization() + fun generateSpendMixedDeposits() = withTestSerialization { val wtx = database.transaction { val wtx = makeSpend(580.DOLLARS, THEIR_IDENTITY_1) @@ -737,8 +727,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun generateSpendInsufficientBalance() { - initialiseTestSerialization() + fun generateSpendInsufficientBalance() = withTestSerialization { database.transaction { val e: InsufficientBalanceException = assertFailsWith("balance") { @@ -750,6 +739,7 @@ class CashTests : TestDependencyInjectionBase() { makeSpend(81.SWISS_FRANCS, THEIR_IDENTITY_1) } } + Unit } /** @@ -876,8 +866,7 @@ class CashTests : TestDependencyInjectionBase() { } @Test - fun multiSpend() { - initialiseTestSerialization() + fun multiSpend() = withTestSerialization { val tx = TransactionBuilder(DUMMY_NOTARY) database.transaction { val payments = listOf( diff --git a/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt b/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt index df5b25f480..871cc82954 100644 --- a/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt +++ b/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt @@ -37,7 +37,7 @@ fun springDriver( driverDirectory: Path = defaultParameters.driverDirectory, portAllocation: PortAllocation = defaultParameters.portAllocation, debugPortAllocation: PortAllocation = defaultParameters.debugPortAllocation, - systemProperties: Map = defaultParameters.systemProperties, + systemProperties: Map = defaultParameters.extraSystemProperties, useTestClock: Boolean = defaultParameters.useTestClock, initialiseSerialization: Boolean = defaultParameters.initialiseSerialization, startNodesInProcess: Boolean = defaultParameters.startNodesInProcess, diff --git a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/Simulation.kt b/samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/Simulation.kt index 80869330de..84be5a59ff 100644 --- a/samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/Simulation.kt +++ b/samples/network-visualiser/src/main/kotlin/net/corda/netmap/simulation/Simulation.kt @@ -12,6 +12,7 @@ import net.corda.node.services.statemachine.StateMachineManager import net.corda.testing.DUMMY_NOTARY import net.corda.testing.DUMMY_REGULATOR import net.corda.testing.node.* +import net.corda.testing.node.MockNetwork.MockNode import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import rx.Observable import rx.subjects.PublishSubject @@ -24,7 +25,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.CompletableFuture.allOf import java.util.concurrent.Future -internal val MockNode.place get() = configuration.myLegalName.locality.let { CityDatabase[it] }!! +internal val MockNetwork.MockNode.place get() = configuration.myLegalName.locality.let { CityDatabase[it] }!! /** * Base class for network simulations that are based on the unit test / mock environment. @@ -49,11 +50,11 @@ abstract class Simulation(val networkSendManuallyPumped: Boolean, val bankLocations = listOf(Pair("London", "GB"), Pair("Frankfurt", "DE"), Pair("Rome", "IT")) - object RatesOracleFactory : MockNetwork.Factory { + object RatesOracleFactory : MockNetwork.Factory { // TODO: Make a more realistic legal name val RATES_SERVICE_NAME = CordaX500Name(organisation = "Rates Service Provider", locality = "Madrid", country = "ES") - override fun create(args: MockNodeArgs): MockNode { + override fun create(args: MockNodeArgs): MockNetwork.MockNode { return object : MockNode(args) { override fun start() = super.start().apply { registerInitiatedFlow(NodeInterestRates.FixQueryHandler::class.java) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/RPCDriver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/RPCDriver.kt index f5375bd355..aeddb369df 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/RPCDriver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/RPCDriver.kt @@ -225,7 +225,7 @@ fun rpcDriver( driverDirectory: Path = Paths.get("build", getTimestampAsDirectoryName()), portAllocation: PortAllocation = globalPortAllocation, debugPortAllocation: PortAllocation = globalDebugPortAllocation, - extraSystemProperties: Map = emptyMap(), + systemProperties: Map = emptyMap(), useTestClock: Boolean = false, initialiseSerialization: Boolean = true, startNodesInProcess: Boolean = false, @@ -236,7 +236,7 @@ fun rpcDriver( DriverDSL( portAllocation = portAllocation, debugPortAllocation = debugPortAllocation, - extraSystemProperties = extraSystemProperties, + extraSystemProperties = systemProperties, driverDirectory = driverDirectory.toAbsolutePath(), useTestClock = useTestClock, isDebug = isDebug, diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt index aaf2048df3..7e68cfa998 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt @@ -315,7 +315,7 @@ data class NodeParameters( * and may be specified in [DriverDSL.startNode]. * @param portAllocation The port allocation strategy to use for the messaging and the web server addresses. Defaults to incremental. * @param debugPortAllocation The port allocation strategy to use for jvm debugging. Defaults to incremental. - * @param extraSystemProperties A Map of extra system properties which will be given to each new node. Defaults to empty. + * @param systemProperties A Map of extra system properties which will be given to each new node. Defaults to empty. * @param useTestClock If true the test clock will be used in Node. * @param startNodesInProcess Provides the default behaviour of whether new nodes should start inside this process or * not. Note that this may be overridden in [DriverDSLExposedInterface.startNode]. @@ -434,7 +434,7 @@ fun genericD driverDirectory: Path = defaultParameters.driverDirectory, portAllocation: PortAllocation = defaultParameters.portAllocation, debugPortAllocation: PortAllocation = defaultParameters.debugPortAllocation, - systemProperties: Map = defaultParameters.systemProperties, + systemProperties: Map = defaultParameters.extraSystemProperties, useTestClock: Boolean = defaultParameters.useTestClock, initialiseSerialization: Boolean = defaultParameters.initialiseSerialization, startNodesInProcess: Boolean = defaultParameters.startNodesInProcess, @@ -448,7 +448,7 @@ fun genericD DriverDSL( portAllocation = portAllocation, debugPortAllocation = debugPortAllocation, - systemProperties = systemProperties, + extraSystemProperties = systemProperties, driverDirectory = driverDirectory.toAbsolutePath(), useTestClock = useTestClock, isDebug = isDebug, @@ -752,7 +752,7 @@ class DriverDSL( "noNetworkMapServiceMode" to true ) + customOverrides ) - return startNodeInternal(name, config, webAddress, startInSameProcess, maximumHeapSize, logLevel) + return startNodeInternal(config, webAddress, startInSameProcess, maximumHeapSize) } override fun startNotaryNode(providedName: CordaX500Name, @@ -779,7 +779,7 @@ class DriverDSL( "noNetworkMapServiceMode" to true ) ) - startNodeInternal(name, config, webAddress, startInSameProcess, maximumHeapSize) + startNodeInternal(config, webAddress, startInSameProcess, maximumHeapSize) } } @@ -925,7 +925,7 @@ class DriverDSL( countObservables.remove(nodeConfiguration.myLegalName) } if (startInProcess ?: startNodesInProcess) { - val nodeAndThreadFuture = startInProcessNode(executorService, nodeConfiguration, enhancedConfig, cordappPackages) + val nodeAndThreadFuture = startInProcessNode(executorService, nodeConfiguration, config, cordappPackages) shutdownManager.registerShutdown( nodeAndThreadFuture.map { (node, thread) -> { @@ -943,7 +943,7 @@ class DriverDSL( } } else { val debugPort = if (isDebug) debugPortAllocation.nextPort() else null - val processFuture = startOutOfProcessNode(executorService, nodeConfiguration, enhancedConfig, quasarJarPath, debugPort, systemProperties, cordappPackages, maximumHeapSize, logLevel) + val processFuture = startOutOfProcessNode(executorService, nodeConfiguration, config, quasarJarPath, debugPort, systemProperties, cordappPackages, maximumHeapSize) registerProcess(processFuture) return processFuture.flatMap { process -> val processDeathFuture = poll(executorService, "process death") { diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt index 392330d7e5..3c6918e9ec 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt @@ -39,6 +39,7 @@ import net.corda.node.utilities.AffinityExecutor import net.corda.node.utilities.AffinityExecutor.ServiceAffinityExecutor import net.corda.nodeapi.internal.ServiceInfo import net.corda.testing.DUMMY_NOTARY +import net.corda.testing.initialiseTestSerialization import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.testNodeConfiguration