Modify Node to allow alternative DJVM configurations for testing.

This commit is contained in:
Chris Rankin 2019-10-09 12:15:56 +01:00
parent e7997e6546
commit ea6db636fb

View File

@ -102,7 +102,9 @@ open class Node(configuration: NodeConfiguration,
versionInfo: VersionInfo, versionInfo: VersionInfo,
private val initialiseSerialization: Boolean = true, private val initialiseSerialization: Boolean = true,
flowManager: FlowManager = NodeFlowManager(configuration.flowOverrides), flowManager: FlowManager = NodeFlowManager(configuration.flowOverrides),
cacheFactoryPrototype: BindableNamedCacheFactory = DefaultNamedCacheFactory() cacheFactoryPrototype: BindableNamedCacheFactory = DefaultNamedCacheFactory(),
djvmBootstrapSource: ApiSource = createBootstrapSource(configuration),
djvmCordaSource: UserSource? = createDeterministicClasspath(configuration)
) : AbstractNode<NodeInfo>( ) : AbstractNode<NodeInfo>(
configuration, configuration,
createClock(configuration), createClock(configuration),
@ -111,8 +113,8 @@ open class Node(configuration: NodeConfiguration,
flowManager, flowManager,
// Under normal (non-test execution) it will always be "1" // Under normal (non-test execution) it will always be "1"
AffinityExecutor.ServiceAffinityExecutor("Node thread-${sameVmNodeCounter.incrementAndGet()}", 1), AffinityExecutor.ServiceAffinityExecutor("Node thread-${sameVmNodeCounter.incrementAndGet()}", 1),
djvmBootstrapSource = createBootstrapSource(configuration), djvmBootstrapSource = djvmBootstrapSource,
djvmCordaSource = createDeterministicClasspath(configuration) djvmCordaSource = djvmCordaSource
) { ) {
override fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): NodeInfo = override fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): NodeInfo =