use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method testNotEqualsAdvancedData.
@Test
public void testNotEqualsAdvancedData() {
BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
RootProcessAdvancedData rootProcessAdvancedData = new RootProcessAdvancedData(new GlobalVariables(), new MetaDataAttributes());
assertNotEquals(rootProcessAdvancedData, BPMNDiagramImpl.getAdvancedData());
assertNotEquals(rootProcessAdvancedData.getGlobalVariables(), BPMNDiagramImpl.getAdvancedData().getGlobalVariables());
assertNotEquals(rootProcessAdvancedData.getMetaDataAttributes(), BPMNDiagramImpl.getAdvancedData().getMetaDataAttributes());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method testBPMNDiagramEquals.
@Test
public void testBPMNDiagramEquals() {
BPMNDiagramImpl BPMNDiagramImpl = createValidBpmnDiagram();
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
BPMNDiagramImpl BPMNDiagramImpl2 = createValidBpmnDiagram();
BPMNDiagramImpl2.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables("id:"), new MetaDataAttributes("securityRoles3ß<![CDATA[employees,clients]]>")));
assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes("securityRoles3ß<![CDATA[employees,clients]]>")));
assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables("id:"), new MetaDataAttributes(METADATA)));
assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl.setAdvancedData(new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA)));
assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl.setDimensionsSet(new RectangleDimensionsSet(10d, 10d));
BPMNDiagramImpl2.setDimensionsSet(new RectangleDimensionsSet(20d, 20d));
assertNotEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
BPMNDiagramImpl2.setDimensionsSet(new RectangleDimensionsSet(10d, 10d));
assertEquals(BPMNDiagramImpl, BPMNDiagramImpl2);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.
the class BPMNDiagramTest method testNotAdvancedData.
@Test
public void testNotAdvancedData() {
ProcessData processData = new ProcessData(GLOBAL_VARIABLES);
RootProcessAdvancedData rootProcessAdvancedData = new RootProcessAdvancedData(new GlobalVariables(GLOBAL_VARIABLES), new MetaDataAttributes(METADATA));
assertNotEquals(rootProcessAdvancedData, processData);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallGlobalVariables.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallGlobalVariables() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_GLOBALVARIABLES);
assertDiagram(diagram, 1);
assertEquals("Global Variables", diagram.getMetadata().getTitle());
BPMNDiagramImpl bpmnDiagram = getBpmnDiagram(diagram);
GlobalVariables variables = bpmnDiagram.getAdvancedData().getGlobalVariables();
assertEquals("GV1:Boolean,GV2:Boolean,GV3:Integer", variables.getValue());
Node<? extends Definition, ?> diagramNode = diagram.getGraph().getNode("__-CvwCveEemCffTTkSwXXQ");
assertTrue(diagramNode.getContent().getDefinition() instanceof BPMNDiagram);
bpmnDiagram = (BPMNDiagramImpl) diagramNode.getContent().getDefinition();
assertTrue(bpmnDiagram.getDiagramSet() != null);
assertTrue(bpmnDiagram.getAdvancedData().getGlobalVariables() != null);
variables = bpmnDiagram.getAdvancedData().getGlobalVariables();
assertEquals("GV1:Boolean,GV2:Boolean,GV3:Integer", variables.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.GlobalVariables in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method globalVariables.
@Test
public void globalVariables() {
GlobalVariables globalVariables = new GlobalVariables("GV1:Boolean,GV2:Boolean,GV3:Integer");
p.setGlobalVariables(globalVariables);
String globalVariablesString = CustomElement.globalVariables.of(p.getProcess()).get();
assertThat(globalVariablesString).isEqualTo("GV1:Boolean,GV2:Boolean,GV3:Integer");
}
Aggregations