List of usage examples for org.eclipse.jgit.lib Config setBoolean
public void setBoolean(final String section, final String subsection, final String name, final boolean value)
From source file:com.google.gerrit.acceptance.AbstractDaemonTest.java
License:Apache License
protected static Config submitWholeTopicEnabledConfig() { Config cfg = new Config(); cfg.setBoolean("change", null, "submitWholeTopic", true); return cfg;/*from www . j av a 2 s . c o m*/ }
From source file:com.google.gerrit.acceptance.AbstractDaemonTest.java
License:Apache License
protected static Config allowDraftsDisabledConfig() { Config cfg = new Config(); cfg.setBoolean("change", null, "allowDrafts", false); return cfg;// w w w . j a v a 2 s . com }
From source file:com.google.gerrit.acceptance.api.accounts.AccountIT.java
License:Apache License
@ConfigSuite.Default public static Config enableSignedPushConfig() { Config cfg = new Config(); cfg.setBoolean("receive", null, "enableSignedPush", true); return cfg;// ww w. j a va 2s.com }
From source file:com.google.gerrit.acceptance.api.accounts.AgreementsIT.java
License:Apache License
@ConfigSuite.Config public static Config enableAgreementsConfig() { Config cfg = new Config(); cfg.setBoolean("auth", null, "contributorAgreements", true); return cfg;/*from www . ja va2 s .co m*/ }
From source file:com.google.gerrit.acceptance.GerritServer.java
License:Apache License
/** Returns fully started Gerrit server */ static GerritServer start(Description desc, Config baseConfig) throws Exception { Config cfg = desc.buildConfig(baseConfig); Logger.getLogger("com.google.gerrit").setLevel(Level.DEBUG); final CyclicBarrier serverStarted = new CyclicBarrier(2); final Daemon daemon = new Daemon(new Runnable() { @Override/*from w w w.ja v a2 s .c o m*/ public void run() { try { serverStarted.await(); } catch (InterruptedException | BrokenBarrierException e) { throw new RuntimeException(e); } } }); daemon.setEmailModuleForTesting(new FakeEmailSender.Module()); final File site; ExecutorService daemonService = null; if (desc.memory()) { site = null; mergeTestConfig(cfg); // Set the log4j configuration to an invalid one to prevent system logs // from getting configured and creating log files. System.setProperty(SystemLog.LOG4J_CONFIGURATION, "invalidConfiguration"); cfg.setBoolean("httpd", null, "requestLog", false); cfg.setBoolean("sshd", null, "requestLog", false); cfg.setBoolean("index", "lucene", "testInmemory", true); cfg.setString("gitweb", null, "cgi", ""); daemon.setEnableHttpd(desc.httpd()); daemon.setLuceneModule(new LuceneIndexModule(ChangeSchemas.getLatest().getVersion(), 0, null)); daemon.setDatabaseForTesting(ImmutableList.<Module>of(new InMemoryTestingDatabaseModule(cfg))); daemon.start(); } else { site = initSite(cfg); daemonService = Executors.newSingleThreadExecutor(); daemonService.submit(new Callable<Void>() { @Override public Void call() throws Exception { int rc = daemon.main(new String[] { "-d", site.getPath(), "--headless", "--console-log", "--show-stack-trace" }); if (rc != 0) { System.err.println("Failed to start Gerrit daemon"); serverStarted.reset(); } return null; } }); serverStarted.await(); System.out.println("Gerrit Server Started"); } Injector i = createTestInjector(daemon); return new GerritServer(desc, i, daemon, daemonService); }
From source file:com.google.gerrit.acceptance.GerritServer.java
License:Apache License
private static void mergeTestConfig(Config cfg) { String forceEphemeralPort = String.format("%s:0", getLocalHost().getHostName()); String url = "http://" + forceEphemeralPort + "/"; cfg.setString("gerrit", null, "canonicalWebUrl", url); cfg.setString("httpd", null, "listenUrl", url); cfg.setString("sshd", null, "listenAddress", forceEphemeralPort); cfg.setBoolean("sshd", null, "testUseInsecureRandom", true); cfg.unset("cache", null, "directory"); cfg.setString("gerrit", null, "basePath", "git"); cfg.setBoolean("sendemail", null, "enable", true); cfg.setInt("sendemail", null, "threadPoolSize", 0); cfg.setInt("cache", "projects", "checkFrequency", 0); cfg.setInt("plugins", null, "checkFrequency", 0); cfg.setInt("sshd", null, "threads", 1); cfg.setInt("sshd", null, "commandStartThreads", 1); cfg.setInt("receive", null, "threadPoolSize", 1); cfg.setInt("index", null, "threads", 1); }
From source file:com.google.gerrit.acceptance.git.VisibleRefFilterIT.java
License:Apache License
@ConfigSuite.Config public static Config noteDbWriteEnabled() { Config cfg = new Config(); cfg.setBoolean("notedb", "changes", "write", true); return cfg;/*w w w .j av a 2 s . co m*/ }
From source file:com.google.gerrit.acceptance.server.change.GetRelatedIT.java
License:Apache License
@ConfigSuite.Default public static Config byGroup() { Config cfg = new Config(); cfg.setBoolean("change", null, "getRelatedByAncestors", false); return cfg;/*from ww w . j av a 2 s . c om*/ }
From source file:com.google.gerrit.acceptance.server.change.GetRelatedIT.java
License:Apache License
@ConfigSuite.Config public static Config byAncestors() { Config cfg = new Config(); cfg.setBoolean("change", null, "getRelatedByAncestors", true); return cfg;/* w ww . jav a 2 s . c o m*/ }
From source file:com.google.gerrit.acceptance.server.notedb.NoteDbPrimaryIT.java
License:Apache License
@ConfigSuite.Default public static Config defaultConfig() { Config cfg = new Config(); cfg.setString("notedb", null, "concurrentWriterTimeout", "0s"); cfg.setString("notedb", null, "primaryStorageMigrationTimeout", "1d"); cfg.setBoolean("noteDb", null, "testRebuilderWrapper", true); return cfg;//ww w. jav a2 s.c om }