Search in sources :

Example 1 with ActionSetFactWrapper

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper in project drools-wb by kiegroup.

the class ActionSetFactPluginTest method testSetFactFieldWhenFactPatternIsNotNew.

@Test
public void testSetFactFieldWhenFactPatternIsNotNew() {
    final ActionSetFactWrapper actionWrapper = spy(new ActionSetFactWrapper(plugin));
    final Pattern52 patternMock = patternMock("factType");
    final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
    doReturn(false).when(plugin).isNewFactPattern();
    doReturn(actionWrapper).when(plugin).newActionSetFactWrapper();
    doReturn(patternWrapperMock).when(plugin).patternWrapper();
    doReturn(patternMock).when(model).getConditionPattern(eq("boundName"));
    doReturn("type").when(oracle).getFieldType(eq("factType"), eq("selectedValue"));
    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);
}
Also used : Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) ActionSetFactWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper) PatternWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper) Test(org.junit.Test)

Example 2 with ActionSetFactWrapper

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper in project drools-wb by kiegroup.

the class ActionSetFactPluginTest method testNewActionWrapperWhenColumnIsAnActionSetFactWrapper.

@Test
public void testNewActionWrapperWhenColumnIsAnActionSetFactWrapper() throws Exception {
    final GuidedDecisionTable52 model = mock(GuidedDecisionTable52.class);
    when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
    when(presenter.getModel()).thenReturn(model);
    final ActionWrapper wrapper = plugin.newActionWrapper(mock(ActionSetFieldCol52.class));
    assertTrue(wrapper instanceof ActionSetFactWrapper);
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) ActionSetFactWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper) ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52) Test(org.junit.Test)

Aggregations

ActionSetFactWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper)2 Test (org.junit.Test)2 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)1 ActionWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper)1 PatternWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper)1