use of org.drools.verifier.core.cache.inspectors.RuleInspector in project drools by kiegroup.
the class RuleInspectorCache method removeRow.
public RuleInspector removeRow(final int rowNumber) {
final Rule rule = getRule(rowNumber);
final RuleInspector remove = ruleInspectors.remove(rule);
index.getRules().remove(rule);
return remove;
}
use of org.drools.verifier.core.cache.inspectors.RuleInspector in project drools by kiegroup.
the class RuleInspectorCache method addRule.
public RuleInspector addRule(final Rule rule) {
this.index.getRules().add(rule);
final RuleInspector ruleInspector = new RuleInspector(rule, checkStorage, this, configuration);
add(ruleInspector);
return ruleInspector;
}
use of org.drools.verifier.core.cache.inspectors.RuleInspector in project drools by kiegroup.
the class CheckStorage method makeChecks.
public void makeChecks(final RuleInspector ruleInspector) {
makeSingleRowChecks(ruleInspector);
final Set<RuleInspector> knownRuleInspectors = ruleInspectorChecks.keys();
makePairRowChecks(ruleInspector, knownRuleInspectors);
for (final RuleInspector other : knownRuleInspectors) {
if (!other.equals(ruleInspector)) {
// Add pair inspector for old values.
checkFactory.makePairRowCheck(other, ruleInspector).ifPresent(pairCheckStorage::add);
}
}
}
use of org.drools.verifier.core.cache.inspectors.RuleInspector in project drools by kiegroup.
the class Analyzer method newRule.
public void newRule(final Rule rule) {
final RuleInspector ruleInspector = cache.addRule(rule);
checkRunManager.addChecks(ruleInspector.getChecks());
}
use of org.drools.verifier.core.cache.inspectors.RuleInspector in project drools by kiegroup.
the class CheckRunManagerTest method testOnlyTestChanges.
@Test
public void testOnlyTestChanges() throws Exception {
// First run
this.checkRunManager.run(null, null);
RuleInspector newRuleInspector = mockRowInspector(3);
ruleInspectors.add(newRuleInspector);
this.checkRunManager.addChecks(newRuleInspector.getChecks());
assertNoIssues(newRuleInspector);
// Second run
this.checkRunManager.run(null, null);
assertHasIssues(newRuleInspector);
assertEquals(7, ruleInspector1.getChecks().size());
assertEquals(7, newRuleInspector.getChecks().size());
}
Aggregations