use of org.contextmapper.dsl.generator.sketchminer.model.TaskSequence in project context-mapper-dsl by ContextMapper.
the class TaskSequenceTest method canAddTask.
@Test
public void canAddTask() {
// given
Task initTask = new Task("Start", TaskType.COMMAND);
Task secondTask = new Task("SecondTask", TaskType.COMMAND);
// when
TaskSequence seq = new TaskSequence(initTask);
seq.addTask(secondTask);
// then
assertEquals(secondTask, seq.getLastTaskInSequence());
assertEquals(2, seq.getTasks().size());
}
use of org.contextmapper.dsl.generator.sketchminer.model.TaskSequence in project context-mapper-dsl by ContextMapper.
the class TaskSequenceTest method canCreateTaskSequence.
@Test
public void canCreateTaskSequence() {
// given
Task initTask = new Task("Start", TaskType.COMMAND);
// when
TaskSequence seq = new TaskSequence(initTask);
// then
assertEquals(initTask, seq.getLastTaskInSequence());
assertEquals(1, seq.getTasks().size());
}
use of org.contextmapper.dsl.generator.sketchminer.model.TaskSequence in project context-mapper-dsl by ContextMapper.
the class Flow2SketchMinerConverter method createNewSequenceWithTask.
private void createNewSequenceWithTask(TaskSequence seq, Task nextTask) {
TaskSequence newSeq = seq.copy();
if (newSeq.addTask(nextTask))
finishSequence(newSeq);
model.addSequence(newSeq);
}
use of org.contextmapper.dsl.generator.sketchminer.model.TaskSequence in project context-mapper-dsl by ContextMapper.
the class TaskSequenceTest method canCopySequence.
@Test
public void canCopySequence() {
// given
Task initTask = new Task("Start", TaskType.COMMAND);
TaskSequence seq1 = new TaskSequence(initTask);
// when
TaskSequence seq2 = seq1.copy();
// then
assertEquals(1, seq1.getTasks().size());
assertEquals(1, seq2.getTasks().size());
assertEquals(initTask, seq1.getLastTaskInSequence());
assertEquals(initTask, seq2.getLastTaskInSequence());
assertFalse(seq1.equals(seq2));
assertFalse(seq1 == seq2);
}
use of org.contextmapper.dsl.generator.sketchminer.model.TaskSequence in project context-mapper-dsl by ContextMapper.
the class Flow2SketchMinerConverter method convert.
public SketchMinerModel convert() {
for (Task initialTask : getInitialTasks()) {
TaskSequence seq = new TaskSequence(initialTask);
model.addSequence(seq);
finishSequence(seq);
}
model.cleanupDuplicateSequences();
return model;
}
Aggregations