Search in sources :

Example 1 with WSDLImport

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport 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 WSDLImport

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.

the class PropertyWriterUtils method toImport.

public static Import toImport(WSDLImport wsdlImport) {
    Import imp = Bpmn2Factory.eINSTANCE.createImport();
    imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
    imp.setLocation(wsdlImport.getLocation());
    imp.setNamespace(wsdlImport.getNamespace());
    return imp;
}
Also used : WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport) Import(org.eclipse.bpmn2.Import)

Example 3 with WSDLImport

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport 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 4 with WSDLImport

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.

the class DefinitionsPropertyWriterTest method setWSDLImports.

@Test
public void setWSDLImports() {
    final String LOCATION = "location";
    final String NAMESPACE = "namespace";
    final int QTY = 10;
    List<WSDLImport> wsdlImports = new ArrayList<>();
    for (int i = 0; i < QTY; i++) {
        wsdlImports.add(new WSDLImport(LOCATION + i, NAMESPACE + i));
    }
    tested.setWSDLImports(wsdlImports);
    List<Import> imports = definitions.getImports();
    assertEquals(QTY, imports.size());
    for (int i = 0; i < QTY; i++) {
        assertEquals(LOCATION + i, imports.get(i).getLocation());
        assertEquals(NAMESPACE + i, imports.get(i).getNamespace());
    }
}
Also used : WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport) Import(org.eclipse.bpmn2.Import) ArrayList(java.util.ArrayList) WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport) Test(org.junit.Test)

Example 5 with WSDLImport

use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.

the class ImportsFieldEditorWidget method copyImportsValue.

protected ImportsValue copyImportsValue(ImportsValue importsValue) {
    ImportsValue copy = new ImportsValue();
    if (importsValue != null) {
        for (DefaultImport defaultImport : importsValue.getDefaultImports()) {
            DefaultImport importCopy = new DefaultImport();
            importCopy.setClassName(defaultImport.getClassName());
            copy.addImport(importCopy);
        }
        for (WSDLImport wsdlImport : importsValue.getWSDLImports()) {
            WSDLImport importCopy = new WSDLImport();
            importCopy.setLocation(wsdlImport.getLocation());
            importCopy.setNamespace(wsdlImport.getNamespace());
            copy.addImport(importCopy);
        }
    }
    return copy;
}
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) WSDLImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport)

Aggregations

WSDLImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport)12 Test (org.junit.Test)8 ImportsValue (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue)7 DefaultImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport)6 Import (org.eclipse.bpmn2.Import)5 Imports (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports)5 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)2 AdHoc (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc)2 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)2 Executable (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable)2 Id (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id)2 Package (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package)2 ProcessInstanceDescription (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription)2 ProcessType (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType)2 Version (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)2 ArrayList (java.util.ArrayList)1 Definitions (org.eclipse.bpmn2.Definitions)1