]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.unit/src/main/java/org/argeo/slc/unit/process/SlcExecutionTestUtils.java
SlcExecution persistence
[gpl/argeo-slc.git] / runtime / org.argeo.slc.unit / src / main / java / org / argeo / slc / unit / process / SlcExecutionTestUtils.java
index 8bf94160175e87784f2ed313bda2c8582b90af3f..e83f1cb8ab2b744f9607476b5fd586fae5124799 100644 (file)
@@ -4,10 +4,15 @@ import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertNotNull;\r
 import static org.argeo.slc.unit.UnitUtils.assertDateSec;\r
 \r
+import java.util.ArrayList;\r
+import java.util.List;\r
 import java.util.UUID;\r
 \r
+import org.argeo.slc.execution.ExecutionFlowDescriptor;\r
+import org.argeo.slc.process.RealizedFlow;\r
 import org.argeo.slc.process.SlcExecution;\r
 import org.argeo.slc.process.SlcExecutionStep;\r
+import org.argeo.slc.unit.execution.ExecutionFlowDescriptorTestUtils;\r
 \r
 public abstract class SlcExecutionTestUtils {\r
 \r
@@ -22,6 +27,21 @@ public abstract class SlcExecutionTestUtils {
                return slcExec;\r
        }\r
 \r
+       public static SlcExecution createSlcExecutionWithRealizedFlows() {\r
+               SlcExecution slcExec = SlcExecutionTestUtils.createSimpleSlcExecution();\r
+               List<RealizedFlow> realizedFlows = new ArrayList<RealizedFlow>();\r
+               RealizedFlow realizedFlow = new RealizedFlow();\r
+               ExecutionFlowDescriptor flowDescriptor = ExecutionFlowDescriptorTestUtils\r
+                               .createSimpleExecutionFlowDescriptor();\r
+               realizedFlow.setModuleName("test.module");\r
+               realizedFlow.setModuleVersion("1.0.0");\r
+               realizedFlow.setFlowDescriptor(flowDescriptor);\r
+               realizedFlow.setExecutionSpec(flowDescriptor.getExecutionSpec());\r
+               realizedFlows.add(realizedFlow);\r
+               slcExec.setRealizedFlows(realizedFlows);\r
+               return slcExec;\r
+       }\r
+\r
        public static void assertSlcExecution(SlcExecution expected,\r
                        SlcExecution reached) {\r
                assertNotNull(reached);\r