use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.
the class ValidationRuleParserTest method testRuleSetParseAndMatchOnStoreKey.
@Test
public void testRuleSetParseAndMatchOnStoreKey() throws Exception {
ValidationRuleSet ruleSet = parser.parseRuleSet("{\"name\":\"test\",\"storeKeyPattern\":\".*\"}", "test.json");
assertThat(ruleSet, notNullValue());
assertThat(ruleSet.matchesKey("hosted:repo"), equalTo(true));
}
use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.
the class FullRuleStack_GroupWithOneOfTwoHosts_RuleTest method getRuleSet.
@Override
protected ValidationRuleSet getRuleSet() {
ValidationRuleSet ruleSet = new ValidationRuleSet();
ruleSet.setName("test");
ruleSet.setStoreKeyPattern("group:target");
ruleSet.setRuleNames(Arrays.asList(RULES));
Map<String, String> params = new HashMap<>();
params.put("availableInStores", "group:public, group:target");
params.put("classifierAndTypeSet", "javadoc:jar, sources:jar");
params.put("versionPattern", "\\d+\\.\\d+\\.\\d+[.-]redhat-\\d+");
ruleSet.setValidationParameters(params);
return ruleSet;
}
use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.
the class NoPreExistingPaths_GroupWithOneOfTwoHosts_RuleTest method getRuleSet.
@Override
protected ValidationRuleSet getRuleSet() {
ValidationRuleSet ruleSet = new ValidationRuleSet();
ruleSet.setName("test");
ruleSet.setStoreKeyPattern("group:target");
ruleSet.setRuleNames(Collections.singletonList(getRuleScriptFile()));
return ruleSet;
}
use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.
the class NoPreExistingPaths_RuleTest method getRuleSet.
@Override
protected ValidationRuleSet getRuleSet() {
ValidationRuleSet ruleSet = new ValidationRuleSet();
ruleSet.setName("test");
ruleSet.setStoreKeyPattern("group:target");
ruleSet.setRuleNames(Collections.singletonList(getRuleScriptFile()));
ruleSet.setValidationParameters(Collections.singletonMap("availableInStores", "group:other"));
return ruleSet;
}
use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.
the class ProjectVersionPatternRuleTest method getRuleSet.
protected ValidationRuleSet getRuleSet() {
ValidationRuleSet ruleSet = new ValidationRuleSet();
ruleSet.setName("test");
ruleSet.setStoreKeyPattern("group:target");
ruleSet.setRuleNames(Collections.singletonList(getRuleScriptFile()));
ruleSet.setValidationParameters(Collections.singletonMap("versionPattern", "\\d\\.\\d"));
return ruleSet;
}
Aggregations