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)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)

Builder for configuring a driver.

Properties

allowHibernateToManageAppSchema

val allowHibernateToManageAppSchema: Boolean

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.

djvmBootstrapSource

val djvmBootstrapSource: Path?

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

djvmCordaSource

val djvmCordaSource: List<Path>

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

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.

environmentVariables

val environmentVariables: Map<String, String>

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.

premigrateH2Database

val premigrateH2Database: Boolean

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.

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
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

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

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