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());
}
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());
}
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());
}
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);
}
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();
}
Aggregations