Search in sources :

Example 36 with UrlArgument

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;
}
Also used : HgUrlArgument(com.thoughtworks.go.util.command.HgUrlArgument) UrlArgument(com.thoughtworks.go.util.command.UrlArgument) GoCipher(com.thoughtworks.go.security.GoCipher) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 37 with UrlArgument

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());
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) TestSubprocessExecutionContext(com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext) Test(org.junit.Test)

Example 38 with UrlArgument

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));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) CommandLine(com.thoughtworks.go.util.command.CommandLine) Test(org.junit.Test)

Example 39 with UrlArgument

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());
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) Test(org.junit.Test)

Example 40 with UrlArgument

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()));
}
Also used : UrlArgument(com.thoughtworks.go.util.command.UrlArgument) File(java.io.File) Before(org.junit.Before)

Aggregations

UrlArgument (com.thoughtworks.go.util.command.UrlArgument)63 Test (org.junit.Test)47 GoCipher (com.thoughtworks.go.security.GoCipher)37 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)9 ConfigSaveValidationContext (com.thoughtworks.go.config.ConfigSaveValidationContext)7 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)7 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)5 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)5 Material (com.thoughtworks.go.domain.materials.Material)5 HgUrlArgument (com.thoughtworks.go.util.command.HgUrlArgument)5 File (java.io.File)5 Map (java.util.Map)5 GitMaterial (com.thoughtworks.go.config.materials.git.GitMaterial)4 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)4 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)4 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 TfsMaterial (com.thoughtworks.go.config.materials.tfs.TfsMaterial)4 InvalidCipherTextException (org.bouncycastle.crypto.InvalidCipherTextException)4 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)3 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)3