Search in sources :

Example 11 with ValidationRuleSet

use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.

the class ProjectArtifactsRule_PomDeploymentTest 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("classifierAndTypeSet", "sources:jar,javadoc:jar"));
    return ruleSet;
}
Also used : ValidationRuleSet(org.commonjava.indy.promote.model.ValidationRuleSet)

Example 12 with ValidationRuleSet

use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.

the class ArtifactRefs_DependencyInAnotherRepoInGroup_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;
}
Also used : ValidationRuleSet(org.commonjava.indy.promote.model.ValidationRuleSet)

Example 13 with ValidationRuleSet

use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.

the class ArtifactRefs_DependencyTwoExtraGroups_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,group:third"));
    return ruleSet;
}
Also used : ValidationRuleSet(org.commonjava.indy.promote.model.ValidationRuleSet)

Example 14 with ValidationRuleSet

use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.

the class ArtifactRefs_PromoteWithParent_RuleTest method getRuleSet.

@Override
protected ValidationRuleSet getRuleSet() {
    ValidationRuleSet ruleSet = new ValidationRuleSet();
    ruleSet.setName("test");
    ruleSet.setStoreKeyPattern("hosted:target");
    ruleSet.setRuleNames(Collections.singletonList(getRuleScriptFile()));
    return ruleSet;
}
Also used : ValidationRuleSet(org.commonjava.indy.promote.model.ValidationRuleSet)

Example 15 with ValidationRuleSet

use of org.commonjava.indy.promote.model.ValidationRuleSet in project indy by Commonjava.

the class AbstractValidationRuleTest method initTestData.

@Override
protected void initTestData(CoreServerFixture fixture) throws IOException {
    writeDataFile("promote/rules/" + getRuleScriptFile(), getRuleScriptContent());
    ValidationRuleSet rs = getRuleSet();
    String json = new ObjectMapper().writeValueAsString(rs);
    String rulesetPath = "promote/rule-sets/" + name.getMethodName() + ".json";
    logger.info("Writing rule-set to: {}\nContents:\n\n{}\n\n", rulesetPath, json);
    writeDataFile(rulesetPath, json);
    super.initTestData(fixture);
}
Also used : ValidationRuleSet(org.commonjava.indy.promote.model.ValidationRuleSet) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ValidationRuleSet (org.commonjava.indy.promote.model.ValidationRuleSet)16 HashMap (java.util.HashMap)2 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)2 StoreKey (org.commonjava.indy.model.core.StoreKey)2 ValidationRuleMapping (org.commonjava.indy.promote.validate.model.ValidationRuleMapping)2 DataFile (org.commonjava.indy.subsys.datafile.DataFile)2 Test (org.junit.Test)2 Logger (org.slf4j.Logger)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 File (java.io.File)1 IOException (java.io.IOException)1 IndyDataException (org.commonjava.indy.data.IndyDataException)1 ArtifactStore (org.commonjava.indy.model.core.ArtifactStore)1 ValidationRequest (org.commonjava.indy.promote.validate.model.ValidationRequest)1 EventMetadata (org.commonjava.maven.galley.event.EventMetadata)1