use of org.drools.workbench.services.verifier.core.cache.inspectors.RuleInspector in project drools-wb by kiegroup.
the class CheckRunManagerTest method setUp.
@Before
public void setUp() throws Exception {
configuration = new AnalyzerConfigurationMock();
checkStorage = new CheckStorage(new CheckFactory(configuration) {
@Override
public HashSet<Check> makeSingleChecks(final RuleInspector ruleInspector) {
final HashSet<Check> result = new HashSet<>();
result.add(new MockSingleCheck(ruleInspector));
return result;
}
});
ruleInspectors = new ArrayList<>();
when(cache.all()).thenReturn(ruleInspectors);
ruleInspector1 = mockRowInspector(1);
ruleInspectors.add(ruleInspector1);
ruleInspector2 = mockRowInspector(2);
ruleInspectors.add(ruleInspector2);
ruleInspector3 = mockRowInspector(3);
ruleInspectors.add(ruleInspector3);
checkRunManager.addChecks(ruleInspector1.getChecks());
checkRunManager.addChecks(ruleInspector2.getChecks());
checkRunManager.addChecks(ruleInspector3.getChecks());
}
use of org.drools.workbench.services.verifier.core.cache.inspectors.RuleInspector in project drools-wb by kiegroup.
the class RuleInspectorCache method reset.
public void reset() {
for (final RuleInspector ruleInspector : ruleInspectors.values()) {
ruleInspector.clearChecks();
}
ruleInspectors.clear();
generalChecks.clear();
for (final Rule rule : index.getRules().where(Rule.uuid().any()).select().all()) {
add(new RuleInspector(rule, checkStorage, this, configuration));
}
generalChecks.add(new SingleRangeCheck(configuration, ruleInspectors.values()));
}
use of org.drools.workbench.services.verifier.core.cache.inspectors.RuleInspector in project drools-wb 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.workbench.services.verifier.core.cache.inspectors.RuleInspector in project drools-wb 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.workbench.services.verifier.core.cache.inspectors.RuleInspector in project drools-wb by kiegroup.
the class Analyzer method newRule.
public void newRule(final Rule rule) {
final RuleInspector ruleInspector = cache.addRule(rule);
checkRunManager.addChecks(ruleInspector.getChecks());
}
Aggregations