use of org.drools.verifier.api.reporting.Issue in project drools-wb by kiegroup.
the class EffectiveDatesFromFileTest method testUpdateNotNullColumn.
@Test
public void testUpdateNotNullColumn() throws Exception {
// Table contains two redundant rows, but the rows are active at different times.
final String xml = loadResource("EffectiveDates.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
// First run
analyzer.resetChecks();
analyzer.analyze();
Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertTrue(analysisReport.isEmpty());
}
use of org.drools.verifier.api.reporting.Issue in project drools-wb by kiegroup.
the class DatesFromFileTest method testGap.
@Test
public void testGap() throws Exception {
final String xml = loadResource("Dates-mid-gap.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertContains(analysisReport, CheckType.MISSING_RANGE, Severity.NOTE, 1, 2);
}
use of org.drools.verifier.api.reporting.Issue in project drools-wb by kiegroup.
the class Receiver method init.
private void init(final DrlInitialize initialize) {
try {
final AnalyzerBuilder analyzerBuilder = new AnalyzerBuilder().with(initialize).with(checkRunner).with(new Reporter() {
@Override
public void sendReport(final Set<Issue> issues) {
latestReport = new Issues(initialize.getUuid(), issues);
poster.post(latestReport);
}
@Override
public void sendStatus(final Status status) {
poster.post(status);
}
});
analyzer = analyzerBuilder.buildAnalyzer();
index = analyzerBuilder.getIndex();
configuration = analyzerBuilder.getConfiguration();
analyzer.resetChecks();
analyzer.analyze();
} catch (final Exception e) {
poster.post(new WebWorkerException("Initialization failed: " + e.getMessage()));
}
}
use of org.drools.verifier.api.reporting.Issue in project drools-wb by kiegroup.
the class DecisionTableAnalyzerAllowListTest method defaultAllowList.
@Test
public void defaultAllowList() throws Exception {
analyzerProvider.setConfiguration(new AnalyzerConfigurationMock());
fireUpAnalyzer();
final Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertOnlyContains(analysisReport, CheckType.REDUNDANT_ROWS, CheckType.SINGLE_HIT_LOST, CheckType.EMPTY_RULE);
}
use of org.drools.verifier.api.reporting.Issue in project drools-wb by kiegroup.
the class DecisionTableAnalyzerAllowListTest method noEmptyRule.
@Test
public void noEmptyRule() throws Exception {
final AnalyzerConfigurationMock analyzerConfiguration = new AnalyzerConfigurationMock();
analyzerConfiguration.getCheckConfiguration().getCheckConfiguration().remove(CheckType.EMPTY_RULE);
analyzerProvider.setConfiguration(analyzerConfiguration);
fireUpAnalyzer();
final Set<Issue> analysisReport = analyzerProvider.getAnalysisReport();
assertOnlyContains(analysisReport, CheckType.REDUNDANT_ROWS, CheckType.SINGLE_HIT_LOST);
}
Aggregations