From 4269e4a02e177abf4f3cc4c580bf08cd67fa2602 Mon Sep 17 00:00:00 2001 From: szymonsztuka Date: Tue, 27 Mar 2018 14:00:28 +0100 Subject: [PATCH 1/2] DrainingMode integration tests - explicit node names, changed column names of a test table. (#2879) Align DrainingMode integration tests (related to CORDA-1243) with Enterprise repo. --- .../integration-test/kotlin/net/corda/MessageState.kt | 4 ++-- .../modes/draining/FlowsDrainingModeContentionTest.kt | 6 ++++-- .../node/modes/draining/P2PFlowsDrainingModeTest.kt | 10 ++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/MessageState.kt b/node/src/integration-test/kotlin/net/corda/MessageState.kt index fcbe58417c..cb7a8ecdab 100644 --- a/node/src/integration-test/kotlin/net/corda/MessageState.kt +++ b/node/src/integration-test/kotlin/net/corda/MessageState.kt @@ -40,10 +40,10 @@ object MessageSchemaV1 : MappedSchema( @Entity @Table(name = "messages") class PersistentMessage( - @Column(name = "by") + @Column(name = "message_by") var by: String, - @Column(name = "value") + @Column(name = "message_value") var value: String ) : PersistentState() } diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt index e0cb4460b1..d432e853f1 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt @@ -18,6 +18,8 @@ import net.corda.core.utilities.unwrap import net.corda.RpcInfo import net.corda.client.rpc.CordaRPCClient import net.corda.node.services.Permissions.Companion.all +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.BOB_NAME import net.corda.testing.core.singleIdentity import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.PortAllocation @@ -55,8 +57,8 @@ class FlowsDrainingModeContentionTest { driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = portAllocation, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) { - val nodeA = startNode(rpcUsers = users).getOrThrow() - val nodeB = startNode(rpcUsers = users).getOrThrow() + val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow() + val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow() defaultNotaryNode.getOrThrow() val nodeARpcInfo = RpcInfo(nodeA.rpcAddress, user.username, user.password) diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt index 3acc1a6435..f92321c3be 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt @@ -10,6 +10,8 @@ import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.loggerFor import net.corda.core.utilities.unwrap import net.corda.node.services.Permissions +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.BOB_NAME import net.corda.testing.core.singleIdentity import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.PortAllocation @@ -53,8 +55,8 @@ class P2PFlowsDrainingModeTest { driver(DriverParameters(isDebug = true, startNodesInProcess = false, portAllocation = portAllocation)) { - val initiatedNode = startNode().getOrThrow() - val initiating = startNode(rpcUsers = users).getOrThrow().rpc + val initiatedNode = startNode(providedName = ALICE_NAME).getOrThrow() + val initiating = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow().rpc val counterParty = initiatedNode.nodeInfo.singleIdentity() val initiated = initiatedNode.rpc @@ -85,8 +87,8 @@ class P2PFlowsDrainingModeTest { driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = portAllocation)) { - val nodeA = startNode(rpcUsers = users).getOrThrow() - val nodeB = startNode(rpcUsers = users).getOrThrow() + val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow() + val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow() var successful = false val latch = CountDownLatch(1) nodeB.rpc.setFlowsDrainingModeEnabled(true) From 94557c7b887c3f672bd6c77319a378427694987d Mon Sep 17 00:00:00 2001 From: szymonsztuka Date: Tue, 27 Mar 2018 15:04:35 +0100 Subject: [PATCH 2/2] Merge remote-tracking branch 'remotes/opensource/master' into merges/drainingmode-integration-tests-27-03-2018 - fix compilation error # Conflicts: # node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt --- .../net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt index 85bb9f3db6..350191bf68 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt @@ -20,9 +20,7 @@ import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.loggerFor import net.corda.core.utilities.unwrap import net.corda.node.services.Permissions -import net.corda.testing.core.ALICE_NAME -import net.corda.testing.core.BOB_NAME -import net.corda.testing.core.singleIdentity +import net.corda.testing.core.* import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.PortAllocation import net.corda.testing.driver.driver