Search in sources :

Example 1 with Imports

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());
}
Also used : DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) ImportsValue(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue) Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport) Test(org.junit.Test)

Example 2 with Imports

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);
}
Also used : Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) ProcessType(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType) Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) ImportsValue(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Executable(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Definitions(org.eclipse.bpmn2.Definitions) ProcessInstanceDescription(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription) GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) AdHoc(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc) WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport) Test(org.junit.Test)

Example 3 with Imports

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();
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Definitions(org.eclipse.bpmn2.Definitions) ProcessInstanceDescription(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription) Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) ProcessType(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType) Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) AdHoc(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc) Executable(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable) Test(org.junit.Test)

Example 4 with Imports

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());
}
Also used : DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) ImportsValue(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue) Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) Test(org.junit.Test)

Example 5 with Imports

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());
}
Also used : Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) Test(org.junit.Test)

Aggregations

Imports (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports)8 Test (org.junit.Test)7 ImportsValue (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue)6 DefaultImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport)5 WSDLImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport)5 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)4 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)3 AdHoc (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc)3 Executable (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable)3 Id (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id)3 Package (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package)3 ProcessInstanceDescription (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription)3 ProcessType (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType)3 Version (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version)3 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)3 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)3 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)3 Definitions (org.eclipse.bpmn2.Definitions)2 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)2 Before (org.junit.Before)1