Search in sources :

Example 11 with DataObjectTypeValue

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

the class VariableProviderTest method testViewAndContent.

@Test
public void testViewAndContent() {
    Node<View<DataObject>, ?> dataObjectNode;
    DataObject dataObject = new DataObject();
    dataObject.getGeneral().getDocumentation().setValue("doc");
    dataObject.setName(new Name("name"));
    dataObject.setType(new DataObjectType(new DataObjectTypeValue("name")));
    dataObjectNode = new NodeImpl<>(UUID.uuid());
    dataObjectNode.setContent(dataObjectView);
    when(dataObjectView.getDefinition()).thenReturn(dataObject);
    boolean isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(dataObjectNode);
    assertTrue(" Must be a BPMN Definition", isBPMNDefinition);
    Node<View<Object>, ?> objectNode = new NodeImpl<>(UUID.uuid());
    objectNode.setContent(otherView);
    when(otherView.getDefinition()).thenReturn(new Object());
    isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(objectNode);
    assertFalse(" Must not be a BPMN Definition", isBPMNDefinition);
    Node<Element, ?> objectNode2 = new NodeImpl<>(UUID.uuid());
    Element someElement = mock(Element.class);
    objectNode2.setContent(someElement);
    isBPMNDefinition = ((VariablesProvider) provider).isBPMNDefinition(objectNode2);
    assertFalse(" Must not be a BPMN Definition", isBPMNDefinition);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Element(org.kie.workbench.common.stunner.core.graph.Element) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) DataObject(org.kie.workbench.common.stunner.bpmn.definition.DataObject) DataObjectTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue) DataObjectType(org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType) Test(org.junit.Test)

Aggregations

DataObjectTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectTypeValue)11 DataObjectType (org.kie.workbench.common.stunner.bpmn.definition.property.artifacts.DataObjectType)8 Test (org.junit.Test)7 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)7 DataObject (org.kie.workbench.common.stunner.bpmn.definition.DataObject)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 Element (org.kie.workbench.common.stunner.core.graph.Element)3 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)3 ArrayList (java.util.ArrayList)1 DataObjectPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.DataObjectPropertyWriter)1 PropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriter)1 TextAnnotationPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.TextAnnotationPropertyWriter)1 DataObjectPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.DataObjectPropertyReader)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)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 FontSize (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSize)1 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)1 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)1