use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testSetEntryPointName.
@Test
public void testSetEntryPointName() throws Exception {
final PatternWrapper pattern = mock(PatternWrapper.class);
doReturn(pattern).when(plugin).patternWrapper();
plugin.setEntryPointName("EntryPointName");
verify(pattern).setEntryPointName("EntryPointName");
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testSetFactField.
@Test
public void testSetFactField() throws Exception {
final PatternWrapper pattern = mock(PatternWrapper.class);
doReturn("FactField").when(editingCol).getFactField();
doReturn(editingCol).when(plugin).editingCol();
doReturn("FactType").when(pattern).getFactType();
doReturn(pattern).when(plugin).patternWrapper();
doReturn(oracle).when(presenter).getDataModelOracle();
plugin.setFactField("FactField");
verify(editingCol).setFactField("FactField");
verify(editingCol).setFieldType(oracle.getFieldType("FactField", "FactType"));
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(operatorPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
verify(plugin).fireChangeEvent(valueOptionsPage);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testGetEntryPointNameWheeunEditingPatternIsNotPresent.
@Test
public void testGetEntryPointNameWheeunEditingPatternIsNotPresent() throws Exception {
final PatternWrapper patternWrapper = new PatternWrapper();
doReturn(patternWrapper).when(plugin).patternWrapper();
final String entryPointName = plugin.getEntryPointName();
assertEquals("", entryPointName);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testGetPatternsWithBRLCondition.
@Test
public void testGetPatternsWithBRLCondition() throws Exception {
final Pattern52 pattern = new Pattern52() {
{
setFactType("FactType");
setBoundName("$fact");
}
};
final BRLConditionColumn brlColumn = new BRLConditionColumn();
final FactPattern fp = new FactPattern("AnotherFact") {
{
setBoundName("$another");
}
};
brlColumn.setDefinition(Collections.singletonList(fp));
doReturn(Arrays.asList(pattern, brlColumn)).when(model).getConditions();
doReturn(pattern).when(model).getConditionPattern(eq("$fact"));
doReturn(new FactPatternPattern52Adaptor(fp)).when(model).getConditionPattern(eq("$another"));
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 testEditingColWhenEditingPatternIsNull.
@Test
public void testEditingColWhenEditingPatternIsNull() throws Exception {
final PatternWrapper pattern = mock(PatternWrapper.class);
doReturn("").when(pattern).getFactType();
doReturn(pattern).when(plugin).patternWrapper();
plugin.editingCol();
verify(plugin).resetFieldAndOperator();
}
Aggregations