Search in sources :

Example 1 with DefaultImport

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

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

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

the class DefaultImportsEditorWidgetTest method createImport.

@Test
public void createImport() {
    DefaultImport result = tested.createImport();
    assertNotNull(result);
    assertNull(result.getClassName());
}
Also used : DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) Test(org.junit.Test)

Example 4 with DefaultImport

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

the class DefaultImportListItemWidgetViewTest method setModel.

@Test
public void setModel() {
    DefaultImport model = mock(DefaultImport.class);
    tested.setModel(model);
    verify(defaultImportDataBinder).setModel(model);
}
Also used : DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) Test(org.junit.Test)

Example 5 with DefaultImport

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

the class DefaultImportsElementTest method importTypeDataOf.

@Test
public void importTypeDataOf() {
    DefaultImportsElement defaultImportsElement = new DefaultImportsElement(NAME);
    DefaultImport defaultImport = new DefaultImport(CLASS_NAME);
    ImportType importType = defaultImportsElement.importTypeDataOf(defaultImport);
    assertEquals(CLASS_NAME, importType.getName());
}
Also used : ImportType(org.jboss.drools.ImportType) DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) Test(org.junit.Test)

Aggregations

DefaultImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport)20 Test (org.junit.Test)14 ImportsValue (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.ImportsValue)8 WSDLImport (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport)6 Imports (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports)5 ArrayList (java.util.ArrayList)3 Before (org.junit.Before)3 ImportType (org.jboss.drools.ImportType)2 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)2 DiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 BaseElement (org.eclipse.bpmn2.BaseElement)1 Definitions (org.eclipse.bpmn2.Definitions)1 BPMNDiagram (org.eclipse.bpmn2.di.BPMNDiagram)1 EStructuralFeatureImpl (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl)1 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)1 ValueListBox (org.gwtbootstrap3.client.ui.ValueListBox)1 TypedFactoryManager (org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager)1