Add some hooks to StateMachineManager and NodeSchedulerService so that unit tests of flows with scheduled actions can safely test for completion of their test activities. Typically this is done using a while loop whilst there are active fibers, or schedules and then blocking on the ReusuableLatches until the status changes and can be re-evaluated.

Add unit tests of ScheduledFlow running on simulated network.

Just use existing DumyContract in test

DummyContract requires value equality so that assertEquals over states works as expected.

Remove blank line.

Add TODO on waitQuiescent.

Fix minor build error
This commit is contained in:
Matthew Nesbit
2016-12-05 17:33:28 +00:00
parent 41fca0c1eb
commit f63e6cd2a6
10 changed files with 212 additions and 14 deletions

View File

@ -20,10 +20,6 @@ object WorkflowTransactionBuildTutorial {
}
// DOCSTART 1
// Helper method to access the StorageService and expand a StateRef into a StateAndRef
fun <T : ContractState> ServiceHub.toStateAndRef(ref: StateRef): StateAndRef<T> {
return storageService.validatedTransactions.getTransaction(ref.txhash)!!.tx.outRef<T>(ref.index)
}
// Helper method to locate the latest Vault version of a LinearState from a possibly out of date StateRef
inline fun <reified T : LinearState> ServiceHub.latest(ref: StateRef): StateAndRef<T> {