Search in sources :

Example 11 with ArtifactConfigs

use of com.thoughtworks.go.config.ArtifactConfigs in project gocd by gocd.

the class ArtifactConfigsTest method shouldValidateTree.

@Test
public void shouldValidateTree() {
    ArtifactConfigs artifactConfigs = new ArtifactConfigs();
    artifactConfigs.add(new ArtifactConfig("src", "dest"));
    artifactConfigs.add(new ArtifactConfig("src", "dest"));
    artifactConfigs.add(new ArtifactConfig("src", "../a"));
    artifactConfigs.validateTree(null);
    assertThat(artifactConfigs.get(0).errors().on(ArtifactConfig.DEST), is("Duplicate artifacts defined."));
    assertThat(artifactConfigs.get(0).errors().on(ArtifactConfig.SRC), is("Duplicate artifacts defined."));
    assertThat(artifactConfigs.get(1).errors().on(ArtifactConfig.DEST), is("Duplicate artifacts defined."));
    assertThat(artifactConfigs.get(1).errors().on(ArtifactConfig.SRC), is("Duplicate artifacts defined."));
    assertThat(artifactConfigs.get(2).errors().on(ArtifactConfig.DEST), is("Invalid destination path. Destination path should match the pattern " + FilePathTypeValidator.PATH_PATTERN));
}
Also used : PluggableArtifactConfig(com.thoughtworks.go.config.PluggableArtifactConfig) TestArtifactConfig(com.thoughtworks.go.config.TestArtifactConfig) ArtifactConfig(com.thoughtworks.go.config.ArtifactConfig) ArtifactConfigs(com.thoughtworks.go.config.ArtifactConfigs) Test(org.junit.Test)

Aggregations

ArtifactConfigs (com.thoughtworks.go.config.ArtifactConfigs)11 PluggableArtifactConfig (com.thoughtworks.go.config.PluggableArtifactConfig)11 Test (org.junit.Test)11 ArtifactConfig (com.thoughtworks.go.config.ArtifactConfig)9 TestArtifactConfig (com.thoughtworks.go.config.TestArtifactConfig)9 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2