Search in sources :

Example 6 with TestingGraphInstanceBuilder2

use of org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2 in project kie-wb-common by kiegroup.

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel2SixTasksWithLanesNodeInLevel0Selected.

@Test
public void testGetSelectorDataLevel2SixTasksWithLanesNodeInLevel0Selected() {
    TestingGraphInstanceBuilder2.Level2Graph graph = buildLevel2Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level2Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), mockTask(LEVEL0_NODE2.nodeName()), new EndNoneEvent(), mockLane(LEVEL1_SUB_PROCESS1.nodeName()), mockTask(LEVEL1_NODE1.nodeName()), mockTask(LEVEL1_NODE2.nodeName()), mockLane(LEVEL2_SUB_PROCESS1.nodeName()), mockTask(LEVEL2_NODE1.nodeName()), mockTask(LEVEL2_NODE2.nodeName()));
    testGetSelectorData(graph.level0Node1, expectedNodes(LEVEL0_NODE1, LEVEL0_NODE2, LEVEL1_NODE1, LEVEL1_NODE2, LEVEL2_NODE1, LEVEL2_NODE2));
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 7 with TestingGraphInstanceBuilder2

use of org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2 in project kie-wb-common by kiegroup.

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel0TwoTasks.

@Test
public void testGetSelectorDataLevel0TwoTasks() {
    TestingGraphInstanceBuilder2.Level0Graph graph = buildLevel0Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level0Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), mockTask(LEVEL0_NODE2.nodeName()), new EndNoneEvent());
    testGetSelectorData(graph.level0Node1, expectedNodes(LEVEL0_NODE1, LEVEL0_NODE2));
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 8 with TestingGraphInstanceBuilder2

use of org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2 in project kie-wb-common by kiegroup.

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel0OneTask.

@Test
public void testGetSelectorDataLevel0OneTask() {
    TestingGraphInstanceBuilder2.Level0Graph graph = buildLevel0Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level0Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), new IntermediateConditionalEvent(), new EndNoneEvent());
    testGetSelectorData(graph.level0Node2, expectedNodes(LEVEL0_NODE1));
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 9 with TestingGraphInstanceBuilder2

use of org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2 in project kie-wb-common by kiegroup.

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel1FourTasks.

@Test
public void testGetSelectorDataLevel1FourTasks() {
    TestingGraphInstanceBuilder2.Level1Graph graph = buildLevel1Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level1Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), mockTask(LEVEL0_NODE2.nodeName()), new EndNoneEvent(), mockSubProcess(LEVEL1_SUB_PROCESS1.nodeName()), mockTask(LEVEL1_NODE1.nodeName()), mockTask(LEVEL1_NODE2.nodeName()));
    testGetSelectorData(graph.level1Node1, expectedNodes(LEVEL0_NODE1, LEVEL0_NODE2, LEVEL1_SUB_PROCESS1, LEVEL1_NODE1, LEVEL1_NODE2));
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Example 10 with TestingGraphInstanceBuilder2

use of org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2 in project kie-wb-common by kiegroup.

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel1FourTasksButNodeInLevel0IsSelected.

@Test
public void testGetSelectorDataLevel1FourTasksButNodeInLevel0IsSelected() {
    TestingGraphInstanceBuilder2.Level1Graph graph = buildLevel1Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level1Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), mockTask(LEVEL0_NODE2.nodeName()), new EndNoneEvent(), mockSubProcess(LEVEL1_SUB_PROCESS1.nodeName()), mockTask(LEVEL1_NODE1.nodeName()), mockTask(LEVEL1_NODE2.nodeName()));
    testGetSelectorData(graph.level0Node1, expectedNodes(LEVEL0_NODE1, LEVEL0_NODE2, LEVEL1_SUB_PROCESS1));
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 EndNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent)12 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)12 TestingGraphInstanceBuilder2 (org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2)12 IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Assertions.assertThatCode (org.assertj.core.api.Assertions.assertThatCode)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 RunWith (org.junit.runner.RunWith)1 ConverterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ConverterFactory)1 DefinitionsBuildingContext (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext)1 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)1 FlowElementPostConverter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.FlowElementPostConverter)1 ProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter)1 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)1 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)1 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)1