Search in sources :

Example 11 with ActionWrapper

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

the class ActionSetFactPluginTest method mockActionWrapper.

private ActionWrapper mockActionWrapper(final String boundName, final String factType) {
    final ActionWrapper wrapper = mock(ActionWrapper.class);
    when(wrapper.getBoundName()).thenReturn(boundName);
    when(wrapper.getFactType()).thenReturn(factType);
    return wrapper;
}
Also used : ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper)

Example 12 with ActionWrapper

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

the class ActionSetFactPluginTest method testSetValueList.

@Test
public void testSetValueList() {
    final ActionWrapper actionWrapper = mock(ActionWrapper.class);
    final String valueList = "valueList";
    doReturn(actionWrapper).when(plugin).editingWrapper();
    plugin.setValueList(valueList);
    verify(actionWrapper).setValueList(valueList);
}
Also used : ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper) Test(org.junit.Test)

Example 13 with ActionWrapper

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper 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);
}
Also used : PatternWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper) ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper) Test(org.junit.Test)

Example 14 with ActionWrapper

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper 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);
}
Also used : DTColumnConfig52(org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52) PatternWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper) ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper) Test(org.junit.Test)

Example 15 with ActionWrapper

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

the class ActionSetFactPluginTest method testGetFactField.

@Test
public void testGetFactField() {
    final ActionWrapper actionWrapper = mock(ActionWrapper.class);
    final String expectedFactField = "factField";
    when(actionWrapper.getFactField()).thenReturn(expectedFactField);
    when(plugin.editingWrapper()).thenReturn(actionWrapper);
    final String actualFactField = plugin.getFactField();
    verify(actionWrapper).getFactField();
    assertEquals(expectedFactField, actualFactField);
}
Also used : ActionWrapper(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper) Test(org.junit.Test)

Aggregations

ActionWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWrapper)17 Test (org.junit.Test)16 PatternWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper)3 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)2 HashSet (java.util.HashSet)1 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)1 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1 DTColumnConfig52 (org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52)1 ActionInsertFactWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionInsertFactWrapper)1 ActionSetFactWrapper (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper)1