Search in sources :

Example 6 with ServerPluginConfig

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

the class ServerPluginConfigTest method should_correct_negative_stream_threshold.

public void should_correct_negative_stream_threshold() {
    System.setProperty("teamcity.git.stream.file.threshold.mb", "-1");
    ServerPluginConfig config = new PluginConfigImpl(myServerPaths);
    assertTrue(config.getStreamFileThresholdMb() > 0);
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Example 7 with ServerPluginConfig

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

the class ServerPluginConfigTest method should_correct_zero_stream_threshold.

public void should_correct_zero_stream_threshold() {
    System.setProperty("teamcity.git.stream.file.threshold.mb", "0");
    ServerPluginConfig config = new PluginConfigImpl(myServerPaths);
    assertTrue(config.getStreamFileThresholdMb() > 0);
}
Also used : PluginConfigImpl(jetbrains.buildServer.buildTriggers.vcs.git.PluginConfigImpl) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig)

Example 8 with ServerPluginConfig

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

the class ServerPluginConfigTest method test_modern_proxy_settings.

@TestFor(issues = "TW-57178")
public void test_modern_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("teamcity.http.proxyHost", httpProxyHost);
    System.setProperty("teamcity.http.proxyPort", httpProxyPort);
    System.setProperty("teamcity.http.nonProxyHosts", httpNonProxyHosts);
    System.setProperty("teamcity.https.proxyHost", httpsProxyHost);
    System.setProperty("teamcity.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) TestFor(jetbrains.buildServer.util.TestFor)

Example 9 with ServerPluginConfig

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

the class RevisionsCacheTest method should_contain_last_n_revisions.

@Test(dataProvider = "true,false")
public void should_contain_last_n_revisions(boolean afterRestart) throws Exception {
    int cacheSize = 10;
    myConfigBuilder.setMapFullPathRevisionCacheSize(cacheSize);
    ServerPluginConfig config = myConfigBuilder.build();
    myCache = new RevisionsCache(config);
    File repo = repository("1");
    RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
    for (int i = 0; i < 100; i++) {
        repoCache.saveRevision("v" + i, true, repoCache.getResetCounter());
    }
    if (afterRestart) {
        myCache = new RevisionsCache(config);
        repoCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
    }
    for (int i = 100 - cacheSize; i < 100; i++) {
        then(repoCache.hasRevision("v" + i)).overridingErrorMessage("Doesn't contain entry for revision v" + i).isTrue();
    }
}
Also used : RepositoryRevisionCache(jetbrains.buildServer.buildTriggers.vcs.git.RepositoryRevisionCache) RevisionsCache(jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache) File(java.io.File) ServerPluginConfig(jetbrains.buildServer.buildTriggers.vcs.git.ServerPluginConfig) Test(org.testng.annotations.Test)

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