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(), debugPortAllocation: PortAllocation = incrementalPortAllocation(), 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> = emptyList(), jmxPolicy: JmxPolicy = JmxPolicy(), networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), notaryCustomOverrides: Map<String, Any?> = emptyMap(), inMemoryDB: Boolean = true, cordappsForAllNodes: Collection<TestCordapp>? = null)
DriverParameters(isDebug: Boolean = false, driverDirectory: Path = Paths.get("build") / "node-driver" / getTimestampAsDirectoryName(), portAllocation: PortAllocation = incrementalPortAllocation(), debugPortAllocation: PortAllocation = incrementalPortAllocation(), 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> = emptyList(), 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 = false, driverDirectory: Path = Paths.get("build") / "node-driver" / getTimestampAsDirectoryName(), portAllocation: PortAllocation = incrementalPortAllocation(), debugPortAllocation: PortAllocation = incrementalPortAllocation(), 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> = emptyList(), jmxPolicy: JmxPolicy = JmxPolicy(), networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), notaryCustomOverrides: Map<String, Any?> = emptyMap(), inMemoryDB: Boolean = false, cordappsForAllNodes: Collection<TestCordapp>? = null, djvmBootstrapSource: Path? = null, djvmCordaSource: List<Path> = emptyList(), environmentVariables: Map<String, String> = emptyMap(), allowHibernateToManageAppSchema: 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, inMemoryDB: Boolean)

Builder for configuring a driver.

DriverParameters(isDebug: Boolean = false, driverDirectory: Path = Paths.get("build") / "node-driver" / getTimestampAsDirectoryName(), portAllocation: PortAllocation = incrementalPortAllocation(), debugPortAllocation: PortAllocation = incrementalPortAllocation(), 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> = emptyList(), jmxPolicy: JmxPolicy = JmxPolicy(), networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), notaryCustomOverrides: Map<String, Any?> = emptyMap(), inMemoryDB: Boolean = false, cordappsForAllNodes: Collection<TestCordapp>? = null, djvmBootstrapSource: Path? = null, djvmCordaSource: List<Path> = emptyList(), environmentVariables: Map<String, String> = emptyMap(), allowHibernateToManageAppSchema: Boolean = true, premigrateH2Database: Boolean = true)

Properties

allowHibernateToManageAppSchema

val allowHibernateToManageAppSchema: Boolean

cordappsForAllNodes

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

val cordappsForAllNodes: Collection<TestCordapp>?

debugPortAllocation

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

val debugPortAllocation: PortAllocation

djvmBootstrapSource

Location of a JAR containing the Java APIs for the DJVM to use.

val djvmBootstrapSource: Path?

djvmCordaSource

Locations of JARs of user-supplied classes to execute within the DJVM sandbox.

val djvmCordaSource: List<Path>

driverDirectory

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.

val driverDirectory: Path

environmentVariables

val environmentVariables: Map<String, String>

extraCordappPackagesToScan

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.

val extraCordappPackagesToScan: List<String>

inMemoryDB

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.

val inMemoryDB: Boolean

isDebug

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

val isDebug: Boolean

jmxPolicy

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

val jmxPolicy: JmxPolicy

networkParameters

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

val networkParameters: NetworkParameters

notaryCustomOverrides

Extra settings that need to be passed to the notary.

val notaryCustomOverrides: Map<String, Any?>

notarySpecs

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.

val notarySpecs: List<NotarySpec>

portAllocation

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

val portAllocation: PortAllocation

premigrateH2Database

Whether to use a prebuilt H2 database schema or start from an empty schema. This can save time for tests which do not need to migrate from a blank schema.

val premigrateH2Database: Boolean

startNodesInProcess

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

val startNodesInProcess: Boolean

systemProperties

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

val systemProperties: Map<String, String>

useTestClock

If true the test clock will be used in Node.

val useTestClock: Boolean

waitForAllNodesToFinish

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.

val waitForAllNodesToFinish: Boolean

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
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>?, djvmBootstrapSource: Path?, djvmCordaSource: List<Path>, environmentVariables: Map<String, String>, allowHibernateToManageAppSchema: Boolean): DriverParameters

withAllowHibernateToManageAppSchema

fun withAllowHibernateToManageAppSchema(value: Boolean): DriverParameters

withCordappsForAllNodes

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

withDebugPortAllocation

fun withDebugPortAllocation(debugPortAllocation: PortAllocation): DriverParameters

withDjvmBootstrapSource

fun withDjvmBootstrapSource(djvmBootstrapSource: Path?): DriverParameters

withDjvmCordaSource

fun withDjvmCordaSource(djvmCordaSource: List<Path>): DriverParameters

withDriverDirectory

fun withDriverDirectory(driverDirectory: Path): DriverParameters

withEnvironmentVariables

fun withEnvironmentVariables(variables: Map<String, String>): 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