use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class BPMNProjectDiagramFactoryTest method setup.
@Before
public void setup() {
diagram = new BPMNDiagramImpl();
id = new Id();
name = new Name();
packageProperty = new Package();
diagram.setDiagramSet(diagramSet);
View<BPMNDiagram> diagramNodeContent = new ViewImpl<>(diagram, bounds);
graphNodes.add(diagramNode);
when(diagramNode.getUUID()).thenReturn(DIAGRAM_NODE_UUID);
when(diagramNode.getContent()).thenReturn(diagramNodeContent);
when(graph.nodes()).thenReturn(graphNodes);
when(diagramSet.getId()).thenReturn(id);
when(diagramSet.getPackageProperty()).thenReturn(packageProperty);
when(diagramSet.getName()).thenReturn(name);
when(metadata.getModuleName()).thenReturn(MODULE);
tested = new BPMNProjectDiagramFactoryImpl();
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class GraphUtilsTest method testReusableSubprocess.
@Test
public void testReusableSubprocess() {
Element<View<ReusableSubprocess>> element = new NodeImpl<>("UUID");
View<ReusableSubprocess> reusableSubprocessView = new ViewImpl<>(new ReusableSubprocess(), Bounds.create());
element.setContent(reusableSubprocessView);
assertTrue(GraphUtils.isReusableSubProcess(element));
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method setUp.
@Before
public void setUp() {
Definitions definitions = bpmn2.createDefinitions();
definitions.getRootElements().add(bpmn2.createProcess());
BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
bpmnDiagram.setPlane(di.createBPMNPlane());
definitions.getDiagrams().add(bpmnDiagram);
definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
Node adHocNode = new NodeImpl("");
View<AdHocSubprocess> adHocContent = new ViewImpl<>(new AdHocSubprocess(), Bounds.create());
adHocNode.setContent(adHocContent);
Node multipleInstanceNode = new NodeImpl("");
View<MultipleInstanceSubprocess> miContent = new ViewImpl<>(new MultipleInstanceSubprocess(), Bounds.create());
multipleInstanceNode.setContent(miContent);
Node embeddedNode = new NodeImpl("");
View<EmbeddedSubprocess> embeddedContent = new ViewImpl<>(new EmbeddedSubprocess(), Bounds.create());
embeddedNode.setContent(embeddedContent);
Node eventNode = new NodeImpl("");
View<EventSubprocess> eventSubprocess = new ViewImpl<>(new EventSubprocess(), Bounds.create());
eventNode.setContent(eventSubprocess);
FactoryManager factoryManager = mock(FactoryManager.class);
when(factoryManager.newElement(any(), eq(getDefinitionId(AdHocSubprocess.class)))).thenReturn(adHocNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(MultipleInstanceSubprocess.class)))).thenReturn(multipleInstanceNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(EmbeddedSubprocess.class)))).thenReturn(embeddedNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(EventSubprocess.class)))).thenReturn(eventNode);
TypedFactoryManager typedFactoryManager = new TypedFactoryManager(factoryManager);
tested = new SubProcessConverter(typedFactoryManager, new PropertyReaderFactory(definitionResolver), definitionResolver, new ConverterFactory(definitionResolver, typedFactoryManager));
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl 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