public class TestDiamonds {
@Test
public void testDiamond() throws Exception {
Workflow workflow = WorkflowParser.parseYAML("src/test/resources/Diamond.yaml");
ResourceSpace resourceSpace = new ResourceSpace();
ExecutionProfile localExecutionProfile = new LocalExecutionProfile();
Orchestrator platformOrchestrator = new Orchestrator(workflow, localExecutionProfile, resourceSpace);
platformOrchestrator.orchestrate();
for(Module m : workflow.modules()){
System.out.println("\nModule " + m.name());
for(ModuleInstance mi : m.instances()){
for(InstanceOutput io : mi.outputs())
System.out.print(io.name()+":"+io.value()+ " ");
}
}
assertEquals(2, workflow.getModuleByName("A").instances().size());
assertEquals(4, workflow.getModuleByName("B").instances().size());
assertEquals(4, workflow.getModuleByName("C").instances().size());
assertEquals(8, workflow.getModuleByName("D").instances().size());
}