use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class ServerPluginConfigTest method ssh_proxy_settings.
@TestFor(issues = "TW-26507")
public void ssh_proxy_settings() {
final String sshProxyHost = "acme.org";
final String sshProxyPort = "3128";
final String sshProxyType = "http";
System.setProperty("teamcity.git.sshProxyType", sshProxyType);
System.setProperty("teamcity.git.sshProxyHost", sshProxyHost);
System.setProperty("teamcity.git.sshProxyPort", sshProxyPort);
ServerPluginConfig config = new PluginConfigImpl();
Proxy sshProxy = config.getJschProxy();
assertNotNull(sshProxy);
assertTrue(sshProxy instanceof ProxyHTTP);
List<String> separateProcessOptions = config.getOptionsForSeparateProcess();
assertThat(separateProcessOptions, hasItem("-Dteamcity.git.sshProxyType=" + sshProxyType));
assertThat(separateProcessOptions, hasItem("-Dteamcity.git.sshProxyHost=" + sshProxyHost));
assertThat(separateProcessOptions, hasItem("-Dteamcity.git.sshProxyPort=" + sshProxyPort));
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules3.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules3(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules3", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("-:first-level-submodule/sub-sub/file.txt"));
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("+:first-level-submodule"));
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitPatchTest method build_patch_should_respect_autocrlf.
@TestFor(issues = "TW-16530")
@Test(dataProvider = "patchInSeparateProcess")
public void build_patch_should_respect_autocrlf(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = vcsRoot().withAutoCrlf(true).withFetchUrl(myMainRepositoryDir.getAbsolutePath()).build();
setExpectedSeparator("\r\n");
checkPatch(root, "patch-eol", null, "465ad9f630e451b9f2b782ffb09804c6a98c4bb9", new CheckoutRules("-:dir"));
String content = new String(getSupport().getContentProvider().getContent("readme.txt", root, "465ad9f630e451b9f2b782ffb09804c6a98c4bb9"));
assertEquals(content, "Test repository for teamcity.change 1\r\nadd feature\r\n");
}
use of jetbrains.buildServer.util.TestFor in project teamcity-git by JetBrains.
the class GitVcsSupportTest method test_non_fast_forward_update.
@TestFor(issues = "TW-16351")
@Test(dataProvider = "doFetchInSeparateProcess", dataProviderClass = FetchOptionsDataProvider.class)
public void test_non_fast_forward_update(boolean fetchInSeparateProcess) throws Exception {
File remoteRepositoryDir = new File(myTmpDir, "repo_for_fetch");
copyRepository(dataFile("repo_for_fetch.1"), remoteRepositoryDir);
myConfigBuilder.setSeparateProcessForFetch(fetchInSeparateProcess);
GitVcsSupport support = getSupport();
VcsRoot root = getRoot("master", false, remoteRepositoryDir);
RepositoryStateData state = support.getCurrentState(root);
String v1 = GitUtils.versionRevision(state.getBranchRevisions().get(state.getDefaultBranchName()));
assertEquals(v1, "add81050184d3c818560bdd8839f50024c188586");
// fast-forward update
copyRepository(dataFile("repo_for_fetch.2"), remoteRepositoryDir);
state = support.getCurrentState(root);
String v2 = GitUtils.versionRevision(state.getBranchRevisions().get(state.getDefaultBranchName()));
assertEquals(v2, "d47dda159b27b9a8c4cee4ce98e4435eb5b17168");
// non-fast-forward update
copyRepository(dataFile("repo_for_fetch.3"), remoteRepositoryDir);
state = support.getCurrentState(root);
String v3 = GitUtils.versionRevision(state.getBranchRevisions().get(state.getDefaultBranchName()));
assertEquals("bba7fbcc200b4968e6abd2f7d475dc15306cafc6", v3);
}
Aggregations