use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports in project kie-wb-common by kiegroup.
the class DiagramSetTest method testHashCode.
@Test
public void testHashCode() {
DiagramSet a = new DiagramSet();
DiagramSet b = new DiagramSet();
assertEquals(a.hashCode(), b.hashCode());
DefaultImport defaultImport = new DefaultImport("className");
WSDLImport wsdlImport = new WSDLImport("location", "namespace");
ImportsValue importsValue = new ImportsValue();
importsValue.addImport(defaultImport);
importsValue.addImport(wsdlImport);
DiagramSet c = new DiagramSet();
c.setImports(new Imports(importsValue));
DiagramSet d = new DiagramSet();
assertNotEquals(c.hashCode(), d.hashCode());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports in project kie-wb-common by kiegroup.
the class DefinitionsConverterTest method toDefinitions.
@Test
public void toDefinitions() {
final String LOCATION = "Location";
final String NAMESPACE = "Namespace";
ImportsValue importsValue = new ImportsValue();
importsValue.addImport(new WSDLImport(LOCATION, NAMESPACE));
BPMNDiagramImpl diag = new BPMNDiagramImpl();
diag.setDiagramSet(new DiagramSet(new Name(), new Documentation(), new Id(), new Package(), new ProcessType(), new Version(), new AdHoc(false), new ProcessInstanceDescription(), new Imports(importsValue), new Executable(true), new SLADueDate()));
GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl();
NodeImpl x = new NodeImpl("x");
x.setContent(new ViewImpl<>(diag, Bounds.create()));
nodeStore.add(x);
ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory());
DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory());
Definitions definitions = definitionsConverter.toDefinitions();
assertImportsValue(LOCATION, NAMESPACE, definitions);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports in project kie-wb-common by kiegroup.
the class DefinitionsConverterTest method JBPM_7526_shouldSetExporter.
@Test
public void JBPM_7526_shouldSetExporter() {
GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl();
NodeImpl x = new NodeImpl("x");
BPMNDiagramImpl diag = new BPMNDiagramImpl();
diag.setDiagramSet(new DiagramSet(new Name("x"), new Documentation("doc"), new Id("x"), new Package("org.jbpm"), new ProcessType(), new Version("1.0"), new AdHoc(false), new ProcessInstanceDescription("descr"), new Imports(), new Executable(true), new SLADueDate("")));
x.setContent(new ViewImpl<>(diag, Bounds.create()));
nodeStore.add(x);
ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory());
DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory());
Definitions definitions = definitionsConverter.toDefinitions();
assertThat(definitions.getExporter()).isNotBlank();
assertThat(definitions.getExporterVersion()).isNotBlank();
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports in project kie-wb-common by kiegroup.
the class RootProcessConverterTest method testImports.
@Test
public void testImports() {
DiagramSet diagramSet = createDiagramSet();
Imports imports = diagramSet.getImports();
assertNotNull(imports);
ImportsValue importsValue = imports.getValue();
assertNotNull(importsValue);
List<DefaultImport> defaultImports = importsValue.getDefaultImports();
assertNotNull(defaultImports);
assertFalse(defaultImports.isEmpty());
DefaultImport defaultImport = defaultImports.get(0);
assertNotNull(defaultImport);
assertEquals(getClass().getName(), defaultImport.getClassName());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports in project kie-wb-common by kiegroup.
the class DiagramSetTest method testGetImports.
@Test
public void testGetImports() {
DiagramSet diagramSet = new DiagramSet();
assertEquals(new Imports(), diagramSet.getImports());
}
Aggregations