use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class AutoCheckoutTest method client_found_by_path_from_environment.
public void client_found_by_path_from_environment() throws IOException, VcsException {
myVcsSupport = vcsSupportWithRealGit();
VcsRoot vcsRoot = vcsRootWithAgentGitPath(null);
AgentRunningBuild build = runningBuild().sharedEnvVariable(Constants.TEAMCITY_AGENT_GIT_PATH, getGitPath()).addRoot(vcsRoot).withAgentConfiguration(myAgentConfiguration).build();
verifyCanCheckout(vcsRoot, CheckoutRules.DEFAULT, build);
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class AuthSettingsTest method should_take_username_from_URL_into_account.
@TestFor(issues = "TW-27506")
public void should_take_username_from_URL_into_account() throws URISyntaxException {
String user = "usr";
String url = "http://" + user + "@acme.org/repository.git";
VcsRoot root = vcsRoot().withFetchUrl(url).withAuthMethod(AuthenticationMethod.PASSWORD).withPassword("pwd").build();
CredentialsProvider c = new AuthCredentialsProvider(new AuthSettingsImpl(root, new URIishHelperImpl()));
CredentialItem.Username username = new CredentialItem.Username();
c.get(new URIish(url), username, new CredentialItem.Password());
assertEquals(user, username.getValue());
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class AuthSettingsTest method should_not_fail_when_password_is_empty.
@TestFor(issues = { "TW-24499", "TW-30655" })
public void should_not_fail_when_password_is_empty() throws Exception {
VcsRoot root = vcsRoot().withFetchUrl("http://some.org/repository").withAuthMethod(AuthenticationMethod.PASSWORD).withUsername("user").build();
CredentialsProvider c = new AuthCredentialsProvider(new AuthSettingsImpl(root, new URIishHelperImpl()));
assertFalse(c.supports(new CredentialItem.Username(), new CredentialItem.Password()));
c.get(new URIish("http://some.org/repository"), new CredentialItem.Username(), new CredentialItem.Password());
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class AuthSettingsTest method should_take_username_in_URL_into_account2.
@TestFor(issues = "TW-27226")
public void should_take_username_in_URL_into_account2() {
VcsRoot root = vcsRoot().withFetchUrl("git@github.com:name/repo.git").withAuthMethod(AuthenticationMethod.PRIVATE_KEY_DEFAULT).build();
assertEquals("git", new AuthSettingsImpl(root, new URIishHelperImpl()).getUserName());
}
Aggregations