mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
CORDA-1743: Remove isDebug = true
from Node driver to speed-up integration tests execution. (#3535)
* CORDA-1743: Remove `isDebug = true` from Node driver to speed-up integration tests execution. * CORDA-1743: Undo removal of "isDebug = true" from the test that specifically checks for this condition. * CORDA-1743: Address input from @shamsasari
This commit is contained in:
@ -30,7 +30,7 @@ class FlowsExecutionModeRpcTest {
|
|||||||
assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win"))
|
assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win"))
|
||||||
|
|
||||||
val user = User("mark", "dadada", setOf(invokeRpc("setFlowsDrainingModeEnabled"), invokeRpc("isFlowsDrainingModeEnabled")))
|
val user = User("mark", "dadada", setOf(invokeRpc("setFlowsDrainingModeEnabled"), invokeRpc("isFlowsDrainingModeEnabled")))
|
||||||
driver(DriverParameters(isDebug = true, inMemoryDB = false, startNodesInProcess = true)) {
|
driver(DriverParameters(inMemoryDB = false, startNodesInProcess = true)) {
|
||||||
val nodeName = {
|
val nodeName = {
|
||||||
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||||
val nodeName = nodeHandle.nodeInfo.chooseIdentity().name
|
val nodeName = nodeHandle.nodeInfo.chooseIdentity().name
|
||||||
|
@ -36,7 +36,7 @@ class BootTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `double node start doesn't write into log file`() {
|
fun `double node start doesn't write into log file`() {
|
||||||
driver(DriverParameters(isDebug = true)) {
|
driver {
|
||||||
val alice = startNode(providedName = ALICE_NAME).get()
|
val alice = startNode(providedName = ALICE_NAME).get()
|
||||||
val logFolder = alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME
|
val logFolder = alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME
|
||||||
val logFile = logFolder.list { it.filter { it.fileName.toString().endsWith(".log") }.findAny().get() }
|
val logFile = logFolder.list { it.filter { it.fileName.toString().endsWith(".log") }.findAny().get() }
|
||||||
|
@ -21,7 +21,7 @@ class NodeUnloadHandlerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `should be able to register run on stop lambda`() {
|
fun `should be able to register run on stop lambda`() {
|
||||||
driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.node"), isDebug = true)) {
|
driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.node"))) {
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow()
|
startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow()
|
||||||
// just want to fall off the end of this for the mo...
|
// just want to fall off the end of this for the mo...
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class FlowRetryTest {
|
|||||||
val numSessions = 2
|
val numSessions = 2
|
||||||
val numIterations = 10
|
val numIterations = 10
|
||||||
val user = User("mark", "dadada", setOf(Permissions.startFlow<InitiatorFlow>()))
|
val user = User("mark", "dadada", setOf(Permissions.startFlow<InitiatorFlow>()))
|
||||||
val result: Any? = driver(DriverParameters(isDebug = true, startNodesInProcess = isQuasarAgentSpecified(),
|
val result: Any? = driver(DriverParameters(startNodesInProcess = isQuasarAgentSpecified(),
|
||||||
portAllocation = RandomFree)) {
|
portAllocation = RandomFree)) {
|
||||||
|
|
||||||
val nodeAHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
val nodeAHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||||
|
@ -53,7 +53,7 @@ class FlowsDrainingModeContentionTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `draining mode does not deadlock with acks between 2 nodes`() {
|
fun `draining mode does not deadlock with acks between 2 nodes`() {
|
||||||
val message = "Ground control to Major Tom"
|
val message = "Ground control to Major Tom"
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = portAllocation, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = portAllocation, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
||||||
val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow()
|
val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow()
|
||||||
val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow()
|
val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow()
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class P2PFlowsDrainingModeTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `flows draining mode suspends consumption of initial session messages`() {
|
fun `flows draining mode suspends consumption of initial session messages`() {
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, portAllocation = portAllocation)) {
|
driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation)) {
|
||||||
|
|
||||||
val initiatedNode = startNode(providedName = ALICE_NAME).getOrThrow()
|
val initiatedNode = startNode(providedName = ALICE_NAME).getOrThrow()
|
||||||
val initiating = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow().rpc
|
val initiating = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow().rpc
|
||||||
@ -85,7 +85,7 @@ class P2PFlowsDrainingModeTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `clean shutdown by draining`() {
|
fun `clean shutdown by draining`() {
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = portAllocation)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = portAllocation)) {
|
||||||
|
|
||||||
val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow()
|
val nodeA = startNode(providedName = ALICE_NAME, rpcUsers = users).getOrThrow()
|
||||||
val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow()
|
val nodeB = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow()
|
||||||
|
@ -24,7 +24,7 @@ class RpcFlowsDrainingModeTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `flows draining mode rejects start flows commands through rpc`() {
|
fun `flows draining mode rejects start flows commands through rpc`() {
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, portAllocation = portAllocation)) {
|
driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation)) {
|
||||||
|
|
||||||
startNode(rpcUsers = users).getOrThrow().rpc.apply {
|
startNode(rpcUsers = users).getOrThrow().rpc.apply {
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class NodeStatePersistenceTests {
|
|||||||
fun `persistent state survives node restart`() {
|
fun `persistent state survives node restart`() {
|
||||||
val user = User("mark", "dadada", setOf(startFlow<SendMessageFlow>(), invokeRpc("vaultQuery")))
|
val user = User("mark", "dadada", setOf(startFlow<SendMessageFlow>(), invokeRpc("vaultQuery")))
|
||||||
val message = Message("Hello world!")
|
val message = Message("Hello world!")
|
||||||
val stateAndRef: StateAndRef<MessageState>? = driver(DriverParameters(isDebug = true, inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(),
|
val stateAndRef: StateAndRef<MessageState>? = driver(DriverParameters(inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(),
|
||||||
portAllocation = RandomFree, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
portAllocation = RandomFree, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
||||||
val nodeName = {
|
val nodeName = {
|
||||||
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||||
@ -70,7 +70,7 @@ class NodeStatePersistenceTests {
|
|||||||
|
|
||||||
val user = User("mark", "dadada", setOf(startFlow<SendMessageFlow>(), invokeRpc("vaultQuery")))
|
val user = User("mark", "dadada", setOf(startFlow<SendMessageFlow>(), invokeRpc("vaultQuery")))
|
||||||
val message = Message("Hello world!")
|
val message = Message("Hello world!")
|
||||||
val stateAndRef: StateAndRef<MessageState>? = driver(DriverParameters(isDebug = true, inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), portAllocation = RandomFree, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
val stateAndRef: StateAndRef<MessageState>? = driver(DriverParameters(inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), portAllocation = RandomFree, extraCordappPackagesToScan = listOf(MessageState::class.packageName))) {
|
||||||
val nodeName = {
|
val nodeName = {
|
||||||
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
val nodeHandle = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||||
val nodeName = nodeHandle.nodeInfo.singleIdentity().name
|
val nodeName = nodeHandle.nodeInfo.singleIdentity().name
|
||||||
|
@ -46,7 +46,7 @@ class RpcSslTest {
|
|||||||
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
||||||
val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions)
|
val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions)
|
||||||
val connection = client.start(user.username, user.password)
|
val connection = client.start(user.username, user.password)
|
||||||
@ -84,7 +84,7 @@ class RpcSslTest {
|
|||||||
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1)
|
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1)
|
||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
||||||
Assertions.assertThatThrownBy {
|
Assertions.assertThatThrownBy {
|
||||||
val connection = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions).start(user.username, user.password)
|
val connection = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions).start(user.username, user.password)
|
||||||
@ -104,7 +104,7 @@ class RpcSslTest {
|
|||||||
fun `RPC client not using ssl can run commands`() {
|
fun `RPC client not using ssl can run commands`() {
|
||||||
val user = User("mark", "dadada", setOf(all()))
|
val user = User("mark", "dadada", setOf(all()))
|
||||||
var successful = false
|
var successful = false
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
val node = startNode(rpcUsers = listOf(user)).getOrThrow()
|
val node = startNode(rpcUsers = listOf(user)).getOrThrow()
|
||||||
val connection = CordaRPCClient(node.rpcAddress).start(user.username, user.password)
|
val connection = CordaRPCClient(node.rpcAddress).start(user.username, user.password)
|
||||||
connection.proxy.apply {
|
connection.proxy.apply {
|
||||||
@ -124,7 +124,7 @@ class RpcSslTest {
|
|||||||
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
val node = startNode(customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
val node = startNode(customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow()
|
||||||
val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions)
|
val client = CordaRPCClient.createWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions)
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class HardRestartTest {
|
|||||||
@Test
|
@Test
|
||||||
fun restartShortPingPongFlowRandomly() {
|
fun restartShortPingPongFlowRandomly() {
|
||||||
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
||||||
val (a, b) = listOf(
|
val (a, b) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
||||||
@ -93,7 +93,7 @@ class HardRestartTest {
|
|||||||
@Test
|
@Test
|
||||||
fun restartLongPingPongFlowRandomly() {
|
fun restartLongPingPongFlowRandomly() {
|
||||||
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
||||||
val (a, b) = listOf(
|
val (a, b) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
||||||
@ -125,7 +125,7 @@ class HardRestartTest {
|
|||||||
@Test
|
@Test
|
||||||
fun softRestartLongPingPongFlowRandomly() {
|
fun softRestartLongPingPongFlowRandomly() {
|
||||||
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<Ping>(), Permissions.all()))
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
||||||
val (a, b) = listOf(
|
val (a, b) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
||||||
@ -201,7 +201,7 @@ class HardRestartTest {
|
|||||||
@Test
|
@Test
|
||||||
fun restartRecursiveFlowRandomly() {
|
fun restartRecursiveFlowRandomly() {
|
||||||
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<RecursiveA>(), Permissions.all()))
|
val demoUser = User("demo", "demo", setOf(Permissions.startFlow<RecursiveA>(), Permissions.all()))
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) {
|
||||||
val (a, b) = listOf(
|
val (a, b) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:30000")),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = listOf(demoUser), customOverrides = mapOf("p2pAddress" to "localhost:40000"))
|
||||||
|
@ -17,7 +17,7 @@ class AttachmentDemoTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `attachment demo using a 10MB zip file`() {
|
fun `attachment demo using a 10MB zip file`() {
|
||||||
val numOfExpectedBytes = 10_000_000
|
val numOfExpectedBytes = 10_000_000
|
||||||
driver(DriverParameters(isDebug = true, portAllocation = PortAllocation.Incremental(20000))) {
|
driver(DriverParameters(portAllocation = PortAllocation.Incremental(20000))) {
|
||||||
val demoUser = listOf(User("demo", "demo", setOf(all())))
|
val demoUser = listOf(User("demo", "demo", setOf(all())))
|
||||||
val (nodeA, nodeB) = listOf(
|
val (nodeA, nodeB) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = demoUser, maximumHeapSize = "1g"),
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = demoUser, maximumHeapSize = "1g"),
|
||||||
|
@ -13,7 +13,7 @@ import net.corda.testing.driver.driver
|
|||||||
*/
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val demoUser = listOf(User("demo", "demo", setOf("StartFlow.net.corda.flows.FinalityFlow")))
|
val demoUser = listOf(User("demo", "demo", setOf("StartFlow.net.corda.flows.FinalityFlow")))
|
||||||
driver(DriverParameters(isDebug = true, driverDirectory = "build" / "attachment-demo-nodes", waitForAllNodesToFinish = true)) {
|
driver(DriverParameters(driverDirectory = "build" / "attachment-demo-nodes", waitForAllNodesToFinish = true)) {
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = demoUser)
|
startNode(providedName = DUMMY_BANK_A_NAME, rpcUsers = demoUser)
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = demoUser)
|
startNode(providedName = DUMMY_BANK_B_NAME, rpcUsers = demoUser)
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class BankOfCordaRPCClientTest {
|
|||||||
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name),
|
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name),
|
||||||
invokeRpc(CordaRPCOps::notaryIdentities)
|
invokeRpc(CordaRPCOps::notaryIdentities)
|
||||||
)
|
)
|
||||||
driver(DriverParameters(extraCordappPackagesToScan = listOf("net.corda.finance"), isDebug = true)) {
|
driver(DriverParameters(extraCordappPackagesToScan = listOf("net.corda.finance"))) {
|
||||||
val bocManager = User("bocManager", "password1", permissions = setOf(
|
val bocManager = User("bocManager", "password1", permissions = setOf(
|
||||||
startFlow<CashIssueAndPaymentFlow>()) + commonPermissions)
|
startFlow<CashIssueAndPaymentFlow>()) + commonPermissions)
|
||||||
val bigCorpCFO = User("bigCorpCFO", "password2", permissions = emptySet<String>() + commonPermissions)
|
val bigCorpCFO = User("bigCorpCFO", "password2", permissions = emptySet<String>() + commonPermissions)
|
||||||
|
@ -12,7 +12,7 @@ import net.corda.testing.driver.driver
|
|||||||
* Do not use in a production environment.
|
* Do not use in a production environment.
|
||||||
*/
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
driver(DriverParameters(useTestClock = true, isDebug = true, waitForAllNodesToFinish = true)) {
|
driver(DriverParameters(useTestClock = true, waitForAllNodesToFinish = true)) {
|
||||||
val (nodeA, nodeB) = listOf(
|
val (nodeA, nodeB) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME),
|
startNode(providedName = DUMMY_BANK_A_NAME),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME),
|
startNode(providedName = DUMMY_BANK_B_NAME),
|
||||||
|
@ -53,7 +53,6 @@ class IRSDemoTest {
|
|||||||
springDriver(DriverParameters(
|
springDriver(DriverParameters(
|
||||||
useTestClock = true,
|
useTestClock = true,
|
||||||
notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, rpcUsers = rpcUsers)),
|
notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, rpcUsers = rpcUsers)),
|
||||||
isDebug = true,
|
|
||||||
extraCordappPackagesToScan = listOf("net.corda.irs")
|
extraCordappPackagesToScan = listOf("net.corda.irs")
|
||||||
)) {
|
)) {
|
||||||
val (controller, nodeA, nodeB) = listOf(
|
val (controller, nodeA, nodeB) = listOf(
|
||||||
|
@ -48,7 +48,6 @@ class SimmValuationTest {
|
|||||||
val logConfigFile = projectRootDir / "samples" / "simm-valuation-demo" / "src" / "main" / "resources" / "log4j2.xml"
|
val logConfigFile = projectRootDir / "samples" / "simm-valuation-demo" / "src" / "main" / "resources" / "log4j2.xml"
|
||||||
assertThat(logConfigFile).isRegularFile()
|
assertThat(logConfigFile).isRegularFile()
|
||||||
driver(DriverParameters(
|
driver(DriverParameters(
|
||||||
isDebug = true,
|
|
||||||
extraCordappPackagesToScan = listOf("net.corda.vega.contracts", "net.corda.vega.plugin.customserializers"),
|
extraCordappPackagesToScan = listOf("net.corda.vega.contracts", "net.corda.vega.plugin.customserializers"),
|
||||||
systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))
|
systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))
|
||||||
) {
|
) {
|
||||||
|
@ -13,7 +13,7 @@ import net.corda.testing.driver.driver
|
|||||||
* via the web api.
|
* via the web api.
|
||||||
*/
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
driver(DriverParameters(isDebug = true, waitForAllNodesToFinish = true)) {
|
driver(DriverParameters(waitForAllNodesToFinish = true)) {
|
||||||
val (nodeA, nodeB, nodeC) = listOf(
|
val (nodeA, nodeB, nodeC) = listOf(
|
||||||
startNode(providedName = DUMMY_BANK_A_NAME),
|
startNode(providedName = DUMMY_BANK_A_NAME),
|
||||||
startNode(providedName = DUMMY_BANK_B_NAME),
|
startNode(providedName = DUMMY_BANK_B_NAME),
|
||||||
|
@ -76,7 +76,7 @@ class TraderDemoTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Tudor test`() {
|
fun `Tudor test`() {
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = false, inMemoryDB = false, extraCordappPackagesToScan = listOf("net.corda.finance"))) {
|
driver(DriverParameters(startNodesInProcess = false, inMemoryDB = false, extraCordappPackagesToScan = listOf("net.corda.finance"))) {
|
||||||
val demoUser = User("demo", "demo", setOf(startFlow<SellerFlow>(), all()))
|
val demoUser = User("demo", "demo", setOf(startFlow<SellerFlow>(), all()))
|
||||||
val bankUser = User("user1", "test", permissions = setOf(all()))
|
val bankUser = User("user1", "test", permissions = setOf(all()))
|
||||||
val (nodeA, nodeB, bankNode) = listOf(
|
val (nodeA, nodeB, bankNode) = listOf(
|
||||||
|
@ -23,7 +23,7 @@ fun main(args: Array<String>) {
|
|||||||
startFlow<SellerFlow>(),
|
startFlow<SellerFlow>(),
|
||||||
all())
|
all())
|
||||||
val demoUser = listOf(User("demo", "demo", permissions))
|
val demoUser = listOf(User("demo", "demo", permissions))
|
||||||
driver(DriverParameters(driverDirectory = "build" / "trader-demo-nodes", isDebug = true, waitForAllNodesToFinish = true)) {
|
driver(DriverParameters(driverDirectory = "build" / "trader-demo-nodes", waitForAllNodesToFinish = true)) {
|
||||||
val user = User("user1", "test", permissions = setOf(startFlow<CashIssueFlow>(),
|
val user = User("user1", "test", permissions = setOf(startFlow<CashIssueFlow>(),
|
||||||
startFlow<CommercialPaperIssueFlow>(),
|
startFlow<CommercialPaperIssueFlow>(),
|
||||||
startFlow<SellerFlow>()))
|
startFlow<SellerFlow>()))
|
||||||
|
@ -57,7 +57,6 @@ class CordformNodeRunner(val cordformDefinition: CordformDefinition) {
|
|||||||
.mapNotNull { address -> address?.let { NetworkHostAndPort.parse(it).port } }
|
.mapNotNull { address -> address?.let { NetworkHostAndPort.parse(it).port } }
|
||||||
.max()!!
|
.max()!!
|
||||||
internalDriver(
|
internalDriver(
|
||||||
isDebug = true,
|
|
||||||
jmxPolicy = JmxPolicy(true),
|
jmxPolicy = JmxPolicy(true),
|
||||||
driverDirectory = cordformDefinition.nodesDirectory,
|
driverDirectory = cordformDefinition.nodesDirectory,
|
||||||
extraCordappPackagesToScan = extraPackagesToScan,
|
extraCordappPackagesToScan = extraPackagesToScan,
|
||||||
|
@ -44,7 +44,7 @@ class InteractiveShellIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `shell should not log in with invalid credentials`() {
|
fun `shell should not log in with invalid credentials`() {
|
||||||
val user = User("u", "p", setOf())
|
val user = User("u", "p", setOf())
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
val nodeFuture = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), startInSameProcess = true)
|
val nodeFuture = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user), startInSameProcess = true)
|
||||||
val node = nodeFuture.getOrThrow()
|
val node = nodeFuture.getOrThrow()
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class InteractiveShellIntegrationTest {
|
|||||||
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert)
|
||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
||||||
|
|
||||||
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
||||||
@ -113,7 +113,7 @@ class InteractiveShellIntegrationTest {
|
|||||||
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1)
|
val trustStorePath = saveToTrustStore(tempFolder.root.toPath() / "truststore.jks", cert1)
|
||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
||||||
|
|
||||||
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
||||||
@ -130,7 +130,7 @@ class InteractiveShellIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `internal shell user should not be able to connect if node started with devMode=false`() {
|
fun `internal shell user should not be able to connect if node started with devMode=false`() {
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
startNode().getOrThrow().use { node ->
|
startNode().getOrThrow().use { node ->
|
||||||
val conf = (node as NodeHandleInternal).configuration.toShellConfig()
|
val conf = (node as NodeHandleInternal).configuration.toShellConfig()
|
||||||
InteractiveShell.startShellInternal(conf)
|
InteractiveShell.startShellInternal(conf)
|
||||||
@ -196,7 +196,7 @@ class InteractiveShellIntegrationTest {
|
|||||||
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
val clientSslOptions = ClientRpcSslOptions(trustStorePath, "password")
|
||||||
|
|
||||||
var successful = false
|
var successful = false
|
||||||
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
|
driver(DriverParameters(startNodesInProcess = true, portAllocation = RandomFree)) {
|
||||||
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow().use { node ->
|
||||||
|
|
||||||
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
val conf = ShellConfiguration(commandsDirectory = Files.createTempDir().toPath(),
|
||||||
|
@ -97,7 +97,7 @@ class SSHServerTest {
|
|||||||
val user = User("u", "p", setOf(startFlow<FlowICanRun>(),
|
val user = User("u", "p", setOf(startFlow<FlowICanRun>(),
|
||||||
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name)))
|
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name)))
|
||||||
// The driver will automatically pick up the annotated flows below
|
// The driver will automatically pick up the annotated flows below
|
||||||
driver(DriverParameters(isDebug = true)) {
|
driver {
|
||||||
val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user),
|
val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user),
|
||||||
customOverrides = mapOf("sshd" to mapOf("port" to 2222)))
|
customOverrides = mapOf("sshd" to mapOf("port" to 2222)))
|
||||||
node.getOrThrow()
|
node.getOrThrow()
|
||||||
@ -126,7 +126,7 @@ class SSHServerTest {
|
|||||||
fun `ssh runs flows`() {
|
fun `ssh runs flows`() {
|
||||||
val user = User("u", "p", setOf(startFlow<FlowICanRun>()))
|
val user = User("u", "p", setOf(startFlow<FlowICanRun>()))
|
||||||
// The driver will automatically pick up the annotated flows below
|
// The driver will automatically pick up the annotated flows below
|
||||||
driver(DriverParameters(isDebug = true)) {
|
driver {
|
||||||
val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user),
|
val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user),
|
||||||
customOverrides = mapOf("sshd" to mapOf("port" to 2222)))
|
customOverrides = mapOf("sshd" to mapOf("port" to 2222)))
|
||||||
node.getOrThrow()
|
node.getOrThrow()
|
||||||
|
Reference in New Issue
Block a user