Open erwindl0 opened 8 years ago
Some of this test support is already migrated in PtII and in Triquetrum.
But we need some improvements in integrating both feature-sets.
PtII ModelExecutionAssertion is not applicable now on a model being executed by Triquetrum's WorkflowExecutionService. This is because a model enriched to collect execution statistics and then passed to Triquetrum's service, is internally cloned first. The cloning loses some of the statistics collection stuff (_actorFiringListeners in particular).
To resolve this without breaking Triquetrum service APIs, we could manage the setup of execution statistics inside the execution service, e.g. always when running in DEBUG mode.
The invoking code (e.g. unit tests) can then apply assertions on the model as can be found in the ProcessHandle. E.g. similar to:
ProcessHandle procHandle = processingService.start(StartMode.DEBUG, model, null, null, null);
processingService.waitUntilFinished(procHandle, 10, TimeUnit.MINUTES);
new ModelExecutionAssertion()
.expectActorIterationCount(..., 1L)
.expectMsgReceiptCount(..., 1L)
.expectMsgSentCount(..., 1L)
.assertModel(procHandle.getModel());
Passerelle has unit test support APIs, actor implementations etc that can be migrated to Triquetrum.