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