use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class ReusableSubprocessConverterTest method setUp.
@Before
public void setUp() {
when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
DataIOSet ioSet = mock(DataIOSet.class);
when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
node = new NodeImpl<>(UUID);
node.setContent(view);
converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method testConvertMultipleIntanceSubprocess.
@Test
public void testConvertMultipleIntanceSubprocess() {
final MultipleInstanceSubprocess definition = new MultipleInstanceSubprocess();
setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
final View<MultipleInstanceSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<MultipleInstanceSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertMultipleInstanceSubprocessNode(node);
assertBaseSubprocessExecutionSet(writer);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method testConvertEventSubprocess.
@Test
public void testConvertEventSubprocess() {
final EventSubprocess definition = new EventSubprocess();
setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
final View<EventSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<EventSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertEventSubprocessNode(node);
assertBaseSubprocessExecutionSet(writer);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class DefaultValueUtilitiesTest method makeMockNode.
private Node makeMockNode(final DMNModelInstrumentedBase dmnModel) {
final View view = new ViewImpl<>(dmnModel, Bounds.create(0, 0, 0, 0));
final Node<View, Edge> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
return node;
}
use of org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl in project kie-wb-common by kiegroup.
the class WrapperUtilsTest method testGetDmnElementRefWithNamespaceWhenImportHasAnOddName.
@Test
public void testGetDmnElementRefWithNamespaceWhenImportHasAnOddName() {
final Decision drgElement = mock(Decision.class);
final View<? extends DMNElement> view = new ViewImpl<>(drgElement, null);
final Name drgElementName = mock(Name.class);
final Name importName = mock(Name.class);
final Id id = mock(Id.class);
final org.kie.workbench.common.dmn.api.definition.model.Definitions definitions = mock(org.kie.workbench.common.dmn.api.definition.model.Definitions.class);
final Import anImport = mock(Import.class);
final List<Import> imports = singletonList(anImport);
final String includedModelName = "d.i.v.i.";
final String defaultNamespace = "://default";
final String namespaceName = "include1";
final String importNamespace = "://namespace";
final Map<String, String> nsContext = new HashMap<>();
when(importName.getValue()).thenReturn(includedModelName);
when(anImport.getName()).thenReturn(importName);
when(anImport.getNamespace()).thenReturn(importNamespace);
when(id.getValue()).thenReturn("0000-1111-2222");
when(drgElementName.getValue()).thenReturn(includedModelName + ".Decision");
when(drgElement.getId()).thenReturn(id);
when(drgElement.getName()).thenReturn(drgElementName);
when(drgElement.getParent()).thenReturn(definitions);
nsContext.put(namespaceName, importNamespace);
when(definitions.getImport()).thenReturn(imports);
when(definitions.getNsContext()).thenReturn(nsContext);
final QName actual = getDmnElementRef(definitions, view, defaultNamespace);
assertEquals(defaultNamespace, actual.getNamespaceURI());
assertEquals("include1:0000-1111-2222", actual.getLocalPart());
assertEquals("", actual.getPrefix());
}
Aggregations