mirror of
https://github.com/corda/corda.git
synced 2025-03-13 07:54:32 +00:00
Simplifying internal startNode with bytemanPort parameter
This commit is contained in:
parent
73ca1601fb
commit
d88b02f7fe
@ -19,6 +19,7 @@ import net.corda.testing.core.ALICE_NAME
|
||||
import net.corda.testing.core.DUMMY_NOTARY_NAME
|
||||
import net.corda.testing.core.singleIdentity
|
||||
import net.corda.testing.driver.NodeHandle
|
||||
import net.corda.testing.driver.NodeParameters
|
||||
import net.corda.testing.driver.OutOfProcess
|
||||
import net.corda.testing.driver.internal.incrementalPortAllocation
|
||||
import net.corda.testing.internal.IntegrationTest
|
||||
@ -86,7 +87,7 @@ class InstrumentationTest : IntegrationTest() {
|
||||
) {
|
||||
|
||||
bytemanPort = portAllocation.nextPort()
|
||||
alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(testUser), bytemanPort = bytemanPort).getOrThrow()
|
||||
alice = startNode(NodeParameters(providedName = ALICE_NAME, rpcUsers = listOf(testUser)), bytemanPort = bytemanPort).getOrThrow()
|
||||
raftNotaryIdentity = defaultNotaryIdentity
|
||||
notaryNodes = defaultNotaryHandle.nodeHandles.getOrThrow().map { it as OutOfProcess }
|
||||
|
||||
@ -203,7 +204,7 @@ ENDRULE
|
||||
|
||||
// Restart node
|
||||
alice.stop() // this should perform un-registration in the NetworkMap
|
||||
alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(testUser), bytemanPort = bytemanPort).getOrThrow()
|
||||
alice = startNode(NodeParameters(providedName = ALICE_NAME, rpcUsers = listOf(testUser)), bytemanPort = bytemanPort).getOrThrow()
|
||||
aliceProxy = connectRpc(alice)
|
||||
|
||||
// Check that all 11 transactions are present
|
||||
|
@ -21,6 +21,7 @@ import net.corda.node.services.statemachine.ActionExecutorImpl
|
||||
import net.corda.testing.core.ALICE_NAME
|
||||
import net.corda.testing.core.singleIdentity
|
||||
import net.corda.testing.driver.NodeHandle
|
||||
import net.corda.testing.driver.NodeParameters
|
||||
import net.corda.testing.driver.OutOfProcess
|
||||
import net.corda.testing.driver.internal.incrementalPortAllocation
|
||||
import net.corda.testing.internal.IntegrationTest
|
||||
@ -112,7 +113,7 @@ class SystematicTerminationTest(private val terminationData: TerminationData) :
|
||||
//, isDebug = true
|
||||
) {
|
||||
bytemanPort = portAllocation.nextPort()
|
||||
alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(testUser), bytemanPort = bytemanPort).getOrThrow()
|
||||
alice = startNode(NodeParameters(providedName = ALICE_NAME, rpcUsers = listOf(testUser)), bytemanPort = bytemanPort).getOrThrow()
|
||||
raftNotaryIdentity = defaultNotaryIdentity
|
||||
|
||||
aliceProxy = connectRpc(alice)
|
||||
@ -192,7 +193,7 @@ ENDRULE
|
||||
|
||||
// Restart node
|
||||
alice.stop() // this should perform un-registration in the NetworkMap
|
||||
alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(testUser), bytemanPort = bytemanPort).getOrThrow()
|
||||
alice = startNode(NodeParameters(providedName = ALICE_NAME, rpcUsers = listOf(testUser)), bytemanPort = bytemanPort).getOrThrow()
|
||||
aliceProxy = connectRpc(alice)
|
||||
|
||||
logger.info("Node re-started successfully")
|
||||
|
@ -194,7 +194,9 @@ class DriverDSLImpl(
|
||||
}
|
||||
}
|
||||
|
||||
override fun startNode(parameters: NodeParameters): CordaFuture<NodeHandle> {
|
||||
override fun startNode(parameters: NodeParameters): CordaFuture<NodeHandle> = startNode(parameters, bytemanPort = null)
|
||||
|
||||
override fun startNode(parameters: NodeParameters, bytemanPort: Int?): CordaFuture<NodeHandle> {
|
||||
val p2pAddress = portAllocation.nextHostAndPort()
|
||||
// TODO: Derive name from the full picked name, don't just wrap the common name
|
||||
val name = parameters.providedName ?: CordaX500Name("${oneOf(names).organisation}-${p2pAddress.port}", "London", "GB")
|
||||
@ -978,16 +980,7 @@ interface InternalDriverDSL : DriverDSL {
|
||||
fun shutdown()
|
||||
|
||||
fun startNode(
|
||||
defaultParameters: NodeParameters = NodeParameters(),
|
||||
providedName: CordaX500Name? = defaultParameters.providedName,
|
||||
rpcUsers: List<User> = defaultParameters.rpcUsers,
|
||||
verifierType: VerifierType = defaultParameters.verifierType,
|
||||
customOverrides: Map<String, Any?> = defaultParameters.customOverrides,
|
||||
startInSameProcess: Boolean? = defaultParameters.startInSameProcess,
|
||||
maximumHeapSize: String = defaultParameters.maximumHeapSize,
|
||||
additionalCordapps: Collection<TestCordapp> = defaultParameters.additionalCordapps,
|
||||
regenerateCordappsOnStart: Boolean = defaultParameters.regenerateCordappsOnStart,
|
||||
flowOverrides: Map<out Class<out FlowLogic<*>>, Class<out FlowLogic<*>>> = emptyMap(),
|
||||
parameters: NodeParameters = NodeParameters(),
|
||||
bytemanPort: Int? = null
|
||||
): CordaFuture<NodeHandle>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user