use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testIsNewFactPatternWhenIsNew.
@Test
public void testIsNewFactPatternWhenIsNew() throws Exception {
mockPatterns();
plugin.setEditingPattern(new PatternWrapper("factType", "bananna"));
assertTrue(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 testGetFactType.
@Test
public void testGetFactType() {
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
final String expectedFactType = "factType";
when(patternWrapper.getFactType()).thenReturn(expectedFactType);
when(plugin.patternWrapper()).thenReturn(patternWrapper);
final String actualFactType = plugin.getFactType();
verify(patternWrapper).getFactType();
assertEquals(expectedFactType, actualFactType);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testNewPatternWrapperWhenPatternIsFound.
@Test
public void testNewPatternWrapperWhenPatternIsFound() throws Exception {
final PatternWrapper expectedWrapper = mockPatternWrapper("boundName");
final Set<PatternWrapper> actionWrappers = new HashSet<PatternWrapper>() {
{
add(expectedWrapper);
}
};
doReturn(actionWrappers).when(plugin).getPatterns();
final PatternWrapper actualWrapper = plugin.newPatternWrapper(mockActionWrapper("boundName", "factType"));
assertSame(expectedWrapper, actualWrapper);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetFactFieldWhenColumnIsNotNew.
@Test
public void testSetFactFieldWhenColumnIsNotNew() {
final ActionInsertFactWrapper actionWrapper = mock(ActionInsertFactWrapper.class);
final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
doReturn(false).when(plugin).isNewColumn();
doReturn(true).when(plugin).isNewFactPattern();
doReturn(actionWrapper).when(plugin).editingWrapper();
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);
verify(plugin, never()).newActionInsertFactWrapper();
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class PatternPage method setSelectedEditingPattern.
void setSelectedEditingPattern() {
final String selectedValue = view.getSelectedValue();
final PatternWrapper patternWrapper = findPatternWrapperByKey(selectedValue);
setEditingPattern(patternWrapper);
}
Aggregations