Search in sources :

Example 1 with RuleParseException

use of org.candlepin.policy.js.RuleParseException in project candlepin by candlepin.

the class RulesVersionMatchingTest method ensureWorking.

@Test
public void ensureWorking() {
    Rules rules = null;
    try {
        rules = new Rules(version);
        if (!expectedToBeValid) {
            throw new RuntimeException("Expected rule parsing to have failed.");
        }
        assertEquals(expectedVersion, rules.getVersion());
    } catch (RuleParseException e) {
        if (expectedToBeValid) {
            throw e;
        }
    }
}
Also used : RuleParseException(org.candlepin.policy.js.RuleParseException) Rules(org.candlepin.model.Rules) Test(org.junit.Test)

Aggregations

Rules (org.candlepin.model.Rules)1 RuleParseException (org.candlepin.policy.js.RuleParseException)1 Test (org.junit.Test)1