Search in sources :

Example 1 with ServerPluginConfig

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

the class ServerPluginConfigTest method test_default_idle_timeout.

public void test_default_idle_timeout() {
    ServerPluginConfig config = new PluginConfigImpl(myServerPaths);
    assertEquals(PluginConfig.DEFAULT_IDLE_TIMEOUT, config.getIdleTimeoutSeconds());
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Example 2 with ServerPluginConfig

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

the class ServerPluginConfigTest method test_idle_timeout.

public void test_idle_timeout() {
    System.setProperty("teamcity.git.idle.timeout.seconds", "60");
    ServerPluginConfig config = new PluginConfigImpl(myServerPaths);
    assertEquals(60, config.getIdleTimeoutSeconds());
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Example 3 with ServerPluginConfig

use of jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig 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));
}
Also used : Proxy(com.jcraft.jsch.Proxy) ProxyHTTP(com.jcraft.jsch.ProxyHTTP) PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig) TestFor(jetbrains.buildServer.util.TestFor)

Example 4 with ServerPluginConfig

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

the class ServerPluginConfigTest method test_proxy_settings.

public void test_proxy_settings() {
    final String httpProxyHost = "some.org";
    final String httpProxyPort = "3128";
    final String httpNonProxyHosts = "localhost|*.mydomain.com";
    final String httpsProxyPort = "3129";
    final String httpsProxyHost = "other.org";
    System.setProperty("http.proxyHost", httpProxyHost);
    System.setProperty("http.proxyPort", httpProxyPort);
    System.setProperty("http.nonProxyHosts", httpNonProxyHosts);
    System.setProperty("https.proxyHost", httpsProxyHost);
    System.setProperty("https.proxyPort", httpsProxyPort);
    ServerPluginConfig config = new PluginConfigImpl(myServerPaths);
    assertEquals(asList("-Dhttp.proxyHost=" + httpProxyHost, "-Dhttp.proxyPort=" + httpProxyPort, SystemInfo.isUnix ? "-Dhttp.nonProxyHosts=" + httpNonProxyHosts : "-Dhttp.nonProxyHosts=\"" + httpNonProxyHosts + "\"", "-Dhttps.proxyHost=" + httpsProxyHost, "-Dhttps.proxyPort=" + httpsProxyPort), config.getOptionsForSeparateProcess());
    assertNull(config.getJschProxy());
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Example 5 with ServerPluginConfig

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

the class ServerPluginConfigTest method amazon_hosts.

public void amazon_hosts() {
    ServerPluginConfig config = new PluginConfigImpl();
    assertTrue(config.getAmazonHosts().isEmpty());
    System.setProperty(Constants.AMAZON_HOSTS, "host1");
    assertThat(config.getAmazonHosts(), hasItems("host1"));
    System.setProperty(Constants.AMAZON_HOSTS, "host1,host2");
    assertThat(config.getAmazonHosts(), hasItems("host1", "host2"));
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Aggregations

ServerPluginConfig (jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)9 PluginConfigImpl (jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl)8 TestFor (jetbrains.buildServer.util.TestFor)2 Proxy (com.jcraft.jsch.Proxy)1 ProxyHTTP (com.jcraft.jsch.ProxyHTTP)1 File (java.io.File)1 RepositoryRevisionCache (jetbrains.buildServer.buildTriggers.vcs.git.RepositoryRevisionCache)1 RevisionsCache (jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache)1 Test (org.testng.annotations.Test)1