use of org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method testMissingActionForBrlAction.
/**
* Check if the message about missing action is thrown
* if the action is defined as BRLAction
*/
@Test
public void testMissingActionForBrlAction() throws Exception {
table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withConditionIntegerColumn("a", "Person", "age", ">").withActionBRLFragment().withData(new Object[][] { { 1, "description", Integer.MIN_VALUE, null } }).buildTable();
fireUpAnalyzer();
assertEquals(1, analyzerProvider.getAnalysisReport().size());
assertContains(analyzerProvider.getAnalysisReport(), RULE_HAS_NO_ACTION, Severity.WARNING);
}
use of org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method ruleHasNoActionShouldNotIgnoreRetract.
@Test
public void ruleHasNoActionShouldNotIgnoreRetract() throws Exception {
table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withConditionIntegerColumn("a", "Person", "age", ">").withRetract().withData(DataBuilderProvider.row(0, "a").end()).buildTable();
fireUpAnalyzer();
assertDoesNotContain(RULE_HAS_NO_ACTION, analyzerProvider.getAnalysisReport());
}
use of org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method testConditionsShouldNotBeIgnored.
// GUVNOR-2546: Verification & Validation: BRL fragments are ignored
@Test
public void testConditionsShouldNotBeIgnored() throws Exception {
table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withConditionBRLColumn().withActionInsertFact("Application", "a", "approved", DataType.TYPE_BOOLEAN).withData(new Object[][] { { 1, "description", null, true }, { 2, "description", null, null } }).buildTable();
fireUpAnalyzer();
assertContains(analyzerProvider.getAnalysisReport(), EMPTY_RULE, Severity.WARNING, 2);
assertDoesNotContain(EMPTY_RULE, analyzerProvider.getAnalysisReport(), 1);
assertContains(analyzerProvider.getAnalysisReport(), RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, Severity.NOTE, 1);
assertDoesNotContain(RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, analyzerProvider.getAnalysisReport(), 2);
}
use of org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method testMissingActionForBrlCondition.
/**
* Check if the message about missing action is thrown
* if the condition is defined as BRLCondition
*/
@Test
public void testMissingActionForBrlCondition() throws Exception {
table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withConditionBRLColumn().withActionInsertFact("Application", "a", "approved", DataType.TYPE_BOOLEAN).withData(new Object[][] { { 1, "description", "value", null } }).buildTable();
fireUpAnalyzer();
assertEquals(1, analyzerProvider.getAnalysisReport().size());
assertContains(analyzerProvider.getAnalysisReport(), RULE_HAS_NO_ACTION, Severity.WARNING);
}
Aggregations