public class MockNetworkParameters
Immutable builder for configuring a class MockNetwork
.
class MockNetwork
public MockNetworkParameters(boolean networkSendManuallyPumped, boolean threadPerNode, @NotNull net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy servicePeerAllocationStrategy, @NotNull java.util.List<net.corda.testing.node.MockNetworkNotarySpec> notarySpecs, @NotNull NetworkParameters networkParameters, @NotNull java.util.Collection<? extends net.corda.testing.node.TestCordapp> cordappsForAllNodes)
Immutable builder for configuring a class MockNetwork
.
networkSendManuallyPumped
- If false then messages will not be routed from sender to receiver until you usethe MockNetwork.runNetwork
method. This is useful for writing single-threaded unit test code that can examine thestate of the mock network before and after a message is sent, without races and without the receiving node immediatelysending a response. The default is false, so you must call runNetwork.threadPerNode
- If true then each node will be run in its own thread. This can result in race conditions inyour code if not carefully written, but is more realistic and may help if you have flows in your app that do longblocking operations. The default is false.servicePeerAllocationStrategy
- How messages are load balanced in the case where a single compound identityis used by multiple nodes. You rarely if ever need to change that, it's primarily of interest to people testingnotary code.notarySpecs
- The notaries to use in the mock network. By default you get one mock notary and that is usually sufficient.networkParameters
- The network parameters to be used by all the nodes. NetworkParameters.notaries must beempty as notaries are defined by notarySpecs.cordappsForAllNodes
- class TestCordapp
s added to all nodes.class MockNetwork
public MockNetworkParameters()
Immutable builder for configuring a class MockNetwork
.
class MockNetwork
public MockNetworkParameters(boolean networkSendManuallyPumped, boolean threadPerNode, @NotNull net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy servicePeerAllocationStrategy, @NotNull java.util.List<net.corda.testing.node.MockNetworkNotarySpec> notarySpecs, @NotNull NetworkParameters networkParameters)
public MockNetworkParameters(@NotNull java.util.Collection<? extends net.corda.testing.node.TestCordapp> cordappsForAllNodes)
@NotNull public MockNetworkParameters withNetworkParameters(@NotNull NetworkParameters networkParameters)
@NotNull public MockNetworkParameters withNetworkSendManuallyPumped(boolean networkSendManuallyPumped)
@NotNull public MockNetworkParameters withThreadPerNode(boolean threadPerNode)
@NotNull public MockNetworkParameters withServicePeerAllocationStrategy(@NotNull net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy servicePeerAllocationStrategy)
@NotNull public MockNetworkParameters withNotarySpecs(@NotNull java.util.List<net.corda.testing.node.MockNetworkNotarySpec> notarySpecs)
@NotNull public MockNetworkParameters withCordappsForAllNodes(@NotNull java.util.Collection<? extends net.corda.testing.node.TestCordapp> cordappsForAllNodes)
@NotNull public MockNetworkParameters copy(boolean networkSendManuallyPumped, boolean threadPerNode, @NotNull net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy servicePeerAllocationStrategy, @NotNull java.util.List<net.corda.testing.node.MockNetworkNotarySpec> notarySpecs, @NotNull NetworkParameters networkParameters)
public boolean getNetworkSendManuallyPumped()
If false then messages will not be routed from sender to receiver until you use
the MockNetwork.runNetwork
method. This is useful for writing single-threaded unit test code that can examine thestate of the mock network before and after a message is sent, without races and without the receiving node immediatelysending a response. The default is false, so you must call runNetwork.
MockNetwork.runNetwork
public boolean getThreadPerNode()
If true then each node will be run in its own thread.
This can result in race conditions inyour code if not carefully written, but is more realistic and may help if you have flows in your app that do longblocking operations. The default is false.
@NotNull public net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy getServicePeerAllocationStrategy()
How messages are load balanced in the case where a single compound identity
is used by multiple nodes. You rarely if ever need to change that, it's primarily of interest to people testingnotary code.
@NotNull public java.util.List<net.corda.testing.node.MockNetworkNotarySpec> getNotarySpecs()
The notaries to use in the mock network.
By default you get one mock notary and that is usually sufficient.
@NotNull public NetworkParameters getNetworkParameters()
The network parameters to be used by all the nodes.
NetworkParameters.notaries must beempty as notaries are defined by notarySpecs.
@NotNull public java.util.Collection<net.corda.testing.node.TestCordapp> getCordappsForAllNodes()
s added to all nodes.
class TestCordapp
public boolean component1()
If false then messages will not be routed from sender to receiver until you use
the MockNetwork.runNetwork
method. This is useful for writing single-threaded unit test code that can examine thestate of the mock network before and after a message is sent, without races and without the receiving node immediatelysending a response. The default is false, so you must call runNetwork.
MockNetwork.runNetwork
public boolean component2()
If true then each node will be run in its own thread.
This can result in race conditions inyour code if not carefully written, but is more realistic and may help if you have flows in your app that do longblocking operations. The default is false.
@NotNull public net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy component3()
How messages are load balanced in the case where a single compound identity
is used by multiple nodes. You rarely if ever need to change that, it's primarily of interest to people testingnotary code.
@NotNull public java.util.List<net.corda.testing.node.MockNetworkNotarySpec> component4()
The notaries to use in the mock network.
By default you get one mock notary and that is usually sufficient.
@NotNull public NetworkParameters component5()
The network parameters to be used by all the nodes.
NetworkParameters.notaries must beempty as notaries are defined by notarySpecs.
@NotNull public java.util.Collection<net.corda.testing.node.TestCordapp> component6()
s added to all nodes.
class TestCordapp
@NotNull public MockNetworkParameters copy(boolean networkSendManuallyPumped, boolean threadPerNode, @NotNull net.corda.testing.node.InMemoryMessagingNetwork.ServicePeerAllocationStrategy servicePeerAllocationStrategy, @NotNull java.util.List<net.corda.testing.node.MockNetworkNotarySpec> notarySpecs, @NotNull NetworkParameters networkParameters, @NotNull java.util.Collection<? extends net.corda.testing.node.TestCordapp> cordappsForAllNodes)
Immutable builder for configuring a class MockNetwork
.
class MockNetwork
@NotNull public java.lang.String toString()
Immutable builder for configuring a class MockNetwork
.
class MockNetwork
public int hashCode()
Immutable builder for configuring a class MockNetwork
.
class MockNetwork
public boolean equals(@Nullable java.lang.Object p)
Immutable builder for configuring a class MockNetwork
.
class MockNetwork