use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class MaterialConfigsMother method svnMaterialConfig.
public static SvnMaterialConfig svnMaterialConfig(String svnUrl, String folder, boolean autoUpdate) {
SvnMaterialConfig materialConfig = new SvnMaterialConfig(new UrlArgument(svnUrl), "user", "pass", true, new GoCipher(), autoUpdate, new Filter(new IgnoredFiles("*.doc")), false, folder, new CaseInsensitiveString("svn-material"));
materialConfig.setPassword("pass");
return materialConfig;
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class GitCommandTest method shouldThrowExceptionWhenRepoNotExist.
@Test(expected = Exception.class)
public void shouldThrowExceptionWhenRepoNotExist() throws Exception {
GitCommand gitCommand = new GitCommand(null, null, null, false, null, null);
final TestSubprocessExecutionContext executionContext = new TestSubprocessExecutionContext();
gitCommand.checkConnection(new UrlArgument("git://somewhere.is.not.exist"), "master", executionContext.getDefaultEnvironmentVariables());
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class GitCommandTest method shouldGetTheCurrentBranchForTheCheckedOutRepo.
@Test
public void shouldGetTheCurrentBranchForTheCheckedOutRepo() throws IOException {
gitLocalRepoDir = createTempWorkingDirectory();
CommandLine gitCloneCommand = CommandLine.createCommandLine("git").withEncoding("UTF-8").withArg("clone");
gitCloneCommand.withArg("--branch=" + BRANCH).withArg(new UrlArgument(gitFooBranchBundle.projectRepositoryUrl())).withArg(gitLocalRepoDir.getAbsolutePath());
gitCloneCommand.run(inMemoryConsumer(), "");
git = new GitCommand(null, gitLocalRepoDir, BRANCH, false, new HashMap<>(), null);
assertThat(git.getCurrentBranch(), Is.is(BRANCH));
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class GitCommandTest method shouldThrowExceptionWhenRemoteBranchDoesNotExist.
@Test(expected = Exception.class)
public void shouldThrowExceptionWhenRemoteBranchDoesNotExist() throws Exception {
GitCommand gitCommand = new GitCommand(null, null, null, false, null, null);
gitCommand.checkConnection(new UrlArgument(gitRepo.projectRepositoryUrl()), "Invalid_Branch", testSubprocessExecutionContext.getDefaultEnvironmentVariables());
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class HgCommandTest method setUp.
@Before
public void setUp() throws IOException {
serverRepo = temporaryFolder.newFolder("testHgServerRepo");
clientRepo = temporaryFolder.newFolder("testHgClientRepo");
secondBranchWorkingCopy = temporaryFolder.newFolder("second");
setUpServerRepoFromHgBundle(serverRepo, new File("../common/src/test/resources/data/hgrepo.hgbundle"));
workingDirectory = new File(clientRepo.getPath());
hgCommand = new HgCommand(null, workingDirectory, "default", serverRepo.getAbsolutePath(), null);
hgCommand.clone(outputStreamConsumer, new UrlArgument(serverRepo.getAbsolutePath()));
}
Aggregations