use of org.drools.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();
assertDoesNotContain(CheckType.CONFLICTING_ROWS, analysisReport);
assertDoesNotContain(CheckType.SINGLE_HIT_LOST, analysisReport);
}
use of org.drools.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class BRLFragmentsAnalyzerFromFileTest method legalBRLColumns.
/*
https://issues.redhat.com/browse/DROOLS-4945
*/
@Test
public void legalBRLColumns() throws Exception {
final String xml = loadResource("TicketsDT.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
final Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertTrue(analysisReport.isEmpty());
}
use of org.drools.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class BRLFragmentsAnalyzerFromFileTest method testRuleTableGDSTWorkItem.
@Test
public void testRuleTableGDSTWorkItem() throws Exception {
final String xml = loadResource("WorkItem.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
final Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertTrue(analysisReport.isEmpty());
}
use of org.drools.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFile3.
@Test
@Ignore
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(CheckType.REDUNDANT_ROWS, analyzerProvider.getAnalysisReport());
}
use of org.drools.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFileLargeFileGDSTWithUpdate.
@Test
public void testFileLargeFileGDSTWithUpdate() throws Exception {
long baseline = System.currentTimeMillis();
final String xml = loadResource("Large file.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
long now = System.currentTimeMillis();
System.out.println("Loading of model took.. " + (now - baseline) + " ms");
baseline = now;
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
now = System.currentTimeMillis();
System.out.println("Indexing took.. " + (now - baseline) + " ms");
analyzer.resetChecks();
analyzer.analyze();
assertOnlyContains(analyzerProvider.getAnalysisReport(), CheckType.SINGLE_HIT_LOST, CheckType.EMPTY_RULE);
now = System.currentTimeMillis();
System.out.println("Initial analysis took.. " + (now - baseline) + " ms");
baseline = now;
table52.getData().get(2).get(6).clearValues();
final List<Coordinate> updates = new ArrayList<>();
updates.add(new Coordinate(2, 6));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates);
assertOnlyContains(analyzerProvider.getAnalysisReport(), CheckType.SINGLE_HIT_LOST, CheckType.EMPTY_RULE);
now = System.currentTimeMillis();
System.out.println("Partial analysis took.. " + (now - baseline) + " ms");
}
Aggregations