Search in sources :

Example 26 with Analyzer

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

the class DecisionTableAnalyzerFromFileTest method testFileBaseEntitlementGDST.

@Test
public void testFileBaseEntitlementGDST() throws Exception {
    final String xml = loadResource("Base entitlement.gdst");
    final Analyzer analyzer = analyzerProvider.makeAnalyser(GuidedDTXMLPersistence.getInstance().unmarshal(xml));
    analyzer.resetChecks();
    analyzer.analyze();
    assertTrue(analyzerProvider.getAnalysisReport().isEmpty());
}
Also used : Analyzer(org.drools.verifier.core.main.Analyzer) Test(org.junit.Test)

Example 27 with Analyzer

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

the class DecisionTableAnalyzerFromFileTest method emptyValueListOnColumnShouldNotCountAsAnEnum.

@Test
public void emptyValueListOnColumnShouldNotCountAsAnEnum() throws Exception {
    analyzerProvider.getFactTypes().add(new FactTypes.FactType("Data", new Sets.Builder<FactTypes.Field>().add(new FactTypes.Field("totalAmount", DataType.TYPE_NUMERIC_FLOAT)).build()));
    final String xml = loadResource("DROOLS-5059.gdst");
    final Analyzer analyzer = analyzerProvider.makeAnalyser(GuidedDTXMLPersistence.getInstance().unmarshal(xml));
    analyzer.resetChecks();
    analyzer.analyze();
    Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
    assertOnlyContains(analysisReport, CheckType.MISSING_RANGE);
}
Also used : Issue(org.drools.verifier.api.reporting.Issue) FactTypes(org.drools.workbench.services.verifier.plugin.client.api.FactTypes) Analyzer(org.drools.verifier.core.main.Analyzer) Test(org.junit.Test)

Example 28 with Analyzer

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

the class DecisionTableAnalyzerFromFileTest method testFileLargeFileGDST.

@Test
public void testFileLargeFileGDST() throws Exception {
    final String xml = loadResource("Large file.gdst");
    final Analyzer analyzer = analyzerProvider.makeAnalyser(GuidedDTXMLPersistence.getInstance().unmarshal(xml));
    analyzer.resetChecks();
    analyzer.analyze();
    assertOnlyContains(analyzerProvider.getAnalysisReport(), CheckType.SINGLE_HIT_LOST, CheckType.EMPTY_RULE);
}
Also used : Analyzer(org.drools.verifier.core.main.Analyzer) Test(org.junit.Test)

Example 29 with Analyzer

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

the class AnalyzerUpdateTestBase method analyze.

protected void analyze(String resourceName) throws Exception {
    final String xml = TestUtil.loadResource(resourceName);
    final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
    final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
    // First run
    analyzer.resetChecks();
    analyzer.analyze();
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Analyzer(org.drools.verifier.core.main.Analyzer)

Example 30 with Analyzer

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

the class DatesFromFileTest method testComplete.

@Test
public void testComplete() throws Exception {
    final String xml = loadResource("Dates-complete.gdst");
    final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
    final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
    analyzer.resetChecks();
    analyzer.analyze();
    assertDoesNotContain(CheckType.MISSING_RANGE, analyzerProvider.getAnalysisReport());
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Analyzer(org.drools.verifier.core.main.Analyzer) Test(org.junit.Test)

Aggregations

Analyzer (org.drools.verifier.core.main.Analyzer)30 Test (org.junit.Test)29 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)26 ExtendedGuidedDecisionTableBuilder (org.drools.workbench.services.verifier.plugin.client.testutil.ExtendedGuidedDecisionTableBuilder)9 Import (org.kie.soup.project.datamodel.imports.Import)7 Issue (org.drools.verifier.api.reporting.Issue)6 ArrayList (java.util.ArrayList)5 Ignore (org.junit.Ignore)4 Coordinate (org.drools.workbench.services.verifier.plugin.client.Coordinate)3 FactTypes (org.drools.workbench.services.verifier.plugin.client.api.FactTypes)2