use of io.takari.bpm.model.ProcessDefinition in project concord by walmartlabs.
the class YamlParserTest method test025.
@Test
public void test025() throws Exception {
deploy("025.yml");
ProcessDefinition pd = getDefinition("main");
// /-------------------------------->\
// start -> subprocess + boundary-event -> task -> end
assertEquals(9, pd.getChildren().size());
// subprocess
// /----------> end
// start -> task -> gw -> task -> end
assertEquals(11, findSubprocess(pd).getChildren().size());
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
Map<String, Object> args = Collections.singletonMap("aInt", 1);
start(key, "main", args);
// ---
verify(testBean, times(1)).toString(eq("a"));
verifyNoMoreInteractions(testBean);
}
use of io.takari.bpm.model.ProcessDefinition in project concord by walmartlabs.
the class YamlParserTest method test010.
@Test
public void test010() throws Exception {
deploy("010.yml");
ProcessDefinition pd = getDefinition("main");
// /----------------------------->\
// start -> task -> task + boundary-event -> task -> task -> end
assertEquals(13, pd.getChildren().size());
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
verify(testBean, times(1)).throwBpmnError(anyString());
verify(testBean, times(1)).toString(eq("a"));
verify(testBean, times(1)).toString(eq("b"));
verify(testBean, times(1)).toString(eq("c"));
verifyNoMoreInteractions(testBean);
}
use of io.takari.bpm.model.ProcessDefinition in project concord by walmartlabs.
the class YamlParserTest method test014.
@Test
public void test014() throws Exception {
deploy("014.yml");
ProcessDefinition pd = getDefinition("main");
// /------------------->\
// start -> gw -> callactivity -> end
assertEquals(8, pd.getChildren().size());
int loops = 100;
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
Map<String, Object> args = new HashMap<>();
args.put("cnt", 0);
args.put("loops", loops);
start(key, "main", args);
// ---
verify(testBean, times(loops)).inc(anyInt());
verifyNoMoreInteractions(testBean);
}
use of io.takari.bpm.model.ProcessDefinition in project concord by walmartlabs.
the class YamlParserTest method test007.
@Test
public void test007() throws Exception {
deploy("007.yml");
ProcessDefinition pd = getDefinition("main");
// /-> task -\ /-> task -\
// start -> gw -> task -> gw -> task -> end
assertEquals(17, pd.getChildren().size());
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
Map<String, Object> args = Collections.singletonMap("aInt", 100);
start(key, "main", args);
// ---
verify(testBean, times(1)).toString(eq("a"));
verify(testBean, times(1)).toString(eq("d"));
verifyNoMoreInteractions(testBean);
}
use of io.takari.bpm.model.ProcessDefinition in project concord by walmartlabs.
the class YamlParserTest method test025_2.
@Test
public void test025_2() throws Exception {
deploy("025.yml");
ProcessDefinition pd = getDefinition("main");
// /-------------------------------->\
// start -> subprocess + boundary-event -> task -> end
assertEquals(9, pd.getChildren().size());
// subprocess
// /----------> end
// start -> task -> gw -> task -> end
assertEquals(11, findSubprocess(pd).getChildren().size());
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
Map<String, Object> args = Collections.singletonMap("aInt", -1);
start(key, "main", args);
// ---
verify(testBean, times(1)).toString(eq("a"));
verify(testBean, times(1)).toString(eq("else"));
verifyNoMoreInteractions(testBean);
}
Aggregations