diff --git a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt index 5a04f40721..cf0adc7f28 100644 --- a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt @@ -9,6 +9,9 @@ import net.corda.core.utilities.getOrThrow import net.corda.node.internal.NodeStartup import net.corda.node.services.Permissions.Companion.startFlow import net.corda.testing.ALICE_NAME +import net.corda.testing.BOB_NAME +import net.corda.testing.DUMMY_BANK_A_NAME +import net.corda.testing.DUMMY_NOTARY_NAME import net.corda.testing.node.User import net.corda.testing.common.internal.ProjectStructure.projectRootDir import net.corda.testing.driver.driver diff --git a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt index 0045ca386a..8332c95acc 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt @@ -13,19 +13,20 @@ import net.corda.finance.DOLLARS import net.corda.finance.flows.CashIssueFlow import net.corda.finance.flows.CashPaymentFlow import net.corda.node.services.Permissions.Companion.startFlow +import net.corda.testing.ALICE_NAME +import net.corda.testing.DUMMY_BANK_A_NAME import net.corda.testing.DUMMY_NOTARY_NAME -import net.corda.testing.node.User +import net.corda.testing.TestIdentity import net.corda.testing.driver.NodeHandle 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.performance.div -import net.corda.testing.node.NotarySpec -import net.corda.testing.node.internal.InternalDriverDSL import net.corda.testing.internal.toDatabaseSchemaName import net.corda.testing.internal.toDatabaseSchemaNames import net.corda.testing.node.NotarySpec +import net.corda.testing.node.User import net.corda.testing.node.internal.InternalDriverDSL import net.corda.testing.node.internal.performance.startPublishingFixedRateInjector import net.corda.testing.node.internal.performance.startReporter diff --git a/node/src/integration-test/kotlin/net/corda/node/SSHServerTest.kt b/node/src/integration-test/kotlin/net/corda/node/SSHServerTest.kt index f053a4e98e..3608e42630 100644 --- a/node/src/integration-test/kotlin/net/corda/node/SSHServerTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/SSHServerTest.kt @@ -12,20 +12,15 @@ import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.unwrap import net.corda.node.services.Permissions.Companion.startFlow -import net.corda.node.services.Permissions.Companion.startFlow -import net.corda.testing.ALICE_NAME -import net.corda.testing.node.User import net.corda.testing.ALICE_NAME import net.corda.testing.driver.driver -import org.assertj.core.api.Assertions.assertThat 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.bouncycastle.util.io.Streams -import org.junit.Ignore import org.junit.ClassRule -import org.junit.Ignore import org.junit.Test import java.net.ConnectException import java.util.regex.Pattern diff --git a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt index 90b8081714..a9d190355a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt @@ -20,19 +20,14 @@ import net.corda.core.utilities.contextLogger import net.corda.core.utilities.getOrThrow import net.corda.node.internal.cordapp.CordappLoader import net.corda.node.internal.cordapp.CordappProviderImpl -import net.corda.testing.DUMMY_BANK_A_NAME -import net.corda.testing.DUMMY_NOTARY_NAME -import net.corda.testing.SerializationEnvironmentRule -import net.corda.testing.TestIdentity +import net.corda.testing.* import net.corda.testing.driver.DriverDSL import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.driver -import net.corda.testing.internal.rigorousMock import net.corda.testing.internal.* import net.corda.testing.services.MockAttachmentStorage import org.junit.Assert.assertEquals import org.junit.ClassRule -import org.junit.Ignore import org.junit.Rule import org.junit.Test import java.net.URLClassLoader diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt index cf6c72ab39..d1a69c9be5 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt @@ -26,13 +26,11 @@ import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.PEERS_PREF import net.corda.nodeapi.internal.config.SSLConfiguration import net.corda.testing.ALICE_NAME import net.corda.testing.BOB_NAME -import net.corda.testing.node.User import net.corda.testing.chooseIdentity -import net.corda.nodeapi.internal.config.User -import net.corda.testing.* import net.corda.testing.internal.IntegrationTestSchemas import net.corda.testing.internal.configureTestSSL import net.corda.testing.internal.toDatabaseSchemaName +import net.corda.testing.node.User import net.corda.testing.node.internal.NodeBasedTest import net.corda.testing.node.startFlow import org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt index b3c2633229..d715cc70d5 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt @@ -1,15 +1,20 @@ package net.corda.node.services.persistence -import net.corda.core.internal.VisibleForTesting -import net.corda.core.internal.bufferUntilSubscribed + +import net.corda.core.concurrent.CordaFuture import net.corda.core.crypto.SecureHash import net.corda.core.crypto.TransactionSignature import net.corda.core.internal.ThreadBox +import net.corda.core.internal.VisibleForTesting +import net.corda.core.internal.bufferUntilSubscribed +import net.corda.core.internal.concurrent.doneFuture import net.corda.core.messaging.DataFeed import net.corda.core.serialization.* +import net.corda.core.toFuture import net.corda.core.transactions.CoreTransaction import net.corda.core.transactions.SignedTransaction import net.corda.node.services.api.WritableTransactionStorage -import net.corda.node.utilities.AppendOnlyPersistentMap +import net.corda.node.utilities.AppendOnlyPersistentMapBase +import net.corda.node.utilities.WeightBasedAppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.nodeapi.internal.persistence.bufferUntilDatabaseCommit import net.corda.nodeapi.internal.persistence.wrapWithDatabaseTransaction @@ -90,7 +95,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S override fun track(): DataFeed, SignedTransaction> { return txStorage.locked { - DataFeed(allPersisted().map { it.second }.toList(), updatesPublisher.bufferUntilSubscribed().wrapWithDatabaseTransaction()) + DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updatesPublisher.bufferUntilSubscribed().wrapWithDatabaseTransaction()) } } @@ -100,7 +105,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S if (existingTransaction == null) { updatesPublisher.filter { it.id == id }.toFuture() } else { - doneFuture(existingTransaction) + doneFuture(existingTransaction.toSignedTx()) } } } diff --git a/perftestcordapp/src/integrationTest/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/NoSelectionIntegrationTest.kt b/perftestcordapp/src/integrationTest/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/NoSelectionIntegrationTest.kt index bf0cbd457f..c58ea5fb46 100644 --- a/perftestcordapp/src/integrationTest/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/NoSelectionIntegrationTest.kt +++ b/perftestcordapp/src/integrationTest/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/NoSelectionIntegrationTest.kt @@ -5,9 +5,9 @@ import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow import net.corda.finance.DOLLARS import net.corda.node.services.Permissions -import net.corda.nodeapi.internal.config.User import net.corda.testing.driver.PortAllocation import net.corda.testing.driver.driver +import net.corda.testing.node.User import org.junit.Ignore import org.junit.Test diff --git a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt index b41e869971..a70fd21d16 100644 --- a/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt +++ b/perftestcordapp/src/test/kotlin/com/r3/corda/enterprise/perftestcordapp/flows/TwoPartyTradeFlowTest.kt @@ -328,8 +328,8 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { return mockNet.createNode(MockNodeParameters(legalName = name), nodeFactory = { args -> object : MockNetwork.MockNode(args) { // That constructs a recording tx storage - override fun makeTransactionStorage(database: CordaPersistence): WritableTransactionStorage { - return RecordingTransactionStorage(database, super.makeTransactionStorage(database)) + override fun makeTransactionStorage(database: CordaPersistence, transactionCacheSizeBytes: Long): WritableTransactionStorage { + return RecordingTransactionStorage(database, super.makeTransactionStorage(database, transactionCacheSizeBytes)) } } }) diff --git a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt index 26da2996a0..c8238d8b75 100644 --- a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt +++ b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt @@ -6,6 +6,7 @@ import net.corda.node.services.Permissions.Companion.invokeRpc import net.corda.node.services.Permissions.Companion.startFlow import net.corda.testing.DUMMY_BANK_A_NAME import net.corda.testing.DUMMY_BANK_B_NAME +import net.corda.testing.DUMMY_NOTARY_NAME import net.corda.testing.node.User import net.corda.testing.driver.PortAllocation import net.corda.testing.driver.driver diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt index 2cd144de53..430fa81d58 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt @@ -13,15 +13,14 @@ import net.corda.node.internal.StartedNode import net.corda.node.internal.cordapp.CordappLoader import net.corda.node.services.config.* import net.corda.nodeapi.internal.config.toConfig -import net.corda.nodeapi.internal.config.User -import net.corda.testing.internal.IntegrationTest -import net.corda.testing.SerializationEnvironmentRule import net.corda.nodeapi.internal.network.NetworkParametersCopier -import net.corda.testing.node.User +import net.corda.testing.SerializationEnvironmentRule import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.getFreeLocalPorts +import net.corda.testing.internal.IntegrationTest import net.corda.testing.internal.testThreadFactory import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO +import net.corda.testing.node.User import org.apache.logging.log4j.Level import org.junit.After import org.junit.Before diff --git a/tools/jmeter/src/test/kotlin/com/r3/corda/jmeter/StartLocalPerfCorDapp.kt b/tools/jmeter/src/test/kotlin/com/r3/corda/jmeter/StartLocalPerfCorDapp.kt index 7f23b83893..15939f8731 100644 --- a/tools/jmeter/src/test/kotlin/com/r3/corda/jmeter/StartLocalPerfCorDapp.kt +++ b/tools/jmeter/src/test/kotlin/com/r3/corda/jmeter/StartLocalPerfCorDapp.kt @@ -2,9 +2,9 @@ package com.r3.corda.jmeter import net.corda.core.utilities.getOrThrow import net.corda.node.services.Permissions -import net.corda.nodeapi.internal.config.User import net.corda.testing.DUMMY_NOTARY_NAME import net.corda.testing.node.NotarySpec +import net.corda.testing.node.User import org.slf4j.LoggerFactory import java.io.BufferedReader import java.io.InputStreamReader