use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerSubsumptionResolverTest method testRedundantRows002.
@Test
public void testRedundantRows002() throws Exception {
GuidedDecisionTable52 table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withStringColumn("application", "LoanApplication", "amount", ">").withStringColumn("person", "Person", "name", "==").withStringColumn("income", "IncomeSource", "type", "==").withActionSetField("application", "approved", DataType.TYPE_STRING).withData(new Object[][] { { 1, "description", "131000", "Toni", "Asset", "true" }, { 2, "description", "131000", "Toni", "Asset", "true" }, { 3, "description", "100001", "Michael", "Job", "true" } }).buildTable();
Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertContains(analyzerProvider.getAnalysisReport(), REDUNDANT_ROWS, Severity.WARNING, 1, 2);
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testLHSConflictsArePickedUpForEachFieldOfAPatternTheFileFromTicket.
@Test
public void testLHSConflictsArePickedUpForEachFieldOfAPatternTheFileFromTicket() throws Exception {
final String xml = loadResource("GUVNOR-3513-second-version.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertResultIsEmpty(analyzerProvider.getAnalysisReport());
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFileLargeFileGDSTWithDeletes.
@Test
public void testFileLargeFileGDSTWithDeletes() throws Exception, UpdateException {
final String xml = loadResource("Large file.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertOnlyContains(analyzerProvider.getAnalysisReport(), SINGLE_HIT_LOST, EMPTY_RULE);
long baseline = System.currentTimeMillis();
for (int iterations = 0; iterations < 10; iterations++) {
analyzer.removeRule(100);
table52.getData().remove(100);
List<Coordinate> canBeUpdated = new ArrayList<>();
canBeUpdated.add(new Coordinate(0, 0));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, canBeUpdated);
long now = System.currentTimeMillis();
System.out.println("Partial analysis took.. " + (now - baseline) + " ms");
baseline = now;
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 AnalyzerUpdateTestBase method analyze.
protected void analyze(String resourceName) throws Exception {
final String xml = loadResource(resourceName);
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
// First run
analyzer.resetChecks();
analyzer.analyze();
}
use of org.drools.workbench.services.verifier.core.main.Analyzer in project drools-wb by kiegroup.
the class RangeCheckFromFileTest method testFileExtraDays.
@Test
@Ignore("list of admitted values is in the model and currently not accessible for the analyzer")
public void testFileExtraDays() throws Exception {
final String xml = loadResource("Extra 5 days.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertOnlyContains(analyzerProvider.getAnalysisReport(), MISSING_RANGE_TITLE);
}
Aggregations