Search in sources :

Example 1 with BgColor

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor 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);
}
Also used : LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) Test(org.junit.Test)

Example 2 with BgColor

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

the class BaseArtifactsTest method testEquals.

@Test
public void testEquals() {
    assertTrue(tested.equals(new DataObject()));
    assertFalse(tested.equals(""));
    final DataObject dataObject = new DataObject();
    BgColor color = new BgColor();
    color.setValue("Black");
    dataObject.getBackgroundSet().setBgColor(color);
    assertFalse(tested.equals(dataObject));
    tested.getBackgroundSet().setBgColor(color);
    assertTrue(tested.equals(dataObject));
    dataObject.getFontSet().setFontSize(new FontSize(11.0));
    assertFalse(tested.equals(dataObject));
    tested.getFontSet().setFontSize(new FontSize(11.0));
    assertTrue(tested.equals(dataObject));
    dataObject.getDimensionsSet().setHeight(new Height(11.0));
    assertFalse(tested.equals(dataObject));
    tested.getDimensionsSet().setHeight(new Height(11.0));
    assertTrue(tested.equals(dataObject));
}
Also used : FontSize(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize) Height(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Height) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) Test(org.junit.Test)

Example 3 with BgColor

use of org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor 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)

Example 4 with BgColor

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

the class HashCodeAndEqualityTest method testIntermediateLinkThrowingEventEquals.

@Test
public void testIntermediateLinkThrowingEventEquals() {
    IntermediateLinkEventThrowing linkEvent = new IntermediateLinkEventThrowing();
    IntermediateLinkEventThrowing linkEvent2 = new IntermediateLinkEventThrowing();
    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);
}
Also used : LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)4 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)3 LinkEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet)2 LinkRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)2 FontSize (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize)2 DataObjectType (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType)1 DataObjectTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)1 Height (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Height)1 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)1 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)1 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1