1 package org
.argeo
.slc
.spring
.unit
;
3 import java
.util
.ArrayList
;
4 import java
.util
.HashMap
;
7 import org
.argeo
.slc
.core
.execution
.DefaultExecutionSpec
;
8 import org
.argeo
.slc
.execution
.ExecutionFlowDescriptor
;
9 import org
.argeo
.slc
.execution
.ExecutionSpecAttribute
;
10 import org
.argeo
.slc
.execution
.RefSpecAttribute
;
11 import org
.argeo
.slc
.execution
.RefValue
;
12 import org
.argeo
.slc
.execution
.RefValueChoice
;
13 import org
.argeo
.slc
.primitive
.PrimitiveAccessor
;
14 import org
.argeo
.slc
.primitive
.PrimitiveSpecAttribute
;
15 import org
.argeo
.slc
.primitive
.PrimitiveValue
;
16 import org
.argeo
.slc
.runtime
.test
.BasicTestData
;
18 public class ExecutionFlowDescriptorTestUtils
{
19 public static ExecutionFlowDescriptor
createSimpleExecutionFlowDescriptor() {
20 ExecutionFlowDescriptor flowDescriptor
= new ExecutionFlowDescriptor();
21 flowDescriptor
.setName("simpleFlow");
22 flowDescriptor
.setDescription("my description");
24 Map
<String
, Object
> values
= new HashMap
<String
, Object
>();
25 values
.put("primitiveInteger", new PrimitiveValue(
26 PrimitiveAccessor
.TYPE_INTEGER
, 100));
28 RefValue refValue
= new RefValue("002");
29 values
.put("ref1", refValue
);
30 flowDescriptor
.setValues(values
);
32 flowDescriptor
.setExecutionSpec(createRelatedSimpleSpec());
33 return flowDescriptor
;
36 protected static DefaultExecutionSpec
createRelatedSimpleSpec() {
37 DefaultExecutionSpec spec
= new DefaultExecutionSpec();
38 spec
.setBeanName("simpleSpec");
39 Map
<String
, ExecutionSpecAttribute
> attributes
= new HashMap
<String
, ExecutionSpecAttribute
>();
41 PrimitiveSpecAttribute primitiveInteger
= new PrimitiveSpecAttribute();
42 primitiveInteger
.setType(PrimitiveAccessor
.TYPE_INTEGER
);
43 primitiveInteger
.setValue(50);
44 attributes
.put("primitiveInteger", primitiveInteger
);
46 RefSpecAttribute ref1
= new RefSpecAttribute();
47 ref1
.setTargetClass(BasicTestData
.class);
48 ref1
.setChoices(new ArrayList
<RefValueChoice
>());
49 ref1
.getChoices().add(new RefValueChoice("001", "desc"));
50 ref1
.getChoices().add(new RefValueChoice("002", null));
51 ref1
.getChoices().add(new RefValueChoice("003", null));
52 attributes
.put("ref1", ref1
);
54 spec
.setAttributes(attributes
);