use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEndMessageEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDMESSAGEEVENT);
assertDiagram(diagram, 2);
assertEquals("EndMessageEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> endMessageEventNode = diagram.getGraph().getNode("_4A8A0A9E-D4A5-4B6E-94A6-20817A57B3C6");
EndMessageEvent endMessageEvent = (EndMessageEvent) endMessageEventNode.getContent().getDefinition();
assertNotNull(endMessageEvent.getExecutionSet());
MessageRef messageRef = endMessageEvent.getExecutionSet().getMessageRef();
assertEquals("msgref", messageRef.getValue());
DataIOSet dataIOSet = endMessageEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("EndMessageEventInputVar1:String||||[din]var1->EndMessageEventInputVar1", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
assertNotNull(intermediateMessageEventCatching.getExecutionSet());
MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
assertEquals("msgref1", messageRef.getValue());
DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverterTest method setUp.
@Before
public void setUp() {
Event boundaryEvent = bpmn2.createBoundaryEvent();
boundaryEventPropertyWriter = spy(new BoundaryEventPropertyWriter((BoundaryEvent) spy(boundaryEvent), new FlatVariableScope(), new HashSet<>()));
// when(boundaryEventPropertyWriter.getFlowElement()).thenReturn(spy(FlowElement.class));
Event catchEvent = bpmn2.createIntermediateCatchEvent();
catchEventPropertyWriter = spy(new CatchEventPropertyWriter((CatchEvent) spy(catchEvent), new FlatVariableScope(), new HashSet<>()));
propertyWriterFactory = spy(PropertyWriterFactory.class);
when(propertyWriterFactory.of(any(BoundaryEvent.class))).thenReturn(boundaryEventPropertyWriter);
when(propertyWriterFactory.of(any(CatchEvent.class))).thenReturn(catchEventPropertyWriter);
generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
dataIOSet = new DataIOSet(assignmentsInfo);
advancedData = new AdvancedData();
slaDueDate = mock(SLADueDate.class);
errorRef = mock(ErrorRef.class);
signalRef = mock(SignalRef.class);
linkRef = mock(LinkRef.class);
timerSettingsValue = mock(TimerSettingsValue.class);
timerSettings = new TimerSettings(timerSettingsValue);
messageRef = mock(MessageRef.class);
scriptTypeValue = mock(ScriptTypeValue.class);
conditionExpression = new ConditionExpression(scriptTypeValue);
escalationRef = mock(EscalationRef.class);
tested = spy(new IntermediateCatchEventConverter(propertyWriterFactory));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method IntermediateMessageEventCatchingEquals.
@Test
public void IntermediateMessageEventCatchingEquals() {
final String MESSAGE_REF = "message ref";
final CancellingMessageEventExecutionSet A_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), new MessageRef(MESSAGE_REF, ""));
final CancellingMessageEventExecutionSet B_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), new MessageRef(MESSAGE_REF, ""));
final CancellingMessageEventExecutionSet C_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), new MessageRef("Other value", ""));
final CancellingMessageEventExecutionSet D_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new SLADueDate(), new MessageRef(MESSAGE_REF, ""));
final String ASSIGNMENT_INFO = "some value";
final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
IntermediateMessageEventCatching a = new IntermediateMessageEventCatching();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
IntermediateMessageEventCatching b = new IntermediateMessageEventCatching();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
IntermediateMessageEventCatching c = new IntermediateMessageEventCatching();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
IntermediateMessageEventCatching d = new IntermediateMessageEventCatching();
d.setExecutionSet(D_EXECUTION_SET);
d.setDataIOSet(D_DATA_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
EndSignalEvent e = new EndSignalEvent();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndMessageEventEquals.
@Test
public void testEndMessageEventEquals() {
final String MESSAGE_REF = "message ref";
final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value", ""));
final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF, ""));
final String ASSIGNMENT_INFO = "some value";
final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
EndMessageEvent a = new EndMessageEvent();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
EndMessageEvent b = new EndMessageEvent();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
EndMessageEvent c = new EndMessageEvent();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
EndMessageEvent d = new EndMessageEvent();
d.setExecutionSet(D_EXECUTION_SET);
d.setDataIOSet(D_DATA_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
assertNotEquals(a, c);
assertNotEquals(a, d);
EndSignalEvent e = new EndSignalEvent();
assertNotEquals(a, e);
}
Aggregations