Search in sources :

Example 1 with URIishHelperImpl

use of jetbrains.buildServer.buildTriggers.vcs.git.agent.URIishHelperImpl in project teamcity-git by JetBrains.

the class ScriptGenTest method check_escaping.

@TestFor(issues = "TW-40688")
@Test(dataProvider = "passwords")
public void check_escaping(@NotNull String password) throws Exception {
    VcsRoot root = createRootWithPassword(password);
    GeneralCommandLine cmd = new GeneralCommandLine();
    cmd.setExePath(createGenerator().generateAskPass(new AuthSettingsImpl(root, new URIishHelperImpl())).getCanonicalPath());
    ExecResult result = SimpleCommandLineProcessRunner.runCommand(cmd, null);
    assertEquals(password, trimNewLines(result.getStdout()));
}
Also used : AuthSettingsImpl(jetbrains.buildServer.buildTriggers.vcs.git.AuthSettingsImpl) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) VcsRoot(jetbrains.buildServer.vcs.VcsRoot) URIishHelperImpl(jetbrains.buildServer.buildTriggers.vcs.git.agent.URIishHelperImpl) ExecResult(jetbrains.buildServer.ExecResult) Test(org.testng.annotations.Test) TestFor(jetbrains.buildServer.util.TestFor)

Example 2 with URIishHelperImpl

use of jetbrains.buildServer.buildTriggers.vcs.git.agent.URIishHelperImpl in project teamcity-git by JetBrains.

the class HttpUrlWithUsernameTest method getMirrorConfig.

@NotNull
private StoredConfig getMirrorConfig(@NotNull VcsRootImpl root) throws IOException, VcsException {
    GitVcsRoot gitRoot = new GitVcsRoot(myMirrorManager, root, new URIishHelperImpl());
    File mirrorDir = myMirrorManager.getMirrorDir(gitRoot.getRepositoryFetchURL().toString());
    Repository r = new RepositoryBuilder().setGitDir(mirrorDir).build();
    return r.getConfig();
}
Also used : GitTestUtil.copyRepository(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.copyRepository) Repository(org.eclipse.jgit.lib.Repository) RepositoryBuilder(org.eclipse.jgit.lib.RepositoryBuilder) URIishHelperImpl(jetbrains.buildServer.buildTriggers.vcs.git.agent.URIishHelperImpl) GitVcsRoot(jetbrains.buildServer.buildTriggers.vcs.git.GitVcsRoot) GitTestUtil.dataFile(jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

URIishHelperImpl (jetbrains.buildServer.buildTriggers.vcs.git.agent.URIishHelperImpl)2 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 File (java.io.File)1 ExecResult (jetbrains.buildServer.ExecResult)1 AuthSettingsImpl (jetbrains.buildServer.buildTriggers.vcs.git.AuthSettingsImpl)1 GitVcsRoot (jetbrains.buildServer.buildTriggers.vcs.git.GitVcsRoot)1 GitTestUtil.copyRepository (jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.copyRepository)1 GitTestUtil.dataFile (jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile)1 TestFor (jetbrains.buildServer.util.TestFor)1 VcsRoot (jetbrains.buildServer.vcs.VcsRoot)1 Repository (org.eclipse.jgit.lib.Repository)1 RepositoryBuilder (org.eclipse.jgit.lib.RepositoryBuilder)1 NotNull (org.jetbrains.annotations.NotNull)1 Test (org.testng.annotations.Test)1