Search in sources :

Example 1 with SequenceFlowConnectorDef

use of org.kie.workbench.common.stunner.bpmn.client.shape.def.SequenceFlowConnectorDef in project kie-wb-common by kiegroup.

the class BPMNShapeFactoryTest method testRegisterDelegates.

@Test
@SuppressWarnings("unchecked")
public void testRegisterDelegates() {
    tested.registerDelegates();
    final ArgumentCaptor<Supplier> factoryArgumentCaptor = ArgumentCaptor.forClass(Supplier.class);
    verify(delegateShapeFactory, times(1)).delegate(eq(BPMNDiagramImpl.class), any(BPMNDiagramShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(NoneTask.class), any(TaskShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(UserTask.class), any(TaskShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(ScriptTask.class), any(TaskShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(BusinessRuleTask.class), any(TaskShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartNoneEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartSignalEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartTimerEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartMessageEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartErrorEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartConditionalEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(StartEscalationEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(ParallelGateway.class), any(GatewayShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(ExclusiveGateway.class), any(GatewayShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(InclusiveGateway.class), any(GatewayShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EventGateway.class), any(GatewayShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(Lane.class), any(LaneShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(ReusableSubprocess.class), any(SubprocessShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EmbeddedSubprocess.class), any(SubprocessShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EventSubprocess.class), any(SubprocessShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(AdHocSubprocess.class), any(SubprocessShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(MultipleInstanceSubprocess.class), any(SubprocessShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndNoneEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndTerminateEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndErrorEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndSignalEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndMessageEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndEscalationEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateTimerEvent.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateConditionalEvent.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateSignalEventCatching.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateLinkEventCatching.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateErrorEventCatching.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateMessageEventCatching.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateEscalationEvent.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateSignalEventThrowing.class), any(ThrowingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateLinkEventThrowing.class), any(ThrowingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateMessageEventThrowing.class), any(ThrowingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateEscalationEventThrowing.class), any(ThrowingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    ArgumentCaptor<SequenceFlowConnectorDef> sequenceFlowConnectorDefArgumentCaptor = ArgumentCaptor.forClass(SequenceFlowConnectorDef.class);
    verify(delegateShapeFactory, times(1)).delegate(eq(StartCompensationEvent.class), any(StartEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateCompensationEvent.class), any(CatchingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(IntermediateCompensationEventThrowing.class), any(ThrowingIntermediateEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(EndCompensationEvent.class), any(EndEventShapeDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(DirectionalAssociation.class), any(AssociationConnectorDef.class), factoryArgumentCaptor.capture());
    verify(delegateShapeFactory, times(1)).delegate(eq(SequenceFlow.class), sequenceFlowConnectorDefArgumentCaptor.capture(), factoryArgumentCaptor.capture());
    final SequenceFlowConnectorDef sequenceFlowConnectorDef = sequenceFlowConnectorDefArgumentCaptor.getValue();
    sequenceFlowConnectorDef.newFontHandler().handle(sequenceFlow, sequenceFlowView);
    verify(sequenceFlowView).setTitleFontColor(BPMNTextPreferences.TEXT_FILL_COLOR);
    verify(sequenceFlowView).setTitleAlpha(BPMNTextPreferences.TEXT_ALPHA);
    verify(sequenceFlowView).setTitleFontFamily(BPMNTextPreferences.TEXT_FONT_FAMILY);
    verify(sequenceFlowView).setTitleFontSize(BPMNTextPreferences.TEXT_FONT_SIZE);
    verify(sequenceFlowView).setTitleStrokeColor(BPMNTextPreferences.TEXT_STROKE_COLOR);
    verify(sequenceFlowView).setTitleStrokeWidth(BPMNTextPreferences.TEXT_STROKE_WIDTH);
    verify(sequenceFlowView).setTitleStrokeAlpha(0);
    final long svgFactoryCallCount = factoryArgumentCaptor.getAllValues().stream().filter(this::isSvgShapeFactory).count();
    final long basicFactoryCallCount = factoryArgumentCaptor.getAllValues().stream().filter(this::isBasicShapeFactory).count();
    assertEquals(43, svgFactoryCallCount, 0);
    assertEquals(2, basicFactoryCallCount, 0);
}
Also used : SequenceFlowConnectorDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.SequenceFlowConnectorDef) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) AdHocSubprocess(org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess) EndEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndEscalationEvent) BPMNDiagramShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.BPMNDiagramShapeDef) AssociationConnectorDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.AssociationConnectorDef) LaneShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.LaneShapeDef) MultipleInstanceSubprocess(org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) EventSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess) TaskShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.TaskShapeDef) StartEventShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.StartEventShapeDef) IntermediateSignalEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing) CatchingIntermediateEventShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.CatchingIntermediateEventShapeDef) StartCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent) EndCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent) IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) Lane(org.kie.workbench.common.stunner.bpmn.definition.Lane) DirectionalAssociation(org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation) ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) ParallelGateway(org.kie.workbench.common.stunner.bpmn.definition.ParallelGateway) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) EndEventShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.EndEventShapeDef) EventGateway(org.kie.workbench.common.stunner.bpmn.definition.EventGateway) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) SequenceFlow(org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow) BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) IntermediateEscalationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEventThrowing) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) ThrowingIntermediateEventShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.ThrowingIntermediateEventShapeDef) GatewayShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.GatewayShapeDef) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) IntermediateMessageEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Supplier(java.util.function.Supplier) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) ExclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) SubprocessShapeDef(org.kie.workbench.common.stunner.bpmn.client.shape.def.SubprocessShapeDef) EndMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent) EndTerminateEvent(org.kie.workbench.common.stunner.bpmn.definition.EndTerminateEvent) Test(org.junit.Test)

Aggregations

Supplier (java.util.function.Supplier)1 Test (org.junit.Test)1 AssociationConnectorDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.AssociationConnectorDef)1 BPMNDiagramShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.BPMNDiagramShapeDef)1 CatchingIntermediateEventShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.CatchingIntermediateEventShapeDef)1 EndEventShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.EndEventShapeDef)1 GatewayShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.GatewayShapeDef)1 LaneShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.LaneShapeDef)1 SequenceFlowConnectorDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.SequenceFlowConnectorDef)1 StartEventShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.StartEventShapeDef)1 SubprocessShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.SubprocessShapeDef)1 TaskShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.TaskShapeDef)1 ThrowingIntermediateEventShapeDef (org.kie.workbench.common.stunner.bpmn.client.shape.def.ThrowingIntermediateEventShapeDef)1 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)1 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 DirectionalAssociation (org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation)1 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)1 EndCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.EndCompensationEvent)1 EndErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent)1