From 7370e6272e89d78179028dbd5b25271c1433b75f Mon Sep 17 00:00:00 2001 From: szymonsztuka Date: Wed, 28 Mar 2018 12:49:09 +0100 Subject: [PATCH] Add support for database integration tests for DrainingMode tests (#607) --- .../kotlin/net/corda/MessageState.kt | 2 ++ .../draining/FlowsDrainingModeContentionTest.kt | 15 +++++++++++---- .../modes/draining/P2PFlowsDrainingModeTest.kt | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/MessageState.kt b/node/src/integration-test/kotlin/net/corda/MessageState.kt index cb7a8ecdab..7c3897ccfa 100644 --- a/node/src/integration-test/kotlin/net/corda/MessageState.kt +++ b/node/src/integration-test/kotlin/net/corda/MessageState.kt @@ -37,6 +37,8 @@ object MessageSchemaV1 : MappedSchema( version = 1, mappedTypes = listOf(PersistentMessage::class.java)) { + override val migrationResource = "message-schema.changelog-init" + @Entity @Table(name = "messages") class PersistentMessage( 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 b5838306e0..f2082300f4 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 @@ -25,21 +25,28 @@ import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.unwrap 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.core.* import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.PortAllocation import net.corda.testing.driver.driver +import net.corda.testing.internal.IntegrationTest +import net.corda.testing.internal.IntegrationTestSchemas +import net.corda.testing.internal.toDatabaseSchemaName import net.corda.testing.node.User import org.assertj.core.api.Assertions.assertThat import org.junit.After import org.junit.Before +import org.junit.ClassRule import org.junit.Test import java.util.concurrent.Executors import java.util.concurrent.ScheduledExecutorService -class FlowsDrainingModeContentionTest { +class FlowsDrainingModeContentionTest : IntegrationTest() { + companion object { + @ClassRule + @JvmField + val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName()) + } private val portAllocation = PortAllocation.Incremental(10000) private val user = User("mark", "dadada", setOf(all())) 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 350191bf68..5b47b2f163 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 @@ -44,7 +44,7 @@ class P2PFlowsDrainingModeTest : IntegrationTest() { companion object { @ClassRule @JvmField - val databaseSchemas = IntegrationTestSchemas(*listOf(ALICE_NAME, BOB_NAME, DUMMY_BANK_A_NAME, DUMMY_NOTARY_NAME) + val databaseSchemas = IntegrationTestSchemas(*listOf(ALICE_NAME, BOB_NAME, DUMMY_NOTARY_NAME) .map { it.toDatabaseSchemaName() }.toTypedArray()) private val logger = loggerFor()