use of com.buschmais.jqassistant.core.rule.api.executor.RuleExecutor in project jqa-core-framework by buschmais.
the class RuleHelper method getAllRules.
/**
* Determines all rules.
*
* @param ruleSet
* The rule set.
* @return The visitor with all valid and missing rules.
* @throws RuleExecutorException
* If the rules cannot be evaluated.
*/
private CollectRulesVisitor getAllRules(RuleSet ruleSet, RuleSelection ruleSelection) throws RuleExecutorException {
CollectRulesVisitor visitor = new CollectRulesVisitor();
RuleExecutor executor = new RuleExecutor(visitor, new RuleExecutorConfiguration());
executor.execute(ruleSet, ruleSelection);
return visitor;
}
use of com.buschmais.jqassistant.core.rule.api.executor.RuleExecutor in project jqa-core-framework by buschmais.
the class AnalyzerImpl method execute.
@Override
public void execute(RuleSet ruleSet, RuleSelection ruleSelection, Map<String, String> ruleParameters) throws RuleExecutorException {
reportPlugin.begin();
try {
AnalyzerVisitor visitor = new AnalyzerVisitor(configuration, ruleParameters, store, reportPlugin, logger);
RuleExecutor executor = new RuleExecutor(visitor, configuration.getRuleExecutorConfiguration());
executor.execute(ruleSet, ruleSelection);
} finally {
reportPlugin.end();
}
}
use of com.buschmais.jqassistant.core.rule.api.executor.RuleExecutor in project jqa-core-framework by buschmais.
the class RuleSetWriterImpl method write.
@Override
public void write(RuleSet ruleSet, Writer writer) throws RuleException {
CollectRulesVisitor visitor = new CollectRulesVisitor();
RuleSelection ruleSelection = RuleSelection.Builder.newInstance().addGroupIds(ruleSet.getGroupsBucket().getIds()).addConstraintIds(ruleSet.getConstraintBucket().getIds()).addConceptIds(ruleSet.getConceptBucket().getIds()).get();
try {
new RuleExecutor(visitor, configuration).execute(ruleSet, ruleSelection);
} catch (RuleExecutorException e) {
throw new RuleException("Cannot create rule set", e);
}
JqassistantRules rules = new JqassistantRules();
writeGroups(visitor.getGroups(), rules);
writeConcepts(visitor.getConcepts().keySet(), rules);
writeConstraints(visitor.getConstraints().keySet(), rules);
marshal(writer, rules);
}
use of com.buschmais.jqassistant.core.rule.api.executor.RuleExecutor in project jqa-core-framework by buschmais.
the class RuleExecutorTest method setUp.
@Before
public void setUp() throws Exception {
configuration = new RuleExecutorConfiguration();
ruleExecutor = new RuleExecutor(visitor, configuration);
defaultConcept = Concept.Builder.newConcept().id("concept:Default").severity(Severity.MAJOR).get();
overriddenConcept = Concept.Builder.newConcept().id("concept:Overridden").severity(Severity.MAJOR).get();
defaultConstraint = Constraint.Builder.newConstraint().id("constraint:Default").severity(Severity.MAJOR).get();
overriddenConstraint = Constraint.Builder.newConstraint().id("constraint:Overridden").severity(Severity.MAJOR).get();
}
Aggregations