Search in sources :

Example 6 with ImportsValue

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

the class DefaultImportsEditorWidgetTest method testAddDataTypesFromImports.

@Test
public void testAddDataTypesFromImports() {
    ImportsValue value = new ImportsValue();
    DefaultImport defaultImport = new DefaultImport();
    tested.refreshFormsEvent = refreshFormsEvent;
    defaultImport.setClassName("MyString");
    value.addImport(defaultImport);
    tested.addDataTypes(value);
    verify(dataTypeNamesService, times(1)).add(eq("MyString"), any());
    value = new ImportsValue();
    defaultImport = new DefaultImport();
    defaultImport.setClassName("String");
    value.addImport(defaultImport);
    tested.addDataTypes(value);
    verify(dataTypeNamesService, times(0)).add(eq("String"), anyString());
    value = new ImportsValue();
    defaultImport = new DefaultImport();
    defaultImport.setClassName("Object");
    value.addImport(defaultImport);
    tested.addDataTypes(value);
    verify(dataTypeNamesService, times(0)).add(eq("Object"), anyString());
}
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) Test(org.junit.Test)

Example 7 with ImportsValue

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

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

the class DiagramSetTest method testSetImports.

@Test
public void testSetImports() {
    DefaultImport defaultImport = new DefaultImport("className");
    WSDLImport wsdlImport = new WSDLImport("location", "namespace");
    ImportsValue importsValue = new ImportsValue();
    importsValue.addImport(defaultImport);
    importsValue.addImport(wsdlImport);
    Imports imports = new Imports(importsValue);
    DiagramSet diagramSet = new DiagramSet();
    diagramSet.setImports(imports);
    assertEquals(imports, diagramSet.getImports());
}
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 9 with ImportsValue

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

the class DiagramSetTest method testEquals.

@Test
public void testEquals() {
    DiagramSet a = new DiagramSet();
    DiagramSet b = new DiagramSet();
    assertEquals(a, b);
    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, d);
}
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 10 with ImportsValue

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

the class ImportsEditor method ok.

@Override
public void ok() {
    if (callback != null) {
        ImportsValue importsValue = new ImportsValue(view.getDefaultImports(), view.getWSDLImports());
        callback.getData(importsValue);
    }
    view.hideView();
}
Also used : ImportsValue(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue)

Aggregations

ImportsValue (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue)15 Test (org.junit.Test)10 DefaultImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport)8 WSDLImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport)7 Imports (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports)6 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)3 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)2 AdHoc (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc)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 Definitions (org.eclipse.bpmn2.Definitions)1 Before (org.junit.Before)1 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)1