use of org.drools.workbench.services.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(), SINGLE_HIT_LOST, EMPTY_RULE);
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFilePricingLoansGDST.
@Test
@Ignore("list of admitted values is in the model and currently not accessible for the analyzer")
public void testFilePricingLoansGDST() throws Exception {
final String xml = loadResource("Pricing loans.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertOnlyContains(analyzerProvider.getAnalysisReport(), MISSING_RANGE_TITLE);
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFile3.
@Test
public void testFile3() throws Exception {
final String xml = loadResource("Pricing loans version 2.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertDoesNotContain("ThisRowIsRedundantTo", analyzerProvider.getAnalysisReport());
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testUpdateNotNullColumn.
@Test
public void testUpdateNotNullColumn() throws Exception, UpdateException {
final String xml = loadResource("Is Null Table.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
// First run
analyzer.resetChecks();
analyzer.analyze();
assertContains(analyzerProvider.getAnalysisReport(), RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, Severity.NOTE);
// Update
table52.getData().get(0).get(2).setBooleanValue(true);
final List<Coordinate> updates = new ArrayList<>();
updates.add(new Coordinate(0, 2));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates);
// Update
table52.getData().get(1).get(2).setBooleanValue(true);
final List<Coordinate> updates2 = new ArrayList<>();
updates2.add(new Coordinate(1, 2));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates2);
assertDoesNotContain(RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, analyzerProvider.getAnalysisReport());
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testLHSConflictsArePickedUpForEachFieldOfAPattern.
@Test
public void testLHSConflictsArePickedUpForEachFieldOfAPattern() throws Exception {
final String xml = loadResource("GUVNOR-3513.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertResultIsEmpty(analyzerProvider.getAnalysisReport());
}
Aggregations