use of com.thoughtworks.go.config.materials.Materials in project gocd by gocd.
the class GitMultipleMaterialsTest method shouldFindModificationsForBothMaterials.
@Test
public void shouldFindModificationsForBothMaterials() throws Exception {
Materials materials = new Materials(repo.createMaterial("dest1"), repo.createMaterial("dest2"));
String fileName = "newFile.txt";
repo.addFileAndPush(fileName, "add a new file " + fileName);
MaterialRevisions materialRevisions = materials.latestModification(pipelineDir, new TestSubprocessExecutionContext());
assertThat(materialRevisions.getRevisions().size(), is(2));
assertThat(materialRevisions, containsModifiedFile(fileName));
}
use of com.thoughtworks.go.config.materials.Materials in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetupEnvironmentVariableForDependencyMaterial.
@Test
public void shouldSetupEnvironmentVariableForDependencyMaterial() {
EnvironmentVariableContext environmentVariableContext = doWorkWithMaterials(new Materials());
assertThat("Properties: \n" + environmentVariableContext.getProperties(), environmentVariableContext.getProperty("GO_DEPENDENCY_LOCATOR_UPSTREAM1"), is("upstream1/0/first/1"));
assertThat("Properties: \n" + environmentVariableContext.getProperties(), environmentVariableContext.getProperty("GO_DEPENDENCY_LABEL_UPSTREAM1"), is("upstream1-label"));
}
use of com.thoughtworks.go.config.materials.Materials in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetUpRevisionIntoEnvironmentContextCorrectlyForMutipleMaterial.
@Test
public void shouldSetUpRevisionIntoEnvironmentContextCorrectlyForMutipleMaterial() throws Exception {
svnMaterial.setFolder("svn-Dir");
EnvironmentVariableContext environmentVariableContext = doWorkWithMaterials(new Materials(svnMaterial, hgMaterial));
assertThat(environmentVariableContext.getProperty("GO_REVISION_SVN_DIR"), is("3"));
assertThat(environmentVariableContext.getProperty("GO_REVISION_HG_DIR"), is("ca3ebb67f527c0ad7ed26b789056823d8b9af23f"));
}
use of com.thoughtworks.go.config.materials.Materials in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetEnvironmentVariableForSvnExternal.
@Test
public void shouldSetEnvironmentVariableForSvnExternal() throws Exception {
svnRepoFixture.createExternals(svnRepoFixture.getEnd2EndRepoUrl());
command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl(), null, null, true);
svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
svnMaterial.setFolder("svn-Dir");
EnvironmentVariableContext environmentVariableContext = doWorkWithMaterials(new Materials(svnMaterial));
assertThat(environmentVariableContext.getProperty("GO_REVISION_SVN_DIR"), is("4"));
assertThat(environmentVariableContext.getProperty("GO_REVISION_SVN_DIR_EXTERNAL"), is("4"));
}
use of com.thoughtworks.go.config.materials.Materials in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetupEnvironmentVariableUsingDependencyMaterialName.
@Test
public void shouldSetupEnvironmentVariableUsingDependencyMaterialName() {
EnvironmentVariableContext environmentVariableContext = doWorkWithMaterials(new Materials());
assertThat("Properties: \n" + environmentVariableContext.getProperties(), environmentVariableContext.getProperty("GO_DEPENDENCY_LOCATOR_DEPENDENCY_MATERIAL_NAME"), is("upstream2/0/first/1"));
assertThat("Properties: \n" + environmentVariableContext.getProperties(), environmentVariableContext.getProperty("GO_DEPENDENCY_LABEL_DEPENDENCY_MATERIAL_NAME"), is("upstream2-label"));
}
Aggregations