use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetFactFieldWhenFactPatternIsNew.
@Test
public void testSetFactFieldWhenFactPatternIsNew() {
final ActionInsertFactWrapper actionWrapper = mock(ActionInsertFactWrapper.class);
final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
doReturn(true).when(plugin).isNewFactPattern();
doReturn(actionWrapper).when(plugin).newActionInsertFactWrapper();
doReturn(patternWrapperMock).when(plugin).patternWrapper();
doReturn("type").when(oracle).getFieldType(any(), any());
plugin.setFactField("selectedValue");
verify(actionWrapper).setFactField(eq("selectedValue"));
verify(actionWrapper).setFactType(eq("factType"));
verify(actionWrapper).setBoundName(eq("boundName"));
verify(actionWrapper).setType(eq("type"));
verify(plugin).fireChangeEvent(fieldPage);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testEditingPattern.
@Test
public void testEditingPattern() {
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
doReturn(patternWrapper).when(plugin).patternWrapper();
when(patternWrapper.getFactType()).thenReturn("factType");
when(patternWrapper.getBoundName()).thenReturn("boundName");
when(patternWrapper.isNegated()).thenReturn(false);
when(patternWrapper.getEntryPointName()).thenReturn("entryPoint");
final Pattern52 pattern52 = plugin.editingPattern();
assertEquals("factType", pattern52.getFactType());
assertEquals("boundName", pattern52.getBoundName());
assertEquals(false, pattern52.isNegated());
assertEquals("entryPoint", pattern52.getEntryPointName());
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testIsNewFactPatternWhenIsExisting.
@Test
public void testIsNewFactPatternWhenIsExisting() throws Exception {
mockPatterns();
plugin.setEditingPattern(new PatternWrapper("factType", "boundName"));
assertFalse(plugin.isNewFactPattern());
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetEditingPattern.
@Test
public void testSetEditingPattern() {
final ActionWrapper actionWrapper = mock(ActionWrapper.class);
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
when(plugin.editingWrapper()).thenReturn(actionWrapper);
when(patternWrapper.getFactType()).thenReturn("factType");
when(patternWrapper.getBoundName()).thenReturn("boundName");
plugin.setEditingPattern(patternWrapper);
verify(actionWrapper).setFactField("");
verify(actionWrapper).setFactType("factType");
verify(actionWrapper).setBoundName("boundName");
verify(actionWrapper).setType("");
verify(plugin).fireChangeEvent(patternPage);
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetupValuesWhenColumnIsNotNew.
@Test
public void testSetupValuesWhenColumnIsNotNew() throws Exception {
final DTColumnConfig52 column = mock(DTColumnConfig52.class);
final ActionWrapper actionWrapper = mock(ActionWrapper.class);
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
doReturn(column).when(plugin).getOriginalColumnConfig52();
doReturn(actionWrapper).when(plugin).newActionWrapper(column);
doReturn(patternWrapper).when(plugin).newPatternWrapper(actionWrapper);
doReturn(false).when(plugin).isNewColumn();
plugin.setupValues();
verify(plugin).setValueOptionsPageAsCompleted();
verify(plugin).fireChangeEvent(patternPage);
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
}
Aggregations