corda / net.corda.testing.driver / DriverParameters

DriverParameters

data class DriverParameters

Builder for configuring a driver.

Constructors

<init>

DriverParameters(cordappsForAllNodes: Collection<TestCordapp>)
DriverParameters(isDebug: Boolean = false, driverDirectory: Path = Paths.get("build") / "node-driver" / getTimestampAsDirectoryName(), portAllocation: PortAllocation = incrementalPortAllocation(10000), debugPortAllocation: PortAllocation = incrementalPortAllocation(5005), systemProperties: Map<String, String> = emptyMap(), useTestClock: Boolean = false, startNodesInProcess: Boolean = false, waitForAllNodesToFinish: Boolean = false, notarySpecs: List<NotarySpec> = listOf(NotarySpec(DUMMY_NOTARY_NAME)), extraCordappPackagesToScan: List<String> = listOf("migration"), jmxPolicy: JmxPolicy = JmxPolicy(), networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), notaryCustomOverrides: Map<String, Any?> = emptyMap(), inMemoryDB: Boolean = true)
DriverParameters(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters)
DriverParameters(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters, inMemoryDB: Boolean)
DriverParameters(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters, notaryCustomOverrides: Map<String, Any?>, inMemoryDB: Boolean, cordappsForAllNodes: Collection<TestCordapp>?)DriverParameters(isDebug: Boolean = false, driverDirectory: Path = Paths.get("build") / "node-driver" / getTimestampAsDirectoryName(), portAllocation: PortAllocation = incrementalPortAllocation(10000), debugPortAllocation: PortAllocation = incrementalPortAllocation(5005), systemProperties: Map<String, String> = emptyMap(), useTestClock: Boolean = false, startNodesInProcess: Boolean = false, waitForAllNodesToFinish: Boolean = false, notarySpecs: List<NotarySpec> = listOf(NotarySpec(DUMMY_NOTARY_NAME)), extraCordappPackagesToScan: List<String> = listOf("migration"), jmxPolicy: JmxPolicy = JmxPolicy(), networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), notaryCustomOverrides: Map<String, Any?> = emptyMap(), inMemoryDB: Boolean = true, cordappsForAllNodes: Collection<TestCordapp>? = null, enableSNI: Boolean = true)

Builder for configuring a driver.

Properties

cordappsForAllNodes

val cordappsForAllNodes: Collection<TestCordapp>?

TestCordapps that will be added to each node started by the DriverDSL.

debugPortAllocation

val debugPortAllocation: PortAllocation

The port allocation strategy to use for jvm debugging. Defaults to incremental.

driverDirectory

val driverDirectory: Path

The base directory node directories go into, defaults to "build//". The node directories themselves are "//", where legalName defaults to "-" and may be specified in DriverDSL.startNode.

enableSNI

val enableSNI: Boolean

extraCordappPackagesToScan

val extraCordappPackagesToScan: List<String>

A List of additional cordapp packages to scan for any cordapp code, e.g. contract verification code, flows and services. The calling package is automatically included in this list. If this is not desirable then use cordappsForAllNodes instead.

inMemoryDB

val inMemoryDB: Boolean

Whether to use in-memory H2 for new nodes rather then on-disk (the node starts quicker, however the data is not persisted between node restarts). Has no effect if node is configured in any way to use database other than H2.

isDebug

val isDebug: Boolean

Indicates whether the spawned nodes should start in jdwt debug mode and have debug level logging.

jmxPolicy

val jmxPolicy: JmxPolicy

Used to specify whether to expose JMX metrics via Jolokia HHTP/JSON.

networkParameters

val networkParameters: NetworkParameters

The network parameters to be used by all the nodes. NetworkParameters.notaries must be empty as notaries are defined by notarySpecs.

notaryCustomOverrides

val notaryCustomOverrides: Map<String, Any?>

Extra settings that need to be passed to the notary.

notarySpecs

val notarySpecs: List<NotarySpec>

The notaries advertised for this network. These nodes will be started automatically and will be available from DriverDSL.notaryHandles, and will be added automatically to the network parameters. Defaults to a simple validating notary.

portAllocation

val portAllocation: PortAllocation

The port allocation strategy to use for the messaging and the web server addresses. Defaults to incremental.

startNodesInProcess

val startNodesInProcess: Boolean

Provides the default behaviour of whether new nodes should start inside this process or not. Note that this may be overridden in DriverDSL.startNode.

systemProperties

val systemProperties: Map<String, String>

A Map of extra system properties which will be given to each new node. Defaults to empty.

useTestClock

val useTestClock: Boolean

If true the test clock will be used in Node.

waitForAllNodesToFinish

val waitForAllNodesToFinish: Boolean

If true, the nodes will not shut down automatically after executing the code in the driver DSL block. It will wait for them to be shut down externally instead.

Functions

copy

fun copy(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters): DriverParameters
fun copy(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters, cordappsForAllNodes: Set<TestCordapp>?): DriverParameters
fun copy(isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters, notaryCustomOverrides: Map<String, Any?>, inMemoryDB: Boolean, cordappsForAllNodes: Collection<TestCordapp>?): DriverParameters

withCordappsForAllNodes

fun withCordappsForAllNodes(cordappsForAllNodes: Collection<TestCordapp>?): DriverParameters

withDebugPortAllocation

fun withDebugPortAllocation(debugPortAllocation: PortAllocation): DriverParameters

withDriverDirectory

fun withDriverDirectory(driverDirectory: Path): DriverParameters

withExtraCordappPackagesToScan

fun withExtraCordappPackagesToScan(extraCordappPackagesToScan: List<String>): DriverParameters

withInMemoryDB

fun withInMemoryDB(inMemoryDB: Boolean): DriverParameters

withIsDebug

fun withIsDebug(isDebug: Boolean): DriverParameters

withJmxPolicy

fun withJmxPolicy(jmxPolicy: JmxPolicy): DriverParameters

withNetworkParameters

fun withNetworkParameters(networkParameters: NetworkParameters): DriverParameters

withNotaryCustomOverrides

fun withNotaryCustomOverrides(notaryCustomOverrides: Map<String, Any?>): DriverParameters

withNotarySpecs

fun withNotarySpecs(notarySpecs: List<NotarySpec>): DriverParameters

withPortAllocation

fun withPortAllocation(portAllocation: PortAllocation): DriverParameters

withStartNodesInProcess

fun withStartNodesInProcess(startNodesInProcess: Boolean): DriverParameters

withSystemProperties

fun withSystemProperties(systemProperties: Map<String, String>): DriverParameters

withUseTestClock

fun withUseTestClock(useTestClock: Boolean): DriverParameters

withWaitForAllNodesToFinish

fun withWaitForAllNodesToFinish(waitForAllNodesToFinish: Boolean): DriverParameters

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.