Exemplo n.º 1
0
  /** Method: setProperty(String key, Object value) */
  @Test
  @SuppressWarnings("unchecked")
  public void testSetProperty() throws Exception {
    String key = "key";
    String value = "value";
    sinkExecutor.setProperty(key, value);

    Field field = sinkExecutor.getClass().getDeclaredField("sinkConfig");
    field.setAccessible(true);

    Map<String, Object> map = (Map<String, Object>) field.get(sinkExecutor);
    Assert.assertEquals(map.get(key), value);
  }
Exemplo n.º 2
0
 private void runSinkExecutor() {
   sinkExecutor.setProperty(MetricsSinksConfig.CONFIG_KEY_FLUSH_FREQUENCY_MS, FLUSH_INTERVAL_MS);
   threadsPool.execute(sinkExecutor);
 }