use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testSetupPatternWrapper.
@Test
public void testSetupPatternWrapper() throws Exception {
final Pattern52 pattern52 = new Pattern52() {
{
setFactType("FactType");
setBoundName("BoundName");
setEntryPointName("EntryPointName");
setNegated(true);
}
};
when(plugin.getEditingPattern()).thenReturn(pattern52);
plugin.setupPatternWrapper();
final PatternWrapper patternWrapper = plugin.patternWrapper();
assertEquals(patternWrapper.getFactType(), "FactType");
assertEquals(patternWrapper.getBoundName(), "BoundName");
assertEquals(patternWrapper.getEntryPointName(), "EntryPointName");
assertEquals(patternWrapper.isNegated(), true);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testGetFactType.
@Test
public void testGetFactType() throws Exception {
final PatternWrapper pattern = mock(PatternWrapper.class);
final String expectedFactType = "FactType";
doReturn(expectedFactType).when(pattern).getFactType();
doReturn(pattern).when(plugin).patternWrapper();
final String factType = plugin.getFactType();
assertEquals(expectedFactType, factType);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testEditingColWhenEditingPatternIsNotNull.
@Test
public void testEditingColWhenEditingPatternIsNotNull() throws Exception {
final PatternWrapper pattern = mock(PatternWrapper.class);
doReturn("factType").when(pattern).getFactType();
doReturn(pattern).when(plugin).patternWrapper();
plugin.editingCol();
verify(plugin, never()).resetFieldAndOperator();
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testGetPatterns.
@Test
public void testGetPatterns() throws Exception {
final Pattern52 pattern = new Pattern52() {
{
setFactType("FactType");
setBoundName("$fact");
}
};
doReturn(Collections.singletonList(pattern)).when(model).getConditions();
doReturn(pattern).when(model).getConditionPattern(eq("$fact"));
final Set<PatternWrapper> patterns = plugin.getPatterns();
assertEquals(1, patterns.size());
assertTrue(patterns.contains(new PatternWrapper("FactType", "$fact", false)));
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testAppendColumnWhenColumnIsNew.
@Test
public void testAppendColumnWhenColumnIsNew() throws Exception {
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
final Pattern52 pattern52 = mock(Pattern52.class);
doReturn(true).when(plugin).isNewColumn();
doReturn(editingCol).when(plugin).editingCol();
doReturn(patternWrapper).when(plugin).patternWrapper();
doReturn(pattern52).when(plugin).editingPattern();
plugin.appendColumn();
verify(presenter).appendColumn(pattern52, editingCol);
}
Aggregations