Search in sources :

Example 6 with BackgroundSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet in project kie-wb-common by kiegroup.

the class CallActivityConverterTest method setUp.

@Before
public void setUp() {
    final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(), new ReusableSubprocessTaskExecutionSet(), new DataIOSet(), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new AdvancedData());
    final View<ReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    Node<View<ReusableSubprocess>, Edge> node = new NodeImpl<>(UUID);
    node.setContent(view);
    when(callActivity.getId()).thenReturn(UUID);
    when(callActivity.getCalledElement()).thenReturn(CALLED_ELEMENT);
    when(factoryManager.newNode(eq(UUID), eq(ReusableSubprocess.class))).thenReturn(node);
    when(propertyReaderFactory.of(callActivity)).thenReturn(propertyReader);
    when(propertyReader.getName()).thenReturn(NAME);
    when(propertyReader.getDocumentation()).thenReturn(DOCUMENTATION);
    when(propertyReader.getAssignmentsInfo()).thenReturn(ASSIGNMENTS_INFO);
    when(propertyReader.getBounds()).thenReturn(BOUNDS);
    when(propertyReader.getSimulationSet()).thenReturn(SIMULATION_SET);
    when(propertyReader.getRectangleDimensionsSet()).thenReturn(RECTANGLE_DIMENSIONS_SET);
    when(propertyReader.getFontSet()).thenReturn(FONT_SET);
    when(propertyReader.getBackgroundSet()).thenReturn(BACKGROUND_SET);
    when(propertyReader.isIndependent()).thenReturn(INDEPENDENT);
    when(propertyReader.isAbortParent()).thenReturn(ABORT_PARENT);
    when(propertyReader.isWaitForCompletion()).thenReturn(WAIT_FOR_COMPLETION);
    when(propertyReader.isAsync()).thenReturn(IS_ASYNC);
    when(propertyReader.isSequential()).thenReturn(SEQUENTIAL);
    when(propertyReader.getCollectionOutput()).thenReturn(COLLECTION_OUTPUT);
    when(propertyReader.getCollectionInput()).thenReturn(COLLECTION_INPUT);
    when(propertyReader.getDataInput()).thenReturn(DATA_INPUT);
    when(propertyReader.getDataOutput()).thenReturn(DATA_OUTPUT);
    when(propertyReader.getCompletionCondition()).thenReturn(COMPLETION_CONDITION);
    when(propertyReader.getOnEntryAction()).thenReturn(ON_ENTRY_ACTION);
    when(propertyReader.getOnExitAction()).thenReturn(ON_EXIT_ACTION);
    when(propertyReader.getSlaDueDate()).thenReturn(SLA_DUE_DATE);
    converter = new CallActivityConverter(factoryManager, propertyReaderFactory);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) SimulationSet(org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) Before(org.junit.Before)

Example 7 with BackgroundSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet in project kie-wb-common by kiegroup.

the class ReusableSubprocessConverterTest method setUp.

@Before
public void setUp() {
    when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
    DataIOSet ioSet = mock(DataIOSet.class);
    when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
    final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
    node = new NodeImpl<>(UUID);
    node.setContent(view);
    converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
Also used : BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) CallActivity(org.eclipse.bpmn2.CallActivity) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) WaitForCompletion(org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AbortParent(org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) IsCase(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) CalledElement(org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement) Before(org.junit.Before)

Example 8 with BackgroundSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet in project kie-wb-common by kiegroup.

the class GenericServiceTaskTest method setAndGetExecutionSet.

@Test
public void setAndGetExecutionSet() {
    GenericServiceTask genericServiceTask = new GenericServiceTask(new TaskGeneralSet(new Name("Service Task"), new Documentation("")), new GenericServiceTaskExecutionSet(), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new TaskType(TaskTypes.SERVICE_TASK), new AdvancedData());
    assertEquals(new GenericServiceTaskExecutionSet(), genericServiceTask.getExecutionSet());
    GenericServiceTaskExecutionSet set = new GenericServiceTaskExecutionSet();
    genericServiceTask.setExecutionSet(set);
    assertEquals(set, genericServiceTask.getExecutionSet());
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) SimulationSet(org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) GenericServiceTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) TaskType(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskType) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) Test(org.junit.Test)

Example 9 with BackgroundSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet in project kie-wb-common by kiegroup.

the class IntermediateErrorEventCatchingTest method setUp.

@Before
public void setUp() {
    general = mock(BPMNGeneralSet.class);
    backgroundSet = mock(BackgroundSet.class);
    fontSet = mock(FontSet.class);
    dimensionSet = mock(CircleDimensionSet.class);
    dataIOSet = mock(DataIOSet.class);
    advancedData = new AdvancedData();
    cancellingErrorEventExecutionSet = mock(CancellingErrorEventExecutionSet.class);
    tested = new IntermediateErrorEventCatching(general, backgroundSet, fontSet, dimensionSet, dataIOSet, advancedData, cancellingErrorEventExecutionSet);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) CircleDimensionSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) Before(org.junit.Before)

Example 10 with BackgroundSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet in project kie-wb-common by kiegroup.

the class DataObjectTest method testNotEquals.

@Test
public void testNotEquals() {
    DataObject dataObject1 = new DataObject();
    DataObject dataObject2 = new DataObject();
    dataObject1.setName(new Name("dataObject1"));
    dataObject2.setName(new Name("dataObject2"));
    // Test Name
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setName(new Name("dataObject1"));
    assertEquals(dataObject1, dataObject2);
    // Test Type
    DataObjectType dataObjectType = new DataObjectType();
    dataObjectType.setValue(new DataObjectTypeValue("someType"));
    dataObject2.setType(dataObjectType);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setType(new DataObjectType());
    assertEquals(dataObject1, dataObject2);
    // Test General Set
    BPMNGeneralSet generalSet = new BPMNGeneralSet();
    generalSet.setName(new Name("someName"));
    dataObject2.setGeneral(generalSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setGeneral(new BPMNGeneralSet());
    assertEquals(dataObject1, dataObject2);
    // Test Background Set
    BackgroundSet backgroundSet = new BackgroundSet();
    backgroundSet.setBgColor(new BgColor("Black"));
    dataObject2.setBackgroundSet(backgroundSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setBackgroundSet(new BackgroundSet());
    assertEquals(dataObject1, dataObject2);
    // Test Font Set
    FontSet fontSet = new FontSet();
    fontSet.setFontSize(new FontSize(11.0));
    dataObject2.setFontSet(fontSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setFontSet(new FontSet());
    assertEquals(dataObject1, dataObject2);
    // Test Dimension Set
    RectangleDimensionsSet rectangleDimensionsSet = new RectangleDimensionsSet(100.0, 100.0);
    dataObject2.setDimensionsSet(rectangleDimensionsSet);
    assertNotEquals(dataObject1, dataObject2);
    // Reset
    dataObject2.setDimensionsSet(new RectangleDimensionsSet());
    assertEquals(dataObject1, dataObject2);
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) FontSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) Test(org.junit.Test)

Aggregations

BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)15 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)12 Test (org.junit.Test)11 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)11 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)11 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)8 CircleDimensionSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet)7 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)5 Before (org.junit.Before)4 EscalationRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef)4 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)4 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)3 CancellingEscalationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.CancellingEscalationEventExecutionSet)3 InterruptingEscalationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.InterruptingEscalationEventExecutionSet)3 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)3 SimulationSet (org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet)3 ReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess)2 ActivityRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef)2 CompensationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2