From 0a611afa55060fd19f53e059c410c6a6faad6b5f Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Mon, 24 Sep 2018 15:00:31 +0100 Subject: [PATCH] Various clean ups of the docs example code (#3982) * Consistent separation of Java and Kotlin sources via package names only * Renamed the Kotlin tutorial files to match the class names * Added Java example of LaunchSpaceshipFlow --- docs/source/api-flows.rst | 86 ++++++----- docs/source/api-persistence.rst | 4 +- docs/source/api-testing.rst | 32 ++-- docs/source/api-transactions.rst | 140 +++++++++--------- docs/source/clientrpc.rst | 4 +- .../contributing-flow-state-machines.rst | 6 +- .../docs/TutorialFlowAsyncOperationTest.kt | 2 +- .../java/com/template/TemplateContract.java | 6 +- .../ClientRpcExample.java} | 11 +- .../FlowCookbook.java} | 4 +- .../corda/docs/java/LaunchSpaceshipFlow.java | 133 +++++++++++++++++ .../TutorialFlowStateMachines.java | 1 + .../docs/{ => kotlin}/ClientRpcExample.kt | 6 +- .../docs/{ => kotlin}/ClientRpcTutorial.kt | 2 +- .../docs/{ => kotlin}/CustomVaultQuery.kt | 4 +- .../corda/docs/{ => kotlin}/FlowCookbook.kt | 2 +- .../FxTransactionBuildTutorial.kt | 2 +- .../docs/{ => kotlin}/LaunchSpaceshipFlow.kt | 4 +- .../WorkflowTransactionBuildTutorial.kt | 6 +- .../tutorial/contract/TutorialContract.kt | 2 +- .../TutorialFlowAsyncOperation.kt | 2 +- .../TutorialFlowStateMachines.kt | 4 +- .../tutorial/helloworld/IOUFlow.kt} | 9 +- .../tutorial/helloworld/IOUState.kt} | 2 +- .../tutorial/tearoffs/TutorialTearOffs.kt | 2 +- .../tutorial/twoparty/IOUContract.kt} | 2 +- .../tutorial/twoparty/IOUFlow.kt} | 2 +- .../tutorial/twoparty/IOUFlowResponder.kt} | 6 +- .../tutorial/twoparty/IOUState.kt} | 2 +- .../tutorial/helloworld/templateContract.kt | 20 --- ...ialPaperTest.java => TutorialTestDSL.java} | 2 +- .../net/corda/docs/CustomVaultQueryTest.kt | 1 + .../docs/FxTransactionBuildTutorialTest.kt | 2 + .../WorkflowTransactionBuildTutorialTest.kt | 4 + .../tutorial/testdsl/TutorialTestDSL.kt | 12 +- docs/source/flow-cookbook.rst | 4 +- docs/source/flow-state-machines.rst | 2 +- docs/source/hello-world-flow.rst | 2 +- docs/source/hello-world-state.rst | 2 +- docs/source/serialization.rst | 2 +- docs/source/tut-two-party-contract.rst | 2 +- docs/source/tut-two-party-flow.rst | 6 +- .../source/tutorial-building-transactions.rst | 18 +-- docs/source/tutorial-clientrpc-api.rst | 14 +- docs/source/tutorial-contract.rst | 16 +- docs/source/tutorial-tear-offs.rst | 6 +- docs/source/tutorial-test-dsl.rst | 40 ++--- 47 files changed, 391 insertions(+), 252 deletions(-) rename docs/source/example-code/src/main/java/net/corda/docs/{ClientRpcExampleJava.java => java/ClientRpcExample.java} (75%) rename docs/source/example-code/src/main/java/net/corda/docs/{FlowCookbookJava.java => java/FlowCookbook.java} (99%) create mode 100644 docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/ClientRpcExample.kt (86%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/ClientRpcTutorial.kt (99%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/CustomVaultQuery.kt (98%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/FlowCookbook.kt (99%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/FxTransactionBuildTutorial.kt (99%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/LaunchSpaceshipFlow.kt (96%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/WorkflowTransactionBuildTutorial.kt (98%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/tutorial/contract/TutorialContract.kt (99%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt (95%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/tutorial/flowstatemachines/TutorialFlowStateMachines.kt (95%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/helloworld/flow.kt => kotlin/tutorial/helloworld/IOUFlow.kt} (88%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/helloworld/state.kt => kotlin/tutorial/helloworld/IOUState.kt} (84%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{ => kotlin}/tutorial/tearoffs/TutorialTearOffs.kt (96%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/twoparty/contract.kt => kotlin/tutorial/twoparty/IOUContract.kt} (95%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/twoparty/flow.kt => kotlin/tutorial/twoparty/IOUFlow.kt} (97%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/twoparty/flowResponder.kt => kotlin/tutorial/twoparty/IOUFlowResponder.kt} (85%) rename docs/source/example-code/src/main/kotlin/net/corda/docs/{tutorial/twoparty/state.kt => kotlin/tutorial/twoparty/IOUState.kt} (84%) delete mode 100644 docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt rename docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/{CommercialPaperTest.java => TutorialTestDSL.java} (99%) rename docs/source/example-code/src/test/kotlin/net/corda/docs/{ => kotlin}/tutorial/testdsl/TutorialTestDSL.kt (97%) diff --git a/docs/source/api-flows.rst b/docs/source/api-flows.rst index 5e15223144..d001529ecd 100644 --- a/docs/source/api-flows.rst +++ b/docs/source/api-flows.rst @@ -219,13 +219,13 @@ There are several ways to retrieve a notary from the network map: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 01 :end-before: DOCEND 01 @@ -237,13 +237,13 @@ We can also use the network map to retrieve a specific counterparty: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 02 :end-before: DOCEND 02 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 02 :end-before: DOCEND 02 @@ -281,13 +281,13 @@ InitiateFlow .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART initiateFlow :end-before: DOCEND initiateFlow :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART initiateFlow :end-before: DOCEND initiateFlow @@ -306,13 +306,13 @@ Once we have a ``FlowSession`` object we can send arbitrary data to a counterpar .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 04 :end-before: DOCEND 04 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 04 :end-before: DOCEND 04 @@ -338,13 +338,13 @@ be what it appears to be! We must unwrap the ``UntrustworthyData`` using a lambd .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 05 :end-before: DOCEND 05 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 05 :end-before: DOCEND 05 @@ -355,13 +355,13 @@ as it likes, and each party can invoke a different response flow: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 06 :end-before: DOCEND 06 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 06 :end-before: DOCEND 06 @@ -380,13 +380,13 @@ type of data sent doesn't need to match the type of the data received back: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 07 :end-before: DOCEND 07 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 07 :end-before: DOCEND 07 @@ -405,13 +405,13 @@ Our side of the flow must mirror these calls. We could do this as follows: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 08 :end-before: DOCEND 08 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 08 :end-before: DOCEND 08 @@ -431,11 +431,16 @@ Consider the following contrived example using the old ``Party`` based API: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/LaunchSpaceshipFlow.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/LaunchSpaceshipFlow.kt :language: kotlin :start-after: DOCSTART LaunchSpaceshipFlow :end-before: DOCEND LaunchSpaceshipFlow + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java + :language: java + :start-after: DOCSTART LaunchSpaceshipFlow + :end-before: DOCEND LaunchSpaceshipFlow + The intention of the flows is very clear: LaunchSpaceshipFlow asks the president whether a spaceship should be launched. It is expecting a boolean reply. The president in return first tells the secretary that they need coffee, which is also communicated with a boolean. Afterwards the president replies to the launcher that they don't want to launch. @@ -452,11 +457,16 @@ of flows would look like this: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/LaunchSpaceshipFlow.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/LaunchSpaceshipFlow.kt :language: kotlin :start-after: DOCSTART LaunchSpaceshipFlowCorrect :end-before: DOCEND LaunchSpaceshipFlowCorrect + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java + :language: java + :start-after: DOCSTART LaunchSpaceshipFlowCorrect + :end-before: DOCEND LaunchSpaceshipFlowCorrect + Note how the president is now explicit about which session it wants to send to. Porting from the old Party-based API @@ -467,13 +477,13 @@ explicit in the ``initiateFlow`` function call. To port existing code: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART FlowSession porting :end-before: DOCEND FlowSession porting :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART FlowSession porting :end-before: DOCEND FlowSession porting @@ -550,13 +560,13 @@ the transaction's states: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 09 :end-before: DOCEND 09 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 09 :end-before: DOCEND 09 @@ -566,13 +576,13 @@ We can also choose to send the transaction to additional parties who aren't one .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 10 :end-before: DOCEND 10 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 10 :end-before: DOCEND 10 @@ -601,13 +611,13 @@ transaction ourselves, we can automatically gather the signatures of the other r .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 15 :end-before: DOCEND 15 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 15 :end-before: DOCEND 15 @@ -618,13 +628,13 @@ transaction (by implementing the ``checkTransaction`` method) and provide their .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 16 :end-before: DOCEND 16 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 16 :end-before: DOCEND 16 @@ -647,13 +657,13 @@ transaction data vending requests as the receiver walks the dependency chain usi .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 12 :end-before: DOCEND 12 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 12 :end-before: DOCEND 12 @@ -664,13 +674,13 @@ dependencies and verify the transaction: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 13 :end-before: DOCEND 13 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 13 :end-before: DOCEND 13 @@ -680,13 +690,13 @@ We can also send and receive a ``StateAndRef`` dependency chain and automaticall .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 14 :end-before: DOCEND 14 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 14 :end-before: DOCEND 14 @@ -738,13 +748,13 @@ To provide a progress tracker, we have to override ``FlowLogic.progressTracker`` .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 17 :end-before: DOCEND 17 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 17 :end-before: DOCEND 17 @@ -754,13 +764,13 @@ We then update the progress tracker's current step as we progress through the fl .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 18 :end-before: DOCEND 18 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 18 :end-before: DOCEND 18 diff --git a/docs/source/api-persistence.rst b/docs/source/api-persistence.rst index 67d1bd2767..8fabd37e17 100644 --- a/docs/source/api-persistence.rst +++ b/docs/source/api-persistence.rst @@ -136,14 +136,14 @@ JDBC session's can be used in Flows and Service Plugins (see ":doc:`flow-state-m The following example illustrates the creation of a custom corda service using a jdbcSession: -.. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt +.. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/CustomVaultQuery.kt :language: kotlin :start-after: DOCSTART CustomVaultQuery :end-before: DOCEND CustomVaultQuery which is then referenced within a custom flow: -.. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt +.. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/CustomVaultQuery.kt :language: kotlin :start-after: DOCSTART TopupIssuer :end-before: DOCEND TopupIssuer diff --git a/docs/source/api-testing.rst b/docs/source/api-testing.rst index 78bf5e828f..80b8134827 100644 --- a/docs/source/api-testing.rst +++ b/docs/source/api-testing.rst @@ -315,13 +315,13 @@ You can create dummy identities to use in test transactions using the ``TestIden .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/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 + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 14 :end-before: DOCEND 14 @@ -368,13 +368,13 @@ construct and check transactions. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 11 :end-before: DOCEND 11 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 11 :end-before: DOCEND 11 @@ -388,13 +388,13 @@ for you, using all the given identities. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 12 :end-before: DOCEND 12 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 12 :end-before: DOCEND 12 @@ -411,13 +411,13 @@ transaction has been executed, and any ``attachments``, as shown in this example .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 13 :end-before: DOCEND 13 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 13 :end-before: DOCEND 13 @@ -434,13 +434,13 @@ verifying the message, there is also a ``fails`` method. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 4 :end-before: DOCEND 4 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 4 :end-before: DOCEND 4 @@ -459,13 +459,13 @@ add the relevant output state and check that the contract verifies successfully, .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 5 :end-before: DOCEND 5 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 5 :end-before: DOCEND 5 @@ -476,13 +476,13 @@ and then return to the original, unmodified transaction. As in the following exa .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 7 :end-before: DOCEND 7 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 7 :end-before: DOCEND 7 @@ -500,13 +500,13 @@ be verified separately by placing a ``verifies`` or ``fails`` statement within .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 9 :end-before: DOCEND 9 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 9 :end-before: DOCEND 9 diff --git a/docs/source/api-transactions.rst b/docs/source/api-transactions.rst index 0dfd5863a9..3c286cc831 100644 --- a/docs/source/api-transactions.rst +++ b/docs/source/api-transactions.rst @@ -56,13 +56,13 @@ An input state is added to a transaction as a ``StateAndRef``, which combines: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 21 :end-before: DOCEND 21 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 21 :end-before: DOCEND 21 @@ -75,13 +75,13 @@ A ``StateRef`` uniquely identifies an input state, allowing the notary to mark i .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 20 :end-before: DOCEND 20 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 20 :end-before: DOCEND 20 @@ -111,13 +111,13 @@ obtained from a ``StateAndRef`` by calling the ``StateAndRef.referenced()`` meth .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 55 :end-before: DOCEND 55 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 55 :end-before: DOCEND 55 @@ -146,13 +146,13 @@ add them to the transaction directly: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 22 :end-before: DOCEND 22 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 22 :end-before: DOCEND 22 @@ -163,13 +163,13 @@ it on the input state: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 23 :end-before: DOCEND 23 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 23 :end-before: DOCEND 23 @@ -183,13 +183,13 @@ wrapping the output state in a ``StateAndContract``, which combines: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 47 :end-before: DOCEND 47 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 47 :end-before: DOCEND 47 @@ -204,13 +204,13 @@ A command is added to the transaction as a ``Command``, which combines: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 24 :end-before: DOCEND 24 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 24 :end-before: DOCEND 24 @@ -222,13 +222,13 @@ Attachments are identified by their hash: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 25 :end-before: DOCEND 25 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 25 :end-before: DOCEND 25 @@ -243,13 +243,13 @@ time, or be open at either end: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 26 :end-before: DOCEND 26 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 26 :end-before: DOCEND 26 @@ -259,13 +259,13 @@ We can also define a time window as an ``Instant`` plus/minus a time tolerance ( .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 42 :end-before: DOCEND 42 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 42 :end-before: DOCEND 42 @@ -275,13 +275,13 @@ Or as a start-time plus a duration: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 43 :end-before: DOCEND 43 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 43 :end-before: DOCEND 43 @@ -299,13 +299,13 @@ that will notarise the inputs and verify the time-window: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 19 :end-before: DOCEND 19 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 19 :end-before: DOCEND 19 @@ -318,13 +318,13 @@ instantiated without one: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 46 :end-before: DOCEND 46 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 46 :end-before: DOCEND 46 @@ -362,13 +362,13 @@ Here's an example usage of ``TransactionBuilder.withItems``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 27 :end-before: DOCEND 27 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 27 :end-before: DOCEND 27 @@ -380,13 +380,13 @@ Here are the methods for adding inputs and attachments: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 28 :end-before: DOCEND 28 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 28 :end-before: DOCEND 28 @@ -396,13 +396,13 @@ An output state can be added as a ``ContractState``, contract class name and not .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 49 :end-before: DOCEND 49 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 49 :end-before: DOCEND 49 @@ -412,13 +412,13 @@ We can also leave the notary field blank, in which case the transaction's defaul .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 50 :end-before: DOCEND 50 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 50 :end-before: DOCEND 50 @@ -428,13 +428,13 @@ Or we can add the output state as a ``TransactionState``, which already specifie .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 51 :end-before: DOCEND 51 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 51 :end-before: DOCEND 51 @@ -444,13 +444,13 @@ Commands can be added as a ``Command``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 52 :end-before: DOCEND 52 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 52 :end-before: DOCEND 52 @@ -460,13 +460,13 @@ Or as ``CommandData`` and a ``vararg PublicKey``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 53 :end-before: DOCEND 53 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 53 :end-before: DOCEND 53 @@ -476,13 +476,13 @@ For the time-window, we can set a time-window directly: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 44 :end-before: DOCEND 44 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 44 :end-before: DOCEND 44 @@ -492,13 +492,13 @@ Or define the time-window as a time plus a duration (e.g. 45 seconds): .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 45 :end-before: DOCEND 45 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 45 :end-before: DOCEND 45 @@ -512,13 +512,13 @@ We can either sign with our legal identity key: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 29 :end-before: DOCEND 29 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 29 :end-before: DOCEND 29 @@ -528,13 +528,13 @@ Or we can also choose to use another one of our public keys: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 30 :end-before: DOCEND 30 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 30 :end-before: DOCEND 30 @@ -572,13 +572,13 @@ and output states: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 33 :end-before: DOCEND 33 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 33 :end-before: DOCEND 33 @@ -597,13 +597,13 @@ We achieve this by using the ``ServiceHub`` to convert the ``SignedTransaction`` .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 32 :end-before: DOCEND 32 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 32 :end-before: DOCEND 32 @@ -613,13 +613,13 @@ We can now perform our additional verification. Here's a simple example: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 34 :end-before: DOCEND 34 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 34 :end-before: DOCEND 34 @@ -634,13 +634,13 @@ We can verify that all the transaction's required signatures are present and val .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 35 :end-before: DOCEND 35 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 35 :end-before: DOCEND 35 @@ -652,13 +652,13 @@ which the signatures are allowed to be missing: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 36 :end-before: DOCEND 36 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 36 :end-before: DOCEND 36 @@ -669,13 +669,13 @@ public keys for which the signatures are allowed to be missing: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 54 :end-before: DOCEND 54 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 54 :end-before: DOCEND 54 @@ -689,13 +689,13 @@ We can also choose to simply verify the signatures that are present: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 37 :end-before: DOCEND 37 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 37 :end-before: DOCEND 37 @@ -713,13 +713,13 @@ We can sign using our legal identity key, as follows: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 38 :end-before: DOCEND 38 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 38 :end-before: DOCEND 38 @@ -729,13 +729,13 @@ Or we can choose to sign using another one of our public keys: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 39 :end-before: DOCEND 39 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 39 :end-before: DOCEND 39 @@ -747,13 +747,13 @@ We can do this with our legal identity key: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 40 :end-before: DOCEND 40 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 40 :end-before: DOCEND 40 @@ -763,13 +763,13 @@ Or using another one of our public keys: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin :start-after: DOCSTART 41 :end-before: DOCEND 41 :dedent: 8 - .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: ../../docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java :start-after: DOCSTART 41 :end-before: DOCEND 41 diff --git a/docs/source/clientrpc.rst b/docs/source/clientrpc.rst index 2fce17ab7a..7390f69a55 100644 --- a/docs/source/clientrpc.rst +++ b/docs/source/clientrpc.rst @@ -31,12 +31,12 @@ Here is an example of using `CordaRPCClient`_ to connect to a node and log the c .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcExample.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcExample.kt :language: kotlin :start-after: START 1 :end-before: END 1 - .. literalinclude:: example-code/src/main/java/net/corda/docs/ClientRpcExampleJava.java + .. literalinclude:: example-code/src/main/java/net/corda/docs/java/ClientRpcExample.java :language: java :start-after: START 1 :end-before: END 1 diff --git a/docs/source/contributing-flow-state-machines.rst b/docs/source/contributing-flow-state-machines.rst index 7f5a9a37c8..c1736288a5 100644 --- a/docs/source/contributing-flow-state-machines.rst +++ b/docs/source/contributing-flow-state-machines.rst @@ -28,7 +28,7 @@ implement ``FlowAsyncOperation``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt :language: kotlin :start-after: DOCSTART SummingOperation :end-before: DOCEND SummingOperation @@ -62,7 +62,7 @@ flow: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt :language: kotlin :start-after: DOCSTART ExampleSummingFlow :end-before: DOCEND ExampleSummingFlow @@ -104,7 +104,7 @@ Let's assume we made a mistake in our summing operation: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt :language: kotlin :start-after: DOCSTART SummingOperationThrowing :end-before: DOCEND SummingOperationThrowing diff --git a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/TutorialFlowAsyncOperationTest.kt b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/TutorialFlowAsyncOperationTest.kt index fb3717f109..251c9d8029 100644 --- a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/TutorialFlowAsyncOperationTest.kt +++ b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/TutorialFlowAsyncOperationTest.kt @@ -3,7 +3,7 @@ package net.corda.docs import net.corda.client.rpc.CordaRPCClient import net.corda.core.messaging.startFlow import net.corda.core.utilities.getOrThrow -import net.corda.docs.tutorial.flowstatemachines.ExampleSummingFlow +import net.corda.docs.kotlin.tutorial.flowstatemachines.ExampleSummingFlow import net.corda.node.services.Permissions import net.corda.testing.core.ALICE_NAME import net.corda.testing.driver.DriverParameters diff --git a/docs/source/example-code/src/main/java/com/template/TemplateContract.java b/docs/source/example-code/src/main/java/com/template/TemplateContract.java index 5c4278a408..e77823a71a 100644 --- a/docs/source/example-code/src/main/java/com/template/TemplateContract.java +++ b/docs/source/example-code/src/main/java/com/template/TemplateContract.java @@ -1,8 +1,10 @@ +// We purposefully have this template here as part of progressing through the tutorial package com.template; import net.corda.core.contracts.CommandData; import net.corda.core.contracts.Contract; import net.corda.core.transactions.LedgerTransaction; +import org.jetbrains.annotations.NotNull; public class TemplateContract implements Contract { // This is used to identify our contract when building a transaction. @@ -13,9 +15,9 @@ public class TemplateContract implements Contract { * and output states does not throw an exception. */ @Override - public void verify(LedgerTransaction tx) {} + public void verify(@NotNull LedgerTransaction tx) {} public interface Commands extends CommandData { class Action implements Commands {} } -} \ No newline at end of file +} diff --git a/docs/source/example-code/src/main/java/net/corda/docs/ClientRpcExampleJava.java b/docs/source/example-code/src/main/java/net/corda/docs/java/ClientRpcExample.java similarity index 75% rename from docs/source/example-code/src/main/java/net/corda/docs/ClientRpcExampleJava.java rename to docs/source/example-code/src/main/java/net/corda/docs/java/ClientRpcExample.java index 2a7bdb4d9b..224dbccf45 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/ClientRpcExampleJava.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/ClientRpcExample.java @@ -1,20 +1,17 @@ -package net.corda.docs; +package net.corda.docs.java; // START 1 import net.corda.client.rpc.CordaRPCClient; import net.corda.client.rpc.CordaRPCConnection; import net.corda.core.messaging.CordaRPCOps; import net.corda.core.utilities.NetworkHostAndPort; -import org.apache.activemq.artemis.api.core.ActiveMQException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.concurrent.ExecutionException; +class ClientRpcExample { + private static final Logger logger = LoggerFactory.getLogger(ClientRpcExample.class); -class ExampleRpcClientJava { - private static final Logger logger = LoggerFactory.getLogger(ExampleRpcClient.class); - - public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException { + public static void main(String[] args) { if (args.length != 3) { throw new IllegalArgumentException("Usage: TemplateClient "); } diff --git a/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java b/docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java similarity index 99% rename from docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java rename to docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java index 997e642105..b8cb3a439b 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/FlowCookbookJava.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/FlowCookbook.java @@ -1,4 +1,4 @@ -package net.corda.docs; +package net.corda.docs.java; import co.paralleluniverse.fibers.Suspendable; import com.google.common.collect.ImmutableList; @@ -37,7 +37,7 @@ import static net.corda.core.contracts.ContractsDSL.requireThat; import static net.corda.core.crypto.Crypto.generateKeyPair; @SuppressWarnings("unused") -public class FlowCookbookJava { +public class FlowCookbook { // ``InitiatorFlow`` is our first flow, and will communicate with // ``ResponderFlow``, below. // We mark ``InitiatorFlow`` as an ``InitiatingFlow``, allowing it to be diff --git a/docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java b/docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java new file mode 100644 index 0000000000..9ef0d72864 --- /dev/null +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/LaunchSpaceshipFlow.java @@ -0,0 +1,133 @@ +package net.corda.docs.java; + +import co.paralleluniverse.fibers.Suspendable; +import net.corda.core.flows.*; +import net.corda.core.identity.Party; + +@SuppressWarnings("ALL") +// DOCSTART LaunchSpaceshipFlow +@InitiatingFlow +class LaunchSpaceshipFlow extends FlowLogic { + @Suspendable + @Override + public Void call() throws FlowException { + boolean shouldLaunchSpaceship = receive(Boolean.class, getPresident()).unwrap(s -> s); + if (shouldLaunchSpaceship) { + launchSpaceship(); + } + return null; + } + + public void launchSpaceship() { + } + + public Party getPresident() { + throw new AbstractMethodError(); + } +} + +@InitiatedBy(LaunchSpaceshipFlow.class) +@InitiatingFlow +class PresidentSpaceshipFlow extends FlowLogic { + private final Party launcher; + + public PresidentSpaceshipFlow(Party launcher) { + this.launcher = launcher; + } + + @Suspendable + @Override + public Void call() { + boolean needCoffee = true; + send(getSecretary(), needCoffee); + boolean shouldLaunchSpaceship = false; + send(launcher, shouldLaunchSpaceship); + return null; + } + + public Party getSecretary() { + throw new AbstractMethodError(); + } +} + +@InitiatedBy(PresidentSpaceshipFlow.class) +class SecretaryFlow extends FlowLogic { + private final Party president; + + public SecretaryFlow(Party president) { + this.president = president; + } + + @Suspendable + @Override + public Void call() { + // ignore + return null; + } +} +// DOCEND LaunchSpaceshipFlow + +@SuppressWarnings("ALL") +// DOCSTART LaunchSpaceshipFlowCorrect +@InitiatingFlow +class LaunchSpaceshipFlowCorrect extends FlowLogic { + @Suspendable + @Override + public Void call() throws FlowException { + FlowSession presidentSession = initiateFlow(getPresident()); + boolean shouldLaunchSpaceship = presidentSession.receive(Boolean.class).unwrap(s -> s); + if (shouldLaunchSpaceship) { + launchSpaceship(); + } + return null; + } + + public void launchSpaceship() { + } + + public Party getPresident() { + throw new AbstractMethodError(); + } +} + +@InitiatedBy(LaunchSpaceshipFlowCorrect.class) +@InitiatingFlow +class PresidentSpaceshipFlowCorrect extends FlowLogic { + private final FlowSession launcherSession; + + public PresidentSpaceshipFlowCorrect(FlowSession launcherSession) { + this.launcherSession = launcherSession; + } + + @Suspendable + @Override + public Void call() { + boolean needCoffee = true; + FlowSession secretarySession = initiateFlow(getSecretary()); + secretarySession.send(needCoffee); + boolean shouldLaunchSpaceship = false; + launcherSession.send(shouldLaunchSpaceship); + return null; + } + + public Party getSecretary() { + throw new AbstractMethodError(); + } +} + +@InitiatedBy(PresidentSpaceshipFlowCorrect.class) +class SecretaryFlowCorrect extends FlowLogic { + private final FlowSession presidentSession; + + public SecretaryFlowCorrect(FlowSession presidentSession) { + this.presidentSession = presidentSession; + } + + @Suspendable + @Override + public Void call() { + // ignore + return null; + } +} +// DOCEND LaunchSpaceshipFlowCorrect diff --git a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/flowstatemachines/TutorialFlowStateMachines.java b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/flowstatemachines/TutorialFlowStateMachines.java index ac7f387ee7..468a0c5711 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/flowstatemachines/TutorialFlowStateMachines.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/flowstatemachines/TutorialFlowStateMachines.java @@ -4,6 +4,7 @@ import net.corda.core.flows.SignTransactionFlow; import net.corda.core.utilities.ProgressTracker; import org.jetbrains.annotations.Nullable; +@SuppressWarnings("ALL") public class TutorialFlowStateMachines { // DOCSTART 1 private final ProgressTracker progressTracker = new ProgressTracker( diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcExample.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcExample.kt similarity index 86% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcExample.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcExample.kt index e41eb2ed18..14c7c599b4 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcExample.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcExample.kt @@ -1,6 +1,6 @@ @file:Suppress("unused") -package net.corda.docs +package net.corda.docs.kotlin // START 1 import net.corda.client.rpc.CordaRPCClient @@ -8,9 +8,9 @@ import net.corda.core.utilities.NetworkHostAndPort.Companion.parse import net.corda.core.utilities.loggerFor import org.slf4j.Logger -class ExampleRpcClient { +class ClientRpcExample { companion object { - val logger: Logger = loggerFor() + val logger: Logger = loggerFor() } fun main(args: Array) { diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt similarity index 99% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt index 093b4bc8d0..dd0ea14b4f 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt @@ -1,6 +1,6 @@ @file:Suppress("unused") -package net.corda.docs +package net.corda.docs.kotlin import net.corda.client.rpc.CordaRPCClient import net.corda.core.contracts.Amount diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/CustomVaultQuery.kt similarity index 98% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/CustomVaultQuery.kt index 5a4a1c04d7..c89997f25a 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/CustomVaultQuery.kt @@ -1,4 +1,6 @@ -package net.corda.docs +@file:Suppress("unused", "MemberVisibilityCanBePrivate") + +package net.corda.docs.kotlin import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.Amount diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt similarity index 99% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt index 077defee10..31135dc6c7 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt @@ -1,6 +1,6 @@ @file:Suppress("UNUSED_VARIABLE", "unused", "DEPRECATION") -package net.corda.docs +package net.corda.docs.kotlin import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.* diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt similarity index 99% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt index 964715bea5..052b4ddf21 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt @@ -1,4 +1,4 @@ -package net.corda.docs +package net.corda.docs.kotlin import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.* diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/LaunchSpaceshipFlow.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/LaunchSpaceshipFlow.kt similarity index 96% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/LaunchSpaceshipFlow.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/LaunchSpaceshipFlow.kt index 8e94e82b32..c5b7f3a637 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/LaunchSpaceshipFlow.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/LaunchSpaceshipFlow.kt @@ -1,6 +1,6 @@ -@file:Suppress("DEPRECATION") +@file:Suppress("DEPRECATION", "MemberVisibilityCanBePrivate", "unused") -package net.corda.docs +package net.corda.docs.kotlin import co.paralleluniverse.fibers.Suspendable import net.corda.core.flows.FlowLogic diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt similarity index 98% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt index 34e46f5ba3..b2b34841f5 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt @@ -1,4 +1,6 @@ -package net.corda.docs +@file:Suppress("unused") + +package net.corda.docs.kotlin import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.* @@ -23,7 +25,7 @@ enum class WorkflowState { REJECTED } -const val TRADE_APPROVAL_PROGRAM_ID = "net.corda.docs.TradeApprovalContract" +const val TRADE_APPROVAL_PROGRAM_ID = "net.corda.docs.kotlin.TradeApprovalContract" /** * Minimal contract to encode a simple workflow with one initial state and two possible eventual states. diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt similarity index 99% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt index 78946fbd67..39c9be245f 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.contract +package net.corda.docs.kotlin.tutorial.contract import net.corda.core.contracts.* import net.corda.core.crypto.NullKeys diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt similarity index 95% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt index 8619361485..dfbf8c158d 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowAsyncOperation.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.flowstatemachines +package net.corda.docs.kotlin.tutorial.flowstatemachines import co.paralleluniverse.fibers.Suspendable import net.corda.core.concurrent.CordaFuture diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowStateMachines.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowStateMachines.kt similarity index 95% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowStateMachines.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowStateMachines.kt index 0131077a8f..23c0e12dc9 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowStateMachines.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowStateMachines.kt @@ -1,4 +1,6 @@ -package net.corda.docs.tutorial.flowstatemachines +@file:Suppress("unused", "MemberVisibilityCanBePrivate") + +package net.corda.docs.kotlin.tutorial.flowstatemachines import co.paralleluniverse.fibers.Suspendable import net.corda.core.contracts.Amount diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/flow.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUFlow.kt similarity index 88% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/flow.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUFlow.kt index 676af37f4c..9c92571ce3 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/flow.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUFlow.kt @@ -1,6 +1,9 @@ -package net.corda.docs.tutorial.helloworld +@file:Suppress("MemberVisibilityCanBePrivate") + +package net.corda.docs.kotlin.tutorial.helloworld import co.paralleluniverse.fibers.Suspendable +import com.template.TemplateContract import net.corda.core.flows.FinalityFlow import net.corda.core.flows.FlowLogic import net.corda.core.flows.InitiatingFlow @@ -13,6 +16,8 @@ import net.corda.core.identity.Party import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.ProgressTracker +import com.template.TemplateContract.TEMPLATE_CONTRACT_ID + // Replace TemplateFlow's definition with: @InitiatingFlow @StartableByRPC @@ -44,4 +49,4 @@ class IOUFlow(val iouValue: Int, subFlow(FinalityFlow(signedTx)) } } -// DOCEND 01 \ No newline at end of file +// DOCEND 01 diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/state.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUState.kt similarity index 84% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/state.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUState.kt index 19f431bfb1..f79e3311cd 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/state.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUState.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.helloworld +package net.corda.docs.kotlin.tutorial.helloworld import net.corda.core.contracts.ContractState diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt similarity index 96% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt index d4f67c02a0..82ee763780 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt @@ -1,6 +1,6 @@ @file:Suppress("UNUSED_VARIABLE") -package net.corda.docs.tutorial.tearoffs +package net.corda.docs.kotlin.tutorial.tearoffs import net.corda.core.contracts.Command import net.corda.core.contracts.StateRef diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/contract.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUContract.kt similarity index 95% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/contract.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUContract.kt index 66def91a3f..2f55ff6441 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/contract.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUContract.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.twoparty +package net.corda.docs.kotlin.tutorial.twoparty import net.corda.core.contracts.CommandData import net.corda.core.contracts.Contract diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flow.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlow.kt similarity index 97% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flow.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlow.kt index 546ac2fb39..22714acd33 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flow.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlow.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.twoparty +package net.corda.docs.kotlin.tutorial.twoparty // DOCSTART 01 import co.paralleluniverse.fibers.Suspendable diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flowResponder.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlowResponder.kt similarity index 85% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flowResponder.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlowResponder.kt index f2ff5ecdc9..45e792abe0 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flowResponder.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlowResponder.kt @@ -1,12 +1,12 @@ -package net.corda.docs.tutorial.twoparty +package net.corda.docs.kotlin.tutorial.twoparty import co.paralleluniverse.fibers.Suspendable import net.corda.core.flows.FlowLogic import net.corda.core.flows.FlowSession import net.corda.core.flows.InitiatedBy import net.corda.core.flows.SignTransactionFlow -import net.corda.docs.tutorial.helloworld.IOUFlow -import net.corda.docs.tutorial.helloworld.IOUState +import net.corda.docs.kotlin.tutorial.helloworld.IOUFlow +import net.corda.docs.kotlin.tutorial.helloworld.IOUState // DOCSTART 01 // Add these imports: diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/state.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUState.kt similarity index 84% rename from docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/state.kt rename to docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUState.kt index a690625d65..b1a631d025 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/state.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUState.kt @@ -1,4 +1,4 @@ -package net.corda.docs.tutorial.twoparty +package net.corda.docs.kotlin.tutorial.twoparty import net.corda.core.contracts.ContractState import net.corda.core.identity.Party diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt deleted file mode 100644 index 14a6746eeb..0000000000 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt +++ /dev/null @@ -1,20 +0,0 @@ -package net.corda.docs.tutorial.helloworld - -import net.corda.core.contracts.CommandData -import net.corda.core.contracts.Contract -import net.corda.core.transactions.LedgerTransaction - -const val TEMPLATE_CONTRACT_ID = "com.template.TemplateContract" - -open class TemplateContract : Contract { - // A transaction is considered valid if the verify() function of the contract of each of the transaction's input - // and output states does not throw an exception. - override fun verify(tx: LedgerTransaction) { - // Verification logic goes here. - } - - // Used to indicate the transaction's intent. - interface Commands : CommandData { - class Action : Commands - } -} \ No newline at end of file diff --git a/docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java b/docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java similarity index 99% rename from docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java rename to docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java index 07ef61b49e..3f5a91fe83 100644 --- a/docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java +++ b/docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java @@ -25,7 +25,7 @@ import static net.corda.testing.node.MockServicesKt.makeTestIdentityService; import static net.corda.testing.node.NodeTestUtils.ledger; import static net.corda.testing.node.NodeTestUtils.transaction; -public class CommercialPaperTest { +public class TutorialTestDSL { 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")); diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt index d94f374af2..e5a5ec8786 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt @@ -8,6 +8,7 @@ import net.corda.core.node.services.vault.* import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow import net.corda.docs.java.tutorial.helloworld.IOUFlow +import net.corda.docs.kotlin.TopupIssuerFlow import net.corda.finance.* import net.corda.finance.contracts.getCashBalances import net.corda.finance.flows.CashIssueFlow diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt index b27f382ca7..430fc025c8 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt @@ -4,6 +4,8 @@ import net.corda.core.identity.Party import net.corda.core.toFuture import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow +import net.corda.docs.kotlin.ForeignExchangeFlow +import net.corda.docs.kotlin.ForeignExchangeRemoteFlow import net.corda.finance.DOLLARS import net.corda.finance.GBP import net.corda.finance.POUNDS diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/WorkflowTransactionBuildTutorialTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/WorkflowTransactionBuildTutorialTest.kt index 3304f4707a..ccc0793663 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/WorkflowTransactionBuildTutorialTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/WorkflowTransactionBuildTutorialTest.kt @@ -9,6 +9,10 @@ import net.corda.core.node.services.queryBy import net.corda.core.node.services.vault.QueryCriteria import net.corda.core.toFuture import net.corda.core.utilities.getOrThrow +import net.corda.docs.kotlin.SubmitCompletionFlow +import net.corda.docs.kotlin.SubmitTradeApprovalFlow +import net.corda.docs.kotlin.TradeApprovalContract +import net.corda.docs.kotlin.WorkflowState import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.node.MockNetwork diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt similarity index 97% rename from docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt rename to docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt index fc04b31387..4eee343231 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt @@ -1,4 +1,6 @@ -package net.corda.docs.tutorial.testdsl +@file:Suppress("MemberVisibilityCanBePrivate") + +package net.corda.docs.kotlin.tutorial.testdsl import com.nhaarman.mockito_kotlin.doReturn import com.nhaarman.mockito_kotlin.whenever @@ -13,11 +15,7 @@ import net.corda.finance.contracts.CommercialPaper import net.corda.finance.contracts.ICommercialPaperState import net.corda.finance.contracts.asset.CASH import net.corda.finance.contracts.asset.Cash -import net.corda.testing.core.ALICE_NAME -import net.corda.testing.core.BOB_NAME -import net.corda.testing.core.DUMMY_NOTARY_NAME -import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.core.TestIdentity +import net.corda.testing.core.* import net.corda.testing.internal.rigorousMock import net.corda.testing.node.MockServices import net.corda.testing.node.ledger @@ -26,7 +24,7 @@ import org.junit.Rule import org.junit.Test import java.time.Instant -class CommercialPaperTest { +class TutorialTestDSL { private companion object { val alice = TestIdentity(ALICE_NAME, 70) val bob = TestIdentity(BOB_NAME, 80) diff --git a/docs/source/flow-cookbook.rst b/docs/source/flow-cookbook.rst index 1402c2ea1c..695e49f701 100644 --- a/docs/source/flow-cookbook.rst +++ b/docs/source/flow-cookbook.rst @@ -11,8 +11,8 @@ This flow showcases how to use Corda's API, in both Java and Kotlin. .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/FlowCookbook.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/FlowCookbook.kt :language: kotlin - .. literalinclude:: example-code/src/main/java/net/corda/docs/FlowCookbookJava.java + .. literalinclude:: example-code/src/main/java/net/corda/docs/java/FlowCookbook.java :language: java \ No newline at end of file diff --git a/docs/source/flow-state-machines.rst b/docs/source/flow-state-machines.rst index c48481df3c..63de6e6a25 100644 --- a/docs/source/flow-state-machines.rst +++ b/docs/source/flow-state-machines.rst @@ -108,7 +108,7 @@ each side. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/flowstatemachines/TutorialFlowStateMachines.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/flowstatemachines/TutorialFlowStateMachines.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 diff --git a/docs/source/hello-world-flow.rst b/docs/source/hello-world-flow.rst index 42bf242dab..b50ff584ec 100644 --- a/docs/source/hello-world-flow.rst +++ b/docs/source/hello-world-flow.rst @@ -45,7 +45,7 @@ template (``Initiator`` and ``Responder``), and replace them with the following: .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/flow.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUFlow.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 diff --git a/docs/source/hello-world-state.rst b/docs/source/hello-world-state.rst index e4b3e5f488..0a2d9c4b12 100644 --- a/docs/source/hello-world-state.rst +++ b/docs/source/hello-world-state.rst @@ -63,7 +63,7 @@ Let's get started by opening ``TemplateState.java`` (for Java) or ``StatesAndCon .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/state.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/helloworld/IOUState.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 diff --git a/docs/source/serialization.rst b/docs/source/serialization.rst index beb8ba9767..c015eb317e 100644 --- a/docs/source/serialization.rst +++ b/docs/source/serialization.rst @@ -57,7 +57,7 @@ Classes get onto the whitelist via one of three mechanisms: The annotation is the preferred method for whitelisting. An example is shown in :doc:`tutorial-clientrpc-api`. It's reproduced here as an example of both ways you can do this for a couple of example classes. -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 7 :end-before: END 7 diff --git a/docs/source/tut-two-party-contract.rst b/docs/source/tut-two-party-contract.rst index 17e4bc77f2..8a94c75bad 100644 --- a/docs/source/tut-two-party-contract.rst +++ b/docs/source/tut-two-party-contract.rst @@ -81,7 +81,7 @@ Let's write a contract that enforces these constraints. We'll do this by modifyi .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/contract.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUContract.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 diff --git a/docs/source/tut-two-party-flow.rst b/docs/source/tut-two-party-flow.rst index aefa3cfb96..5ed7e5716b 100644 --- a/docs/source/tut-two-party-flow.rst +++ b/docs/source/tut-two-party-flow.rst @@ -21,7 +21,7 @@ In ``IOUFlow.java``/``App.kt``, change the imports block to the following: .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flow.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlow.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 @@ -36,7 +36,7 @@ follows: .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flow.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlow.kt :language: kotlin :start-after: DOCSTART 02 :end-before: DOCEND 02 @@ -89,7 +89,7 @@ to respond, we need to write a response flow as well. In a new ``IOUFlowResponde .. container:: codeset - .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/tutorial/twoparty/flowResponder.kt + .. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/twoparty/IOUFlowResponder.kt :language: kotlin :start-after: DOCSTART 01 :end-before: DOCEND 01 diff --git a/docs/source/tutorial-building-transactions.rst b/docs/source/tutorial-building-transactions.rst index 324cb95ae2..2c5ef076b8 100644 --- a/docs/source/tutorial-building-transactions.rst +++ b/docs/source/tutorial-building-transactions.rst @@ -81,12 +81,12 @@ To give a few more specific details consider two simplified real world scenarios. First, a basic foreign exchange cash transaction. This transaction needs to locate a set of funds to exchange. A flow modelling this is implemented in ``FxTransactionBuildTutorial.kt`` -(see ``docs/source/example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt`` in the +(see ``docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt`` in the `main Corda repo `_). Second, a simple business model in which parties manually accept or reject each other's trade proposals, which is implemented in ``WorkflowTransactionBuildTutorial.kt`` (see -``docs/source/example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt`` in the +``docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt`` in the `main Corda repo `_). To run and explore these examples using the IntelliJ IDE one can run/step through the respective unit tests in ``FxTransactionBuildTutorialTest.kt`` and @@ -111,7 +111,7 @@ here will manually carry out the input queries by specifying relevant query criteria filters to the ``tryLockFungibleStatesForSpending`` method of the ``VaultService``. -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 @@ -148,7 +148,7 @@ parameters to the flow to identify the states being operated upon. Thus code to gather the latest input state for a given ``StateRef`` would use the ``VaultService`` as follows: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 @@ -203,7 +203,7 @@ state. Remember that the result of a successful transaction is always to fully consume/spend the input states, so this is required to conserve the total cash. For example from the demo code: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 2 :end-before: DOCEND 2 @@ -221,13 +221,13 @@ and convert it into a ``SignedTransaction``. Examples of this process are: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 2 :end-before: DOCEND 2 :dedent: 8 -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/FxTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 3 :end-before: DOCEND 3 @@ -260,7 +260,7 @@ context. For example, the flow may need to check that the parties are the right ones, or that the ``Command`` present on the transaction is as expected for this specific flow. An example of this from the demo code is: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 3 :end-before: DOCEND 3 @@ -277,7 +277,7 @@ Once all the signatures are applied to the ``SignedTransaction``, the final steps are notarisation and ensuring that all nodes record the fully-signed transaction. The code for this is standardised in the ``FinalityFlow``: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/WorkflowTransactionBuildTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/WorkflowTransactionBuildTutorial.kt :language: kotlin :start-after: DOCSTART 4 :end-before: DOCEND 4 diff --git a/docs/source/tutorial-clientrpc-api.rst b/docs/source/tutorial-clientrpc-api.rst index 597e8a96f9..ea0c82e214 100644 --- a/docs/source/tutorial-clientrpc-api.rst +++ b/docs/source/tutorial-clientrpc-api.rst @@ -19,7 +19,7 @@ and a Alice node that can issue, move and exit cash. Here's how we configure the node to create a user that has the permissions to start the ``CashIssueFlow``, ``CashPaymentFlow``, and ``CashExitFlow``: -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 1 :end-before: END 1 @@ -27,7 +27,7 @@ Here's how we configure the node to create a user that has the permissions to st Now we can connect to the node itself using a valid RPC user login and start generating transactions in a different thread using ``generateTransactions`` (to be defined later): -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 2 :end-before: END 2 @@ -45,7 +45,7 @@ signature tells us that the RPC operation will return a list of transactions and general pattern, we query some data and the node will return the current snapshot and future updates done to it. Observables are described in further detail in :doc:`clientrpc` -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 3 :end-before: END 3 @@ -56,7 +56,7 @@ The graph will be defined as follows: * Each transaction is a vertex, represented by printing ``NODE `` * Each input-output relationship is an edge, represented by printing ``EDGE `` -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 4 :end-before: END 4 @@ -64,7 +64,7 @@ The graph will be defined as follows: Now we just need to create the transactions themselves! -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 6 :end-before: END 6 @@ -91,7 +91,7 @@ listening on successfully created ones, which are dumped to the console. We just Now let's try to visualise the transaction graph. We will use a graph drawing library called graphstream_. -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 5 :end-before: END 5 @@ -105,7 +105,7 @@ Whitelisting classes from your CorDapp with the Corda node As described in :doc:`clientrpc`, you have to whitelist any additional classes you add that are needed in RPC requests or responses with the Corda node. Here's an example of both ways you can do this for a couple of example classes. -.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +.. literalinclude:: example-code/src/main/kotlin/net/corda/docs/kotlin/ClientRpcTutorial.kt :language: kotlin :start-after: START 7 :end-before: END 7 diff --git a/docs/source/tutorial-contract.rst b/docs/source/tutorial-contract.rst index 7a53e176aa..d47cb643d7 100644 --- a/docs/source/tutorial-contract.rst +++ b/docs/source/tutorial-contract.rst @@ -77,7 +77,7 @@ A state is a class that stores data that is checked by the contract. A commercia .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 @@ -129,7 +129,7 @@ Let's define a few commands now: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 2 :end-before: DOCEND 2 @@ -160,7 +160,7 @@ run two contracts one time each: Cash and CommercialPaper. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 3 :end-before: DOCEND 3 @@ -285,7 +285,7 @@ logic. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 4 :end-before: DOCEND 4 @@ -404,7 +404,7 @@ a method to wrap up the issuance process: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 5 :end-before: DOCEND 5 @@ -430,7 +430,7 @@ defined inside the contract itself .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 8 :end-before: DOCEND 8 @@ -464,7 +464,7 @@ What about moving the paper, i.e. reassigning ownership to someone else? .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 6 :end-before: DOCEND 6 @@ -487,7 +487,7 @@ Finally, we can do redemption. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/contract/TutorialContract.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/contract/TutorialContract.kt :language: kotlin :start-after: DOCSTART 7 :end-before: DOCEND 7 diff --git a/docs/source/tutorial-tear-offs.rst b/docs/source/tutorial-tear-offs.rst index 4370965414..114257017b 100644 --- a/docs/source/tutorial-tear-offs.rst +++ b/docs/source/tutorial-tear-offs.rst @@ -10,7 +10,7 @@ Each field will only be included if the filtering function returns `true` when t .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 @@ -20,7 +20,7 @@ We can now use our filtering function to construct a ``FilteredTransaction``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt :language: kotlin :start-after: DOCSTART 2 :end-before: DOCEND 2 @@ -35,7 +35,7 @@ transaction components is exactly the same. Note that unlike ``WireTransaction`` .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/tearoffs/TutorialTearOffs.kt + .. literalinclude:: ../../docs/source/example-code/src/main/kotlin/net/corda/docs/kotlin/tutorial/tearoffs/TutorialTearOffs.kt :language: kotlin :start-after: DOCSTART 3 :end-before: DOCEND 3 diff --git a/docs/source/tutorial-test-dsl.rst b/docs/source/tutorial-test-dsl.rst index f568ef6a84..d29125d5ae 100644 --- a/docs/source/tutorial-test-dsl.rst +++ b/docs/source/tutorial-test-dsl.rst @@ -55,13 +55,13 @@ We will start with defining helper function that returns a ``CommercialPaper`` s .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 1 :end-before: DOCEND 1 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 1 :end-before: DOCEND 1 @@ -122,13 +122,13 @@ last line of ``transaction``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 2 :end-before: DOCEND 2 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 2 :end-before: DOCEND 2 @@ -138,13 +138,13 @@ Let's take a look at a transaction that fails. .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 3 :end-before: DOCEND 3 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 3 :end-before: DOCEND 3 @@ -167,13 +167,13 @@ However we can specify that this is an intended behaviour by changing ``verifies .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 4 :end-before: DOCEND 4 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 4 :end-before: DOCEND 4 @@ -183,13 +183,13 @@ We can continue to build the transaction until it ``verifies``: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 5 :end-before: DOCEND 5 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 5 :end-before: DOCEND 5 @@ -206,13 +206,13 @@ What should we do if we wanted to test what happens when the wrong party signs t .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 6 :end-before: DOCEND 6 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 6 :end-before: DOCEND 6 @@ -227,13 +227,13 @@ ledger with a single transaction: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 7 :end-before: DOCEND 7 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 7 :end-before: DOCEND 7 @@ -246,13 +246,13 @@ Now that we know how to define a single transaction, let's look at how to define .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 8 :end-before: DOCEND 8 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 8 :end-before: DOCEND 8 @@ -273,13 +273,13 @@ To do so let's create a simple example that uses the same input twice: .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 9 :end-before: DOCEND 9 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 9 :end-before: DOCEND 9 @@ -290,13 +290,13 @@ verification (``fails()`` at the end). As in previous examples we can use ``twea .. container:: codeset - .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/tutorial/testdsl/TutorialTestDSL.kt + .. literalinclude:: ../../docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt :language: kotlin :start-after: DOCSTART 10 :end-before: DOCEND 10 :dedent: 4 - .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/CommercialPaperTest.java + .. literalinclude:: ../../docs/source/example-code/src/test/java/net/corda/docs/java/tutorial/testdsl/TutorialTestDSL.java :language: java :start-after: DOCSTART 10 :end-before: DOCEND 10