use of com.thoughtworks.go.domain.materials.svn.SvnCommand 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.domain.materials.svn.SvnCommand in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method setUp.
@Before
public void setUp() throws IOException {
initMocks(this);
dir = new File("someFolder");
environmentVariableContext = new EnvironmentVariableContext();
svnRepoFixture = new SvnRepoFixture("../common/test-resources/unit/data/svnrepo");
svnRepoFixture.createRepository();
command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
pipelineConfig = PipelineConfigMother.createPipelineConfig(PIPELINE_NAME, STAGE_NAME, JOB_NAME);
svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream1"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName = new DependencyMaterial(new CaseInsensitiveString("upstream2"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName.setName(new CaseInsensitiveString("dependency_material_name"));
setupHgRepo();
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class BuildWorkArtifactUploadingTest method setUp.
@Before
public void setUp() throws IOException {
initMocks(this);
buildWorkingDirectory = new File("tmp" + UUID.randomUUID());
environmentVariableContext = new EnvironmentVariableContext();
svnRepoFixture = new SvnRepoFixture("../common/test-resources/unit/data/svnrepo");
svnRepoFixture.createRepository();
SvnCommand command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
PipelineConfigMother.createPipelineConfig(PIPELINE_NAME, STAGE_NAME, JOB_NAME);
svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
new SystemEnvironment().setProperty("serviceUrl", "some_random_place");
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class SvnTestRepoWithExternal method commitToExternalRepo.
private void commitToExternalRepo(String externalUrl) throws IOException {
File folder = TestFileUtil.createTempFolder("testSvnExternalWorkingCopy");
try {
SvnCommand repository = getSvnExternalCommand(externalUrl, false);
repository.checkoutTo(outputStreamConsumer, folder, SubversionRevision.HEAD);
repository.propset(folder, "newPropetyForExternal", "any value");
repository.commit(inMemoryConsumer(), folder, "make change");
} finally {
FileUtil.deleteFolder(folder);
}
}
use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class ScheduleServiceIntegrationTest method setup.
@Before
public void setup() throws Exception {
configHelper = new GoConfigFileHelper();
dbHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
configHelper.onSetUp();
pipelineFixture = new PipelineWithTwoStages(materialRepository, transactionTemplate);
pipelineFixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, JOB_NAME, "functional");
goConfigService.forceNotifyListeners();
agentAssignment.clear();
goCache.clear();
}
Aggregations