use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testEndSignalEventEquals.
@Test
public void testEndSignalEventEquals() {
final String SIGNAL_REF = "signal ref";
final String SIGNAL_SCOPE = "signal scope";
final ScopedSignalEventExecutionSet A_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet B_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet C_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef("Other value"), new SignalScope(SIGNAL_SCOPE));
final ScopedSignalEventExecutionSet D_EXECUTION_SET = new ScopedSignalEventExecutionSet(new SignalRef(SIGNAL_REF), new SignalScope(SIGNAL_SCOPE));
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"));
EndSignalEvent.EndSignalEventBuilder builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent d = builder.build();
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);
a.setDataIOSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
EndMessageEvent.EndMessageEventBuilder builderMessage = new EndMessageEvent.EndMessageEventBuilder();
EndMessageEvent e = builderMessage.build();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet 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 MessageRef(MESSAGE_REF));
final CancellingMessageEventExecutionSet B_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(MESSAGE_REF));
final CancellingMessageEventExecutionSet C_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef("Other value"));
final CancellingMessageEventExecutionSet D_EXECUTION_SET = new CancellingMessageEventExecutionSet(new CancelActivity(true), 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.IntermediateMessageEventCatchingBuilder builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching a = builder.build();
a.setExecutionSet(A_EXECUTION_SET);
a.setDataIOSet(A_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching b = builder.build();
b.setExecutionSet(B_EXECUTION_SET);
b.setDataIOSet(B_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching c = builder.build();
c.setExecutionSet(C_EXECUTION_SET);
c.setDataIOSet(C_DATA_SET);
builder = new IntermediateMessageEventCatching.IntermediateMessageEventCatchingBuilder();
IntermediateMessageEventCatching d = builder.build();
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.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
EndSignalEvent e = builderSignal.build();
assertNotEquals(a, e);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallBusinessRuleTaskAssignments.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallBusinessRuleTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_BUSINESSRULETASKASSIGNMENTS);
assertDiagram(diagram, 4);
assertEquals("BusinessRuleTaskAssignments", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> businessRuleNode = diagram.getGraph().getNode("_45C2C340-D1D0-4D63-8419-EF38F9E73507");
BusinessRuleTask businessRuleTask = (BusinessRuleTask) businessRuleNode.getContent().getDefinition();
assertEquals(businessRuleTask.getTaskType().getValue(), TaskTypes.BUSINESS_RULE);
DataIOSet dataIOSet = businessRuleTask.getDataIOSet();
AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
assertEquals(assignmentsinfo.getValue(), "|input1:String,input2:String||output1:String,output2:String|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv2,[dout]output2->pv2");
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest 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.dataio.DataIOSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartMessageEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTMESSAGEEVENT);
assertDiagram(diagram, 2);
assertEquals("StartMessageEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> startMessageEventNode = diagram.getGraph().getNode("_34C4BBFC-544F-4E23-B17B-547BB48EEB63");
StartMessageEvent startMessageEvent = (StartMessageEvent) startMessageEventNode.getContent().getDefinition();
assertNotNull(startMessageEvent.getExecutionSet());
MessageRef messageRef = startMessageEvent.getExecutionSet().getMessageRef();
IsInterrupting isInterrupting = startMessageEvent.getExecutionSet().getIsInterrupting();
assertEquals("msgref", messageRef.getValue());
assertEquals(true, isInterrupting.getValue());
DataIOSet dataIOSet = startMessageEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||StartMessageEventOutputVar1:String||[dout]StartMessageEventOutputVar1->var1", assignmentsInfo.getValue());
}
Aggregations