Update integration test setup in database mode after OS->ENT merge (#732)

Added Notary schema for SQL setup to tests.
Added SQL setup/tearDown to a loop starting the same node few times in DriverTests.
This commit is contained in:
szymonsztuka 2018-04-13 15:28:07 +01:00 committed by GitHub
parent f4ce31019e
commit 05ec885afd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import net.corda.finance.USD
import net.corda.testing.core.ALICE_NAME
import net.corda.testing.core.BOB_NAME
import net.corda.testing.core.DUMMY_BANK_A_NAME
import net.corda.testing.core.DUMMY_NOTARY_NAME
import net.corda.testing.driver.driver
import net.corda.testing.internal.IntegrationTest
import net.corda.testing.internal.IntegrationTestSchemas
@ -30,7 +31,7 @@ class CashConfigDataFlowTest : IntegrationTest() {
@ClassRule
@JvmField
val databaseSchemas = IntegrationTestSchemas(ALICE_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(),
DUMMY_BANK_A_NAME.toDatabaseSchemaName())
DUMMY_BANK_A_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName())
}
@Test
fun `issuable currencies are read in from node config`() {

View File

@ -16,6 +16,7 @@ import net.corda.core.serialization.SingletonSerializeAsToken
import net.corda.core.utilities.contextLogger
import net.corda.core.utilities.getOrThrow
import net.corda.testing.core.DUMMY_BANK_A_NAME
import net.corda.testing.core.DUMMY_NOTARY_NAME
import net.corda.testing.driver.DriverParameters
import net.corda.testing.driver.driver
import net.corda.testing.internal.IntegrationTest
@ -31,7 +32,7 @@ class NodeUnloadHandlerTests : IntegrationTest() {
companion object {
@ClassRule
@JvmField
val databaseSchemas = IntegrationTestSchemas(DUMMY_BANK_A_NAME.toDatabaseSchemaName())
val databaseSchemas = IntegrationTestSchemas(DUMMY_BANK_A_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName() )
val latch = CountDownLatch(1)
}

View File

@ -62,7 +62,7 @@ class DriverTests : IntegrationTest() {
@ClassRule
@JvmField
val databaseSchemas = IntegrationTestSchemas(DUMMY_BANK_A_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName(),
DUMMY_REGULATOR_NAME.toDatabaseSchemaName())
DUMMY_REGULATOR_NAME.toDatabaseSchemaName(), BOB_NAME.toDatabaseSchemaName(), DUMMY_BANK_B_NAME.toDatabaseSchemaName())
}
@Test
@ -94,10 +94,12 @@ class DriverTests : IntegrationTest() {
fun `default notary is visible when the startNode future completes`() {
// Based on local testing, running this 3 times gives us a high confidence that we'll spot if the feature is not working
repeat(3) {
setUp() // R3.Corda only: Schema setup for standalone database, does nothing for H2
driver(DriverParameters(startNodesInProcess = true)) {
val bob = startNode(providedName = BOB_NAME).getOrThrow()
assertThat(bob.rpc.networkMapSnapshot().flatMap { it.legalIdentities }).contains(defaultNotaryIdentity)
}
tearDown() // R3.Corda only: Schema cleanup for standalone database, does nothing for H2
}
}

View File

@ -13,6 +13,7 @@ package net.corda.webserver
import net.corda.core.utilities.NetworkHostAndPort
import net.corda.core.utilities.getOrThrow
import net.corda.testing.core.DUMMY_BANK_A_NAME
import net.corda.testing.core.DUMMY_NOTARY_NAME
import net.corda.testing.internal.IntegrationTest
import net.corda.testing.internal.IntegrationTestSchemas
import net.corda.testing.driver.WebserverHandle
@ -39,7 +40,7 @@ class WebserverDriverTests : IntegrationTest() {
@ClassRule
@JvmField
val databaseSchemas = IntegrationTestSchemas(DUMMY_BANK_A_NAME.toDatabaseSchemaName())
val databaseSchemas = IntegrationTestSchemas(DUMMY_BANK_A_NAME.toDatabaseSchemaName(), DUMMY_NOTARY_NAME.toDatabaseSchemaName())
}
@Test