mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
Merge pull request #592 from corda/merges/march-21-16-24
Merge from OS/master
This commit is contained in:
commit
ca010f881d
@ -1,13 +1,13 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Explorer - demo nodes (flow triage)" type="JetRunConfigurationType" factoryName="Kotlin" singleton="true">
|
<configuration default="false" name="Explorer - demo nodes (flow triage)" type="JetRunConfigurationType" factoryName="Kotlin" singleton="true">
|
||||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||||
<option name="MAIN_CLASS_NAME" value="net.corda.explorer.MainKt" />
|
|
||||||
<option name="VM_PARAMETERS" value="-DAMQ_DELIVERY_DELAY_MS=15000" />
|
<option name="VM_PARAMETERS" value="-DAMQ_DELIVERY_DELAY_MS=15000" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="-F" />
|
<option name="PROGRAM_PARAMETERS" value="-F" />
|
||||||
<option name="WORKING_DIRECTORY" value="" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
|
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="MAIN_CLASS_NAME" value="net.corda.explorer.MainKt" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="" />
|
||||||
<module name="explorer_main" />
|
<module name="explorer_main" />
|
||||||
<envs />
|
<envs />
|
||||||
<method />
|
<method />
|
||||||
|
@ -304,6 +304,57 @@ Contract testing
|
|||||||
The Corda test framework includes the ability to create a test ledger by calling the ``ledger`` function
|
The Corda test framework includes the ability to create a test ledger by calling the ``ledger`` function
|
||||||
on an implementation of the ``ServiceHub`` interface.
|
on an implementation of the ``ServiceHub`` interface.
|
||||||
|
|
||||||
|
Test identities
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
You can create dummy identities to use in test transactions using the ``TestIdentity`` class:
|
||||||
|
|
||||||
|
.. container:: codeset
|
||||||
|
|
||||||
|
.. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt
|
||||||
|
:language: kotlin
|
||||||
|
:start-after: DOCSTART 14
|
||||||
|
:end-before: DOCEND 14
|
||||||
|
:dedent: 8
|
||||||
|
|
||||||
|
.. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java
|
||||||
|
:language: java
|
||||||
|
:start-after: DOCSTART 14
|
||||||
|
:end-before: DOCEND 14
|
||||||
|
:dedent: 4
|
||||||
|
|
||||||
|
``TestIdentity`` exposes the following fields and methods:
|
||||||
|
|
||||||
|
.. container:: codeset
|
||||||
|
|
||||||
|
.. sourcecode:: kotlin
|
||||||
|
|
||||||
|
val identityParty: Party = bigCorp.party
|
||||||
|
val identityName: CordaX500Name = bigCorp.name
|
||||||
|
val identityPubKey: PublicKey = bigCorp.publicKey
|
||||||
|
val identityKeyPair: KeyPair = bigCorp.keyPair
|
||||||
|
val identityPartyAndCertificate: PartyAndCertificate = bigCorp.identity
|
||||||
|
|
||||||
|
.. sourcecode:: java
|
||||||
|
|
||||||
|
Party identityParty = bigCorp.getParty();
|
||||||
|
CordaX500Name identityName = bigCorp.getName();
|
||||||
|
PublicKey identityPubKey = bigCorp.getPublicKey();
|
||||||
|
KeyPair identityKeyPair = bigCorp.getKeyPair();
|
||||||
|
PartyAndCertificate identityPartyAndCertificate = bigCorp.getIdentity();
|
||||||
|
|
||||||
|
You can also create a unique ``TestIdentity`` using the ``fresh`` method:
|
||||||
|
|
||||||
|
.. container:: codeset
|
||||||
|
|
||||||
|
.. sourcecode:: kotlin
|
||||||
|
|
||||||
|
val uniqueTestIdentity: TestIdentity = TestIdentity.fresh("orgName")
|
||||||
|
|
||||||
|
.. sourcecode:: java
|
||||||
|
|
||||||
|
TestIdentity uniqueTestIdentity = TestIdentity.Companion.fresh("orgName");
|
||||||
|
|
||||||
MockServices
|
MockServices
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
@ -37,7 +37,9 @@ import static net.corda.testing.node.NodeTestUtils.transaction;
|
|||||||
|
|
||||||
public class CommercialPaperTest {
|
public class CommercialPaperTest {
|
||||||
private static final TestIdentity alice = new TestIdentity(ALICE_NAME, 70L);
|
private static final TestIdentity alice = new TestIdentity(ALICE_NAME, 70L);
|
||||||
|
// DOCSTART 14
|
||||||
private static final TestIdentity bigCorp = new TestIdentity(new CordaX500Name("BigCorp", "New York", "GB"));
|
private static final TestIdentity bigCorp = new TestIdentity(new CordaX500Name("BigCorp", "New York", "GB"));
|
||||||
|
// DOCEND 14
|
||||||
private static final TestIdentity bob = new TestIdentity(BOB_NAME, 80L);
|
private static final TestIdentity bob = new TestIdentity(BOB_NAME, 80L);
|
||||||
private static final TestIdentity megaCorp = new TestIdentity(new CordaX500Name("MegaCorp", "London", "GB"));
|
private static final TestIdentity megaCorp = new TestIdentity(new CordaX500Name("MegaCorp", "London", "GB"));
|
||||||
private final byte[] defaultRef = {123};
|
private final byte[] defaultRef = {123};
|
||||||
|
@ -38,7 +38,9 @@ class CommercialPaperTest {
|
|||||||
private companion object {
|
private companion object {
|
||||||
val alice = TestIdentity(ALICE_NAME, 70)
|
val alice = TestIdentity(ALICE_NAME, 70)
|
||||||
val bob = TestIdentity(BOB_NAME, 80)
|
val bob = TestIdentity(BOB_NAME, 80)
|
||||||
|
// DOCSTART 14
|
||||||
val bigCorp = TestIdentity((CordaX500Name("BigCorp", "New York", "GB")))
|
val bigCorp = TestIdentity((CordaX500Name("BigCorp", "New York", "GB")))
|
||||||
|
// DOCEND 14
|
||||||
val dummyNotary = TestIdentity(DUMMY_NOTARY_NAME, 20)
|
val dummyNotary = TestIdentity(DUMMY_NOTARY_NAME, 20)
|
||||||
val megaCorp = TestIdentity(CordaX500Name("MegaCorp", "London", "GB"))
|
val megaCorp = TestIdentity(CordaX500Name("MegaCorp", "London", "GB"))
|
||||||
val TEST_TX_TIME: Instant = Instant.parse("2015-04-17T12:00:00.00Z")
|
val TEST_TX_TIME: Instant = Instant.parse("2015-04-17T12:00:00.00Z")
|
||||||
|
@ -67,7 +67,7 @@ is the major Corda version and ``Y`` is the minor Corda version.
|
|||||||
To use it, create a directory containing a node config file, ending in "_node.conf", for each node you want to create.
|
To use it, create a directory containing a node config file, ending in "_node.conf", for each node you want to create.
|
||||||
Then run the following command:
|
Then run the following command:
|
||||||
|
|
||||||
``java -jar network-bootstrapper.jar <nodes-root-dir>``
|
``java -jar network-bootstrapper-corda-X.Y.jar <nodes-root-dir>``
|
||||||
|
|
||||||
For example running the command on a directory containing these files :
|
For example running the command on a directory containing these files :
|
||||||
|
|
||||||
|
@ -190,6 +190,8 @@ open class Node(configuration: NodeConfiguration,
|
|||||||
)
|
)
|
||||||
rpcServerAddresses?.let {
|
rpcServerAddresses?.let {
|
||||||
rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, rpcServerConfiguration)
|
rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, rpcServerConfiguration)
|
||||||
|
printBasicNodeInfo("RPC connection address", it.primary.toString())
|
||||||
|
printBasicNodeInfo("RPC admin connection address", it.admin.toString())
|
||||||
}
|
}
|
||||||
verifierMessagingClient = when (configuration.verifierType) {
|
verifierMessagingClient = when (configuration.verifierType) {
|
||||||
VerifierType.OutOfProcess -> throw IllegalArgumentException("OutOfProcess verifier not supported") //VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE)
|
VerifierType.OutOfProcess -> throw IllegalArgumentException("OutOfProcess verifier not supported") //VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE)
|
||||||
|
Loading…
Reference in New Issue
Block a user