@Test public void testEscalationEventExecutionSetEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new EscalationEventExecutionSet(), new EscalationEventExecutionSet()) .addTrueCase(new EscalationEventExecutionSet(new EscalationRef()), new EscalationEventExecutionSet(new EscalationRef())) .addTrueCase(new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))) .addFalseCase(new EscalationEventExecutionSet(), null) .addFalseCase(new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1))) .test(); }
private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String escalationRef) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); } }
private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String eventReference) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(eventReference, executionSet.getEscalationRef().getValue()); } }
public IntermediateEscalationEventThrowing() { this(new BPMNGeneralSet(""), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new EscalationEventExecutionSet()); }
@Override public Function<Node, Pair<Object, String>> getMapper() { return node -> { EscalationRef escalationRef = null; if (startEscalationEventsFilter.test(node)) { escalationRef = ((StartEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (intermediateCatchingEscalationEventsFilter.test(node)) { escalationRef = ((IntermediateEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (intermediateThrowingEscalationEventsFilter.test(node)) { escalationRef = ((IntermediateEscalationEventThrowing) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (endEscalationEventsFilter.test(node)) { escalationRef = ((EndEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } if (escalationRef != null && escalationRef.getValue() != null && !escalationRef.getValue().isEmpty()) { return new Pair<>(escalationRef.getValue(), escalationRef.getValue(), Pair.PairEqualsMode.K1); } else { return null; } }; } }
public EndEscalationEvent() { this(new BPMNGeneralSet(""), new BackgroundSet(), new FontSet(), new CircleDimensionSet(new Radius()), new EscalationEventExecutionSet(), new DataIOSet()); }
private PropertyWriter escalationEvent(Node<View<IntermediateEscalationEventThrowing>, ?> n) { IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); event.setId(n.getUUID()); IntermediateEscalationEventThrowing definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); p.addEscalation(definition.getExecutionSet().getEscalationRef()); p.setBounds(n.getContent().getBounds()); return p; }
@Test public void testIntermediateEscalationThrowingEventEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new IntermediateEscalationEventThrowing(), new IntermediateEscalationEventThrowing()) .addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet(), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet()), new IntermediateEscalationEventThrowing(new BPMNGeneralSet(), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet())) .addFalseCase(new IntermediateEscalationEventThrowing(), null) .addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet()), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet())) .addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)))) .addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name1", "doc1"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)))) .addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1)))) .addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(null))) .addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new DataIOSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), null)) .test(); }
private PropertyWriter escalationEvent(Node<View<EndEscalationEvent>, ?> n) { EndEvent event = bpmn2.createEndEvent(); event.setId(n.getUUID()); EndEscalationEvent definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); EscalationEventExecutionSet executionSet = definition.getExecutionSet(); p.addEscalation(executionSet.getEscalationRef()); p.setBounds(n.getContent().getBounds()); return p; }
@Test public void testEndEscalationEventEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new EndEscalationEvent(), new EndEscalationEvent()) .addTrueCase(new EndEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(), new DataIOSet())) .addFalseCase(new EndEscalationEvent(), null) .addTrueCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(), new DataIOSet())) .addTrueCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet())) .addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet())) .addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1)), new DataIOSet())) .addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet("data"))) .addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(null), new DataIOSet())) .addFalseCase(new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new DataIOSet()), new EndEscalationEvent(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), null, new DataIOSet())) .test(); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallIntermediateEscalationEventThrowing() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ESCALATION_EVENTTHROWING); assertDiagram(diagram, 2); assertEquals("IntermediateEscalationEventThrowing", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> throwingEventNode = diagram.getGraph().getNode("_8516D854-F67F-4697-9837-40A32033AE25"); assertNotNull(throwingEventNode); IntermediateEscalationEventThrowing throwingEscalationEvent = (IntermediateEscalationEventThrowing) throwingEventNode.getContent().getDefinition(); assertNotNull(throwingEscalationEvent.getGeneral()); assertEquals("ThrowingEscalationEventName", throwingEscalationEvent.getGeneral().getName().getValue()); assertEquals("ThrowingEscalationEventDocumentation", throwingEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(throwingEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", throwingEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = throwingEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationOutput:String||||[din]processVar1->escalationOutput", assignmentsInfo.getValue()); }
private BpmnNode escalationEventDefinition(EndEvent event, EscalationEventDefinition e) { Node<View<EndEscalationEvent>, Edge> node = factoryManager.newNode(event.getId(), EndEscalationEvent.class); EndEscalationEvent definition = node.getContent().getDefinition(); EventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new EscalationEventExecutionSet( new EscalationRef(EventDefinitionReader.escalationRefOf(e)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallEndEscalationEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDESCALATIONEVENT); assertDiagram(diagram, 2); assertEquals("EndEscalationEvent", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_8F6A4096-26AA-4C14-B1F0-B96ED24BD5C7"); assertNotNull(endEventNode); EndEscalationEvent endEscalationEvent = (EndEscalationEvent) endEventNode.getContent().getDefinition(); assertNotNull(endEscalationEvent.getGeneral()); assertEquals("EndEscalationEventName", endEscalationEvent.getGeneral().getName().getValue()); assertEquals("EndEscalationEventDocumentation", endEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(endEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", endEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = endEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationInput:String||||[din]processVar1->escalationInput", assignmentsInfo.getValue()); }
private BpmnNode escalationEvent( IntermediateThrowEvent event, EscalationEventDefinition eventDefinition) { Node<View<IntermediateEscalationEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateEscalationEventThrowing.class); IntermediateEscalationEventThrowing definition = node.getContent().getDefinition(); EventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new EscalationEventExecutionSet( new EscalationRef(EventDefinitionReader.escalationRefOf(eventDefinition)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallEndEscalationEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDESCALATIONEVENT); assertDiagram(diagram, 2); assertEquals("EndEscalationEvent", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_8F6A4096-26AA-4C14-B1F0-B96ED24BD5C7"); assertNotNull(endEventNode); EndEscalationEvent endEscalationEvent = (EndEscalationEvent) endEventNode.getContent().getDefinition(); assertNotNull(endEscalationEvent.getGeneral()); assertEquals("EndEscalationEventName", endEscalationEvent.getGeneral().getName().getValue()); assertEquals("EndEscalationEventDocumentation", endEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(endEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", endEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = endEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationInput:String||||[din]processVar1->escalationInput", assignmentsInfo.getValue()); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallIntermediateEscalationEventThrowing() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ESCALATION_EVENTTHROWING); assertDiagram(diagram, 2); assertEquals("IntermediateEscalationEventThrowing", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> throwingEventNode = diagram.getGraph().getNode("_8516D854-F67F-4697-9837-40A32033AE25"); assertNotNull(throwingEventNode); IntermediateEscalationEventThrowing throwingEscalationEvent = (IntermediateEscalationEventThrowing) throwingEventNode.getContent().getDefinition(); assertNotNull(throwingEscalationEvent.getGeneral()); assertEquals("ThrowingEscalationEventName", throwingEscalationEvent.getGeneral().getName().getValue()); assertEquals("ThrowingEscalationEventDocumentation", throwingEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(throwingEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", throwingEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = throwingEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationOutput:String||||[din]processVar1->escalationOutput", assignmentsInfo.getValue()); }