Search in sources :

Example 1 with LimitedGuidedDecisionTableBuilder

use of org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder in project drools-wb by kiegroup.

the class DecisionTableAnalyzerTest method testRedundancy.

@Test
public void testRedundancy() throws Exception {
    table52 = new LimitedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withIntegerColumn("a", "Person", "age", "==", 0).withAction("a", "Person", "approved", new DTCellValue52() {

        {
            setBooleanValue(true);
        }
    }).withAction("a", "Person", "approved", new DTCellValue52() {

        {
            setBooleanValue(true);
        }
    }).withData(new Object[][] { { 1, "description", true, true, false }, { 2, "description", true, false, true } }).buildTable();
    fireUpAnalyzer();
    assertContains(analyzerProvider.getAnalysisReport(), REDUNDANT_ROWS, Severity.WARNING, 1, 2);
    assertNotNull(analyzerProvider.getStatus());
}
Also used : Import(org.kie.soup.project.datamodel.imports.Import) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) LimitedGuidedDecisionTableBuilder(org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder) Test(org.junit.Test)

Example 2 with LimitedGuidedDecisionTableBuilder

use of org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder in project drools-wb by kiegroup.

the class DecisionTableAnalyzerConflictResolverLimitedDTableTest method testConflict.

@Test
public void testConflict() throws Exception {
    table52 = new LimitedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withIntegerColumn("a", "Person", "age", "==", 0).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {

        {
            setBooleanValue(true);
        }
    }).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {

        {
            setBooleanValue(false);
        }
    }).withData(new Object[][] { { 1, "description", true, true, false }, { 2, "description", true, false, true } }).buildTable();
    fireUpAnalyzer();
    assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 2);
    assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 1);
}
Also used : Import(org.kie.soup.project.datamodel.imports.Import) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) LimitedGuidedDecisionTableBuilder(org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder) Test(org.junit.Test)

Aggregations

DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)2 LimitedGuidedDecisionTableBuilder (org.drools.workbench.services.verifier.webworker.client.testutil.LimitedGuidedDecisionTableBuilder)2 Test (org.junit.Test)2 Import (org.kie.soup.project.datamodel.imports.Import)2