Search in sources :

Example 21 with Analyzer

use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.

the class DecisionTableAnalyzerSubsumptionResolverTest method testRedundantConditions001.

@Test
public void testRedundantConditions001() throws Exception {
    GuidedDecisionTable52 table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withEnumColumn("a", "Person", "name", "==", "Toni,Eder").withConditionIntegerColumn("a", "Person", "name", "==").withData(new Object[][] { { 1, "description", "Toni", "Toni" } }).buildTable();
    Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
    analyzer.resetChecks();
    analyzer.analyze();
    assertContains(analyzerProvider.getAnalysisReport(), REDUNDANT_CONDITIONS_TITLE, Severity.NOTE);
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Import(org.kie.soup.project.datamodel.imports.Import) ExtendedGuidedDecisionTableBuilder(org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder) Analyzer(org.drools.workbench.services.verifier.core.main.Analyzer) Test(org.junit.Test)

Example 22 with Analyzer

use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.

the class BRLFragmentsAnalyzerFromFileTest method testRuleTableGDST.

@Test
public void testRuleTableGDST() throws Exception {
    final String xml = loadResource("RuleTable.gdst");
    final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
    final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
    analyzer.resetChecks();
    analyzer.analyze();
    final Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
    for (final Issue issue : analysisReport) {
        System.out.println(issue.getCheckType());
        System.out.println(issue.getDebugMessage());
    }
    assertDoesNotContain(CONFLICTING_ROWS, analysisReport);
    assertDoesNotContain(SINGLE_HIT_LOST, analysisReport);
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Issue(org.drools.workbench.services.verifier.api.client.reporting.Issue) Analyzer(org.drools.workbench.services.verifier.core.main.Analyzer) Test(org.junit.Test)

Aggregations

Analyzer (org.drools.workbench.services.verifier.core.main.Analyzer)22 Test (org.junit.Test)21 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)19 ExtendedGuidedDecisionTableBuilder (org.drools.workbench.services.verifier.webworker.client.testutil.ExtendedGuidedDecisionTableBuilder)9 Import (org.kie.soup.project.datamodel.imports.Import)7 ArrayList (java.util.ArrayList)5 Coordinate (org.drools.workbench.services.verifier.plugin.client.Coordinate)3 Ignore (org.junit.Ignore)3 HashSet (java.util.HashSet)1 Issue (org.drools.workbench.services.verifier.api.client.reporting.Issue)1 FactTypes (org.drools.workbench.services.verifier.plugin.client.api.FactTypes)1