Search in sources :

Example 6 with SelectorData

use of org.kie.workbench.common.forms.dynamic.model.config.SelectorData in project kie-wb-common by kiegroup.

the class CalledElementFormProviderTest method getSelectorDataTest.

@Test
public void getSelectorDataTest() {
    SelectorData selectorData = calledElementFormProvider.getSelectorData(context);
    assertEquals(selectorData.getValues().size(), 2);
}
Also used : SelectorData(org.kie.workbench.common.forms.dynamic.model.config.SelectorData) Test(org.junit.Test)

Example 7 with SelectorData

use of org.kie.workbench.common.forms.dynamic.model.config.SelectorData in project kie-wb-common by kiegroup.

the class ProcessVariableProviderTest method testGetSelectorDataWithValues.

@Test
public void testGetSelectorDataWithValues() {
    List<Element> nodes = mockModes();
    when(graph.nodes()).thenReturn(nodes);
    when(graph.getNode(eq(ROOT_NODE_UUID))).thenReturn((Node) nodes.get(0));
    SelectorData selectorData = provider.getSelectorData(renderingContext);
    Map values = selectorData.getValues();
    verifyValues(values);
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Map(java.util.Map) SelectorData(org.kie.workbench.common.forms.dynamic.model.config.SelectorData) Test(org.junit.Test)

Example 8 with SelectorData

use of org.kie.workbench.common.forms.dynamic.model.config.SelectorData in project kie-wb-common by kiegroup.

the class AbstractProcessFilteredNodeProviderBaseTest method testGetSelectorDataWithValues.

@Test
public void testGetSelectorDataWithValues() {
    List<Element> nodes = mockModes();
    when(graph.nodes()).thenReturn(nodes);
    SelectorData selectorData = provider.getSelectorData(renderingContext);
    Map values = selectorData.getValues();
    assertEquals(nodes.size(), values.size());
    verifyValues(values);
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Map(java.util.Map) SelectorData(org.kie.workbench.common.forms.dynamic.model.config.SelectorData) Test(org.junit.Test)

Example 9 with SelectorData

use of org.kie.workbench.common.forms.dynamic.model.config.SelectorData in project kie-wb-common by kiegroup.

the class AdHocOrderingProviderTest method testGetSelectorData.

@Test
public void testGetSelectorData() {
    SelectorData selectorData = provider.getSelectorData(context);
    assertNotNull(selectorData.getValues());
    assertEquals(2, selectorData.getValues().size());
    assertEquals("Sequential", selectorData.getSelectedValue());
    assertEquals(SEQUENTIAL_LABEL, selectorData.getValues().get("Sequential"));
    assertEquals(PARALLEL_LABEL, selectorData.getValues().get("Parallel"));
}
Also used : SelectorData(org.kie.workbench.common.forms.dynamic.model.config.SelectorData) Test(org.junit.Test)

Example 10 with SelectorData

use of org.kie.workbench.common.forms.dynamic.model.config.SelectorData in project kie-wb-common by kiegroup.

the class ProcessVariableProviderTest method testGetSelectorDataWithNoValues.

@Override
public void testGetSelectorDataWithNoValues() {
    List<Element> nodes = new ArrayList<>();
    nodes.add(mockRootNodeWithoutProcessVariables());
    when(graph.nodes()).thenReturn(nodes);
    when(graph.getNode(eq(ROOT_NODE_UUID))).thenReturn((Node) nodes.get(0));
    SelectorData selectorData = provider.getSelectorData(renderingContext);
    Map values = selectorData.getValues();
    assertTrue(values.isEmpty());
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) ArrayList(java.util.ArrayList) Map(java.util.Map) SelectorData(org.kie.workbench.common.forms.dynamic.model.config.SelectorData)

Aggregations

SelectorData (org.kie.workbench.common.forms.dynamic.model.config.SelectorData)12 Test (org.junit.Test)7 Map (java.util.Map)5 Element (org.kie.workbench.common.stunner.core.graph.Element)5 FormEditorRenderingContext (org.kie.workbench.common.forms.editor.service.shared.FormEditorRenderingContext)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 TableColumnMeta (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.TableColumnMeta)2 MultipleSubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition)2 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 Collectors (java.util.stream.Collectors)1 Dependent (javax.enterprise.context.Dependent)1 Inject (javax.inject.Inject)1 StringUtils (org.apache.commons.lang3.StringUtils)1 DataObjectFinderService (org.kie.workbench.common.forms.data.modeller.service.DataObjectFinderService)1 AbstractDataObjectFinderTest (org.kie.workbench.common.forms.data.modeller.service.impl.AbstractDataObjectFinderTest)1 SystemSelectorDataProvider (org.kie.workbench.common.forms.dynamic.model.config.SystemSelectorDataProvider)1 FormRenderingContext (org.kie.workbench.common.forms.dynamic.service.shared.FormRenderingContext)1 SelectorFieldBaseDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.SelectorFieldBaseDefinition)1