use of com.thoughtworks.go.config.ArtifactPlan in project gocd by gocd.
the class AssertHelper method assertArtifactPlans.
private static void assertArtifactPlans(ArtifactPlans actual, ArtifactPlans expect) {
String msg = "ArtifactPlans should match";
nullsafeAssert(msg, actual, expect);
assertThat(actual.size(), is(expect.size()));
for (int i = 0; i < expect.size(); i++) {
ArtifactPlan expectPlan = expect.get(i);
ArtifactPlan actualPlan = actual.get(i);
assertThat(msg, actualPlan.getArtifactType(), is(expectPlan.getArtifactType()));
assertThat(msg, actualPlan.getSrc(), is(expectPlan.getSrc()));
assertThat(msg, actualPlan.getDest(), is(expectPlan.getDest()));
}
}
use of com.thoughtworks.go.config.ArtifactPlan in project gocd by gocd.
the class ArtifactPlanTest method validate_shouldNotFailWhenDestinationIsNotSet.
@Test
public void validate_shouldNotFailWhenDestinationIsNotSet() {
ArtifactPlan artifactPlan = new ArtifactPlan(null, null);
artifactPlan.setSrc("source");
artifactPlan.validate(null);
assertThat(artifactPlan.errors().isEmpty(), is(true));
}
use of com.thoughtworks.go.config.ArtifactPlan in project gocd by gocd.
the class ArtifactPlanTest method shouldBeAbleToCreateACopyOfItself.
@Test
public void shouldBeAbleToCreateACopyOfItself() throws Exception {
ArtifactPlan existingPlan = new ArtifactPlan("src1", "dest1");
existingPlan.setId(2);
existingPlan.setBuildId(10);
existingPlan.addError("abc", "def");
assertThat(existingPlan, equalTo(new ArtifactPlan(existingPlan)));
assertThat(existingPlan, equalTo(new Cloner().deepClone(existingPlan)));
}
use of com.thoughtworks.go.config.ArtifactPlan in project gocd by gocd.
the class ArtifactPlanTest method shouldProvideAppendFilePathToDest.
@Test
public void shouldProvideAppendFilePathToDest() {
ArtifactPlan artifactPlan = new ArtifactPlan("test/**/*/a.log", "logs");
assertThat(artifactPlan.destURL(new File("pipelines/pipelineA"), new File("pipelines/pipelineA/test/a/b/a.log")), is("logs/a/b"));
}
use of com.thoughtworks.go.config.ArtifactPlan in project gocd by gocd.
the class ArtifactPlanTest method shouldProvideAppendFilePathToDestWhenPathProvidedAreSame.
@Test
public void shouldProvideAppendFilePathToDestWhenPathProvidedAreSame() {
ArtifactPlan artifactPlan = new ArtifactPlan("test/a/b/a.log", "logs");
assertThat(artifactPlan.destURL(new File("pipelines/pipelineA"), new File("pipelines/pipelineA/test/b/a.log")), is("logs"));
}
Aggregations