use of org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testLinkEventExecutionSet.
@Test
public void testLinkEventExecutionSet() {
LinkRef link = new LinkRef("link");
LinkEventExecutionSet executionSet = new LinkEventExecutionSet(link);
assertNotEquals(executionSet, null);
assertNotEquals(executionSet, "");
assertEquals(executionSet, executionSet);
LinkRef link2 = new LinkRef("link");
LinkEventExecutionSet executionSet2 = new LinkEventExecutionSet(link2);
assertEquals(executionSet, executionSet2);
link2.setValue("link2");
assertNotEquals(executionSet, executionSet2);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testIntermediateLinkCatchEventEquals.
@Test
public void testIntermediateLinkCatchEventEquals() {
IntermediateLinkEventCatching linkEvent = new IntermediateLinkEventCatching();
IntermediateLinkEventCatching linkEvent2 = new IntermediateLinkEventCatching();
assertNotEquals(linkEvent, null);
assertNotEquals(linkEvent, "");
assertEquals(linkEvent, linkEvent);
assertEquals(linkEvent, linkEvent2);
BackgroundSet backgroundSet = new BackgroundSet();
backgroundSet.setBgColor(new BgColor("black"));
linkEvent.setBackgroundSet(backgroundSet);
assertNotEquals(linkEvent, linkEvent2);
linkEvent2.setBackgroundSet(backgroundSet);
assertEquals(linkEvent, linkEvent2);
linkEvent.setBackgroundSet(backgroundSet);
linkEvent.setExecutionSet(new LinkEventExecutionSet(new LinkRef("value")));
assertNotEquals(linkEvent, linkEvent2);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method linkEvent.
protected Result<BpmnNode> linkEvent(CatchEvent event) {
String nodeId = event.getId();
Node<View<IntermediateLinkEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateLinkEventCatching.class);
IntermediateLinkEventCatching definition = node.getContent().getDefinition();
CatchEventPropertyReader p = propertyReaderFactory.of(event);
node.getContent().setBounds(p.getBounds());
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new LinkEventExecutionSet(new LinkRef(p.getLinkRef())));
return Result.success(BpmnNode.of(node, p));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef 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.link.LinkRef in project kie-wb-common by kiegroup.
the class ProcessLinkRefProviderTest method mockIntermediateLinkEventThrowingNode.
private Node mockIntermediateLinkEventThrowingNode(String linkRefValue) {
IntermediateLinkEventThrowing event = new IntermediateLinkEventThrowing();
event.setExecutionSet(new LinkEventExecutionSet(new LinkRef(linkRefValue)));
return mockNode(event);
}
Aggregations