use of com.thoughtworks.go.domain.materials.svn.SvnCommand in project gocd by gocd.
the class SvnPostCommitHookImplementerTest method shouldCreateRemoteUrlToRemoteUUIDMap.
@Test
public void shouldCreateRemoteUrlToRemoteUUIDMap() {
final SvnPostCommitHookImplementer spy = spy(implementer);
final SvnCommand svnCommand = mock(SvnCommand.class);
final Material svnMaterial1 = mock(SvnMaterial.class);
final Material hgMaterial1 = mock(HgMaterial.class);
final HashSet<Material> allMaterials = new HashSet<>(Arrays.asList(svnMaterial1, hgMaterial1));
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
return svnCommand;
}
}).when(spy).getEmptySvnCommand();
spy.createUrlToRemoteUUIDMap(allMaterials);
verify(svnCommand).createUrlToRemoteUUIDMap(new HashSet<>(Arrays.asList((SvnMaterial) svnMaterial1)));
}
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/src/test/resources/data/svnrepo", temporaryFolder);
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 MaterialExpansionService method svn.
private Subversion svn(SvnMaterialConfig svnMaterialConfig) {
String cacheKey = cacheKeyForSubversionMaterialCommand(svnMaterialConfig.getFingerprint());
Subversion svnLazyLoaded = (SvnCommand) goCache.get(cacheKey);
if (svnLazyLoaded == null || !svnLazyLoaded.getUrl().forCommandline().equals(svnMaterialConfig.getUrl())) {
synchronized (cacheKey) {
svnLazyLoaded = (SvnCommand) goCache.get(cacheKey);
if (svnLazyLoaded == null || !svnLazyLoaded.getUrl().forCommandline().equals(svnMaterialConfig.getUrl())) {
svnLazyLoaded = new SvnCommand(svnMaterialConfig.getFingerprint(), svnMaterialConfig.getUrl(), svnMaterialConfig.getUserName(), svnMaterialConfig.getPassword(), svnMaterialConfig.isCheckExternals());
goCache.put(cacheKeyForSubversionMaterialCommand(svnMaterialConfig.getFingerprint()), svnLazyLoaded);
}
}
}
return svnLazyLoaded;
}
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 = temporaryFolder.newFolder();
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 {
FileUtils.deleteQuietly(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, temporaryFolder);
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