use of com.thoughtworks.go.util.command.EnvironmentVariableContext in project gocd by gocd.
the class AgentStatusReportTest method before.
@Before
public void before() {
agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", "uuid");
environmentVariableContext = new EnvironmentVariableContext();
artifactManipulator = new GoArtifactsManipulatorStub();
buildRepository = new BuildRepositoryRemoteStub();
this.agentRuntimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
}
use of com.thoughtworks.go.util.command.EnvironmentVariableContext in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetupEnvironmentVariableForDependencyMaterial.
@Test
public void shouldSetupEnvironmentVariableForDependencyMaterial() throws IOException {
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.util.command.EnvironmentVariableContext in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetEnvironmentVariableForSvnExternal.
@Test
public void shouldSetEnvironmentVariableForSvnExternal() throws IOException {
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.util.command.EnvironmentVariableContext in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetupEnvironmentVariableUsingDependencyMaterialName.
@Test
public void shouldSetupEnvironmentVariableUsingDependencyMaterialName() throws IOException {
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"));
}
use of com.thoughtworks.go.util.command.EnvironmentVariableContext in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method shouldSetUpRevisionIntoEnvironmentContextCorrectlyForMutipleMaterial.
@Test
public void shouldSetUpRevisionIntoEnvironmentContextCorrectlyForMutipleMaterial() throws IOException {
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"));
}
Aggregations