use of org.contextmapper.dsl.generator.sketchminer.SketchMinerModelCreator in project context-mapper-dsl by ContextMapper.
the class SketchMinerModelCreatorTest method ignoreAggregateRefWithoutStateTransition.
@Test
public void ignoreAggregateRefWithoutStateTransition() throws IOException {
// given
ContextMappingModel model = getOriginalResourceOfTestCML("aggregate-without-state-transition-test-1.cml").getContextMappingModel();
Flow flow = EcoreUtil2.eAllOfType(model, Flow.class).get(0);
// when
String output = new SketchMinerModelCreator().createText(flow);
// then
assertEquals("TestContext Application:" + System.lineSeparator() + System.lineSeparator() + "(StartEvent)" + System.lineSeparator() + "service Command1" + System.lineSeparator() + "(EndEvent)" + System.lineSeparator() + System.lineSeparator(), output);
}
use of org.contextmapper.dsl.generator.sketchminer.SketchMinerModelCreator in project context-mapper-dsl by ContextMapper.
the class SketchMinerModelCreatorTest method canUseFallbackAppName.
@Test
public void canUseFallbackAppName() throws IOException {
// given
ContextMappingModel model = getOriginalResourceOfTestCML("app-layer-name-test-1.cml").getContextMappingModel();
Flow flow = EcoreUtil.copy(EcoreUtil2.eAllOfType(model, Flow.class).get(0));
// when
String output = new SketchMinerModelCreator().createText(flow);
// then
assertEquals("Application:" + System.lineSeparator() + System.lineSeparator() + "service StartCommand" + System.lineSeparator() + "(FirstEvent)" + System.lineSeparator() + "service EndCommand" + System.lineSeparator() + System.lineSeparator(), output);
}
use of org.contextmapper.dsl.generator.sketchminer.SketchMinerModelCreator in project context-mapper-dsl by ContextMapper.
the class SketchMinerModelCreatorTest method canGenerateExclusiveAlternativeGate4EventProductionSteps.
@ParameterizedTest
@ValueSource(strings = { "exclusive-gate-event-test-1", "exclusive-gate-event-test-2", "exclusive-gate-event-test-3" })
public void canGenerateExclusiveAlternativeGate4EventProductionSteps(String inputFileName) throws IOException {
// given
ContextMappingModel model = getOriginalResourceOfTestCML(inputFileName + ".cml").getContextMappingModel();
Flow flow = EcoreUtil2.eAllOfType(model, Flow.class).get(0);
// when
String output = new SketchMinerModelCreator().createText(flow);
// then
assertEquals("TestContext Application:" + System.lineSeparator() + System.lineSeparator() + "service StartCommand" + System.lineSeparator() + "(FirstEvent)" + System.lineSeparator() + "service EndCommand" + System.lineSeparator() + System.lineSeparator() + "service StartCommand" + System.lineSeparator() + "(SecondEvent)" + System.lineSeparator() + "service EndCommand" + System.lineSeparator() + System.lineSeparator(), output);
}
use of org.contextmapper.dsl.generator.sketchminer.SketchMinerModelCreator in project context-mapper-dsl by ContextMapper.
the class SketchMinerModelCreatorTest method canHandleLoopsWithMultipleEnds.
@Test
public void canHandleLoopsWithMultipleEnds() throws IOException {
// given
ContextMappingModel model = getOriginalResourceOfTestCML("loop-test-3.cml").getContextMappingModel();
Flow flow = EcoreUtil2.eAllOfType(model, Flow.class).get(0);
// when
String output = new SketchMinerModelCreator().createText(flow);
// then
assertEquals("A1:" + System.lineSeparator() + System.lineSeparator() + "(InitialEvent)" + System.lineSeparator() + "(DE1)" + System.lineSeparator() + "service C1" + System.lineSeparator() + "(DE2)|(DE1)" + System.lineSeparator() + "..." + System.lineSeparator() + System.lineSeparator() + "..." + System.lineSeparator() + "(DE2)" + System.lineSeparator() + System.lineSeparator(), output);
}
use of org.contextmapper.dsl.generator.sketchminer.SketchMinerModelCreator in project context-mapper-dsl by ContextMapper.
the class SketchMinerModelCreatorTest method canGenerateExclusiveAlternativeGate4CommandInvokationSteps.
@ParameterizedTest
@ValueSource(strings = { "exclusive-gate-command-test-1", "exclusive-gate-command-test-2", "exclusive-gate-command-test-3" })
public void canGenerateExclusiveAlternativeGate4CommandInvokationSteps(String inputFileName) throws IOException {
// given
ContextMappingModel model = getOriginalResourceOfTestCML(inputFileName + ".cml").getContextMappingModel();
Flow flow = EcoreUtil2.eAllOfType(model, Flow.class).get(0);
// when
String output = new SketchMinerModelCreator().createText(flow);
// then
assertEquals("TestContext Application:" + System.lineSeparator() + System.lineSeparator() + "service StartCommand" + System.lineSeparator() + "(FirstEvent)" + System.lineSeparator() + "service MiddleCommand1" + System.lineSeparator() + "(EndEvent)" + System.lineSeparator() + System.lineSeparator() + "service StartCommand" + System.lineSeparator() + "(FirstEvent)" + System.lineSeparator() + "service MiddleCommand2" + System.lineSeparator() + "(EndEvent)" + System.lineSeparator() + System.lineSeparator(), output);
}
Aggregations