use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport 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.DefaultImport 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.DefaultImport 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.DefaultImport in project kie-wb-common by kiegroup.
the class ProcessPropertyReaderTest method getDefaultImports.
@Test
public void getDefaultImports() {
final String CLASS_NAME = "className";
final int QTY = 10;
List<DefaultImport> defaultImports = new ArrayList<>();
for (int i = 0; i < QTY; i++) {
defaultImports.add(new DefaultImport(CLASS_NAME + i));
}
CustomElement.defaultImports.of(process).set(defaultImports);
List<DefaultImport> result = tested.getDefaultImports();
assertEquals(QTY, result.size());
for (int i = 0; i < result.size(); i++) {
assertEquals(CLASS_NAME + i, result.get(i).getClassName());
}
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport in project kie-wb-common by kiegroup.
the class DefaultImportListItemWidgetViewTest method initListItem.
@Test
public void initListItem() {
DefaultImport defaultImport = tested.getModel();
defaultImport.setClassName(null);
tested.initListItem();
defaultImport = tested.getModel();
defaultImport.setClassName("");
tested.initListItem();
defaultImport = tested.getModel();
defaultImport.setClassName("randomValue");
Map<String, String> map = new HashMap<>();
map.put("randomValue", "randomValue");
map.put("Boolean", "Boolean");
when(parent.getDataTypes()).thenReturn(map);
tested.initListItem();
defaultImport = tested.getModel();
defaultImport.setClassName("Boolean");
tested.initListItem();
verify(defaultClassNames, times(2)).setValue(null);
verify(defaultClassNames, times(1)).setValue("Boolean");
verify(defaultClassNames, times(1)).setValue("randomValue");
verify(classNamesComboBox, times(4)).setShowCustomValues(true);
verify(classNamesComboBox, times(4)).setListBoxValues(any(ListBoxValues.class));
verify(classNamesComboBox, times(4)).init(tested, true, defaultClassNames, customClassName, false, true, CUSTOM_PROMPT, ENTER_TYPE_PROMPT);
}
Aggregations