Search in sources :

Example 6 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 7 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 8 with DefaultImport

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

the class ProcessPropertyWriterTest method defaultImports.

@Test
public void defaultImports() {
    List<DefaultImport> defaultImports = new ArrayList<>();
    defaultImports.add(new DefaultImport("className1"));
    defaultImports.add(new DefaultImport("className2"));
    defaultImports.add(new DefaultImport("className3"));
    p.setDefaultImports(defaultImports);
    List<DefaultImport> result = CustomElement.defaultImports.of(p.getProcess()).get();
    assertEquals(3, result.size());
    assertEquals("className1", result.get(0).getClassName());
    assertEquals("className2", result.get(1).getClassName());
    assertEquals("className3", result.get(2).getClassName());
}
Also used : DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 9 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 extensionOf.

@Test
public void extensionOf() {
    DefaultImportsElement defaultImportsElement = new DefaultImportsElement(NAME);
    DefaultImport defaultImport = new DefaultImport(CLASS_NAME);
    ImportType importType = defaultImportsElement.importTypeDataOf(defaultImport);
    FeatureMap.Entry entry = defaultImportsElement.extensionOf(defaultImport);
    assertNotNull(entry);
    assertTrue(entry instanceof EStructuralFeatureImpl.SimpleFeatureMapEntry);
    assertEquals(DOCUMENT_ROOT__IMPORT, entry.getEStructuralFeature());
    assertNotNull((ImportType) entry.getValue());
    assertEquals(importType.getName(), ((ImportType) entry.getValue()).getName());
}
Also used : FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) ImportType(org.jboss.drools.ImportType) DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) EStructuralFeatureImpl(org.eclipse.emf.ecore.impl.EStructuralFeatureImpl) Test(org.junit.Test)

Example 10 with DefaultImport

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

the class RootProcessConverterTest method setUp.

@Before
@SuppressWarnings("all")
public void setUp() {
    Definitions definitions = bpmn2.createDefinitions();
    process = bpmn2.createProcess();
    definitions.getRootElements().add(process);
    BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
    bpmnDiagram.setPlane(di.createBPMNPlane());
    definitions.getDiagrams().add(bpmnDiagram);
    ElementDefinition.getExtensionElements(process).add(DefaultImportsElement.extensionOf(new DefaultImport(getClass().getName())));
    definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
    Node node = new NodeImpl("");
    View<BPMNDiagramImpl> content = new ViewImpl<>(new BPMNDiagramImpl(), Bounds.create());
    node.setContent(content);
    FactoryManager factoryManager = mock(FactoryManager.class);
    when(factoryManager.newElement(any(), eq(getDefinitionId(BPMNDiagramImpl.class)))).thenReturn(node);
    TypedFactoryManager typedFactoryManager = new TypedFactoryManager(factoryManager);
    tested = new RootProcessConverter(typedFactoryManager, new PropertyReaderFactory(definitionResolver), definitionResolver, new ConverterFactory(definitionResolver, typedFactoryManager));
}
Also used : TypedFactoryManager(org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager) DefinitionResolver(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Definitions(org.eclipse.bpmn2.Definitions) Node(org.kie.workbench.common.stunner.core.graph.Node) PropertyReaderFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.PropertyReaderFactory) ConverterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.ConverterFactory) BPMNDiagram(org.eclipse.bpmn2.di.BPMNDiagram) DefaultImport(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.DefaultImport) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) TypedFactoryManager(org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager) FactoryManager(org.kie.workbench.common.stunner.core.api.FactoryManager) Before(org.junit.Before)

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