@Test public void testConstructorWithFile() throws IOException { final File tempFile = File.createTempFile("centrifuge-config", ".conf"); tempFile.deleteOnExit(); Files.copy(getClass().getResourceAsStream("/centrifuge-config-test.conf"), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); final CentrifugeConfig centrifugeConfig = new CentrifugeConfig(tempFile.getAbsolutePath()); assertEquals(centrifugeConfig.getWarmerConfigs().size(), 1); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getWarmerClass(), EchoWarmer.class); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getMaxIterations(), 7777); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getTimeoutMillis(), 1000); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getYieldMillis(), 77); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getMaxFailure(), 777); assertEquals(centrifugeConfig.getWarmerConfigs().get(0).getConcurrency(), 7); assertTrue(centrifugeConfig.getWarmerConfigs().get(0).isRequired()); assertEquals(String.valueOf(centrifugeConfig.getWarmerConfigs().get(0).getParams().get("text")), "this is a sample warmer implementation"); }
public List<WarmerConfig> getWarmerConfigs() { return ImmutableList.copyOf(this.warmerConfigs); }
CentrifugeConfig { public List<WarmerConfig> getWarmerConfigs() { return ImmutableList.copyOf(this.warmerConfigs); } }
CentrifugeConfig { public List<WarmerConfig> getWarmerConfigs() { return ImmutableList.copyOf(this.warmerConfigs); } CentrifugeConfig();  CentrifugeConfig(final String pathToConfig); }
CentrifugeConfig { public List<WarmerConfig> getWarmerConfigs() { return ImmutableList.copyOf(this.warmerConfigs); } CentrifugeConfig();  CentrifugeConfig(final String pathToConfig); CentrifugeConfig addWarmerConfig(final WarmerConfig config); List<WarmerConfig> getWarmerConfigs(); int getLogIntervalSeconds(); CentrifugeConfig setLogIntervalSeconds(int logIntervalSeconds); int getCleanupIntervalMillis(); CentrifugeConfig setCleanupIntervalMillis(int cleanupIntervalMillis); int getParallelism(); CentrifugeConfig setParallelism(int parallelism); }
CentrifugeConfig { public List<WarmerConfig> getWarmerConfigs() { return ImmutableList.copyOf(this.warmerConfigs); } CentrifugeConfig();  CentrifugeConfig(final String pathToConfig); CentrifugeConfig addWarmerConfig(final WarmerConfig config); List<WarmerConfig> getWarmerConfigs(); int getLogIntervalSeconds(); CentrifugeConfig setLogIntervalSeconds(int logIntervalSeconds); int getCleanupIntervalMillis(); CentrifugeConfig setCleanupIntervalMillis(int cleanupIntervalMillis); int getParallelism(); CentrifugeConfig setParallelism(int parallelism);  }