Examples of ConfigBuilder


Examples of net.greghaines.jesque.ConfigBuilder

        new QueueInfoDAORedisImpl(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructor_NullPool() {
        final Config config = new ConfigBuilder().build();
        new QueueInfoDAORedisImpl(config, null);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        PoolUtils.createJedisPool(null);
    }
   
    @Test
    public void testCreateJedisPool() {
        final Config config = new ConfigBuilder().build();
        Assert.assertNotNull(PoolUtils.createJedisPool(config));
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        Assert.assertNotNull(PoolUtils.createJedisPool(config));
    }
   
    @Test(expected = IllegalArgumentException.class)
    public void testCreateJedisPool_NullPoolConfig() {
        final Config config = new ConfigBuilder().build();
        PoolUtils.createJedisPool(config, null);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.failureDAO = new FailureDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        new FailureDAORedisImpl(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructor_NullPool() {
        final Config config = new ConfigBuilder().build();
        new FailureDAORedisImpl(config, null);
    }
View Full Code Here

Examples of org.apache.hadoop.metrics2.impl.ConfigBuilder

  public void testFileSink() throws IOException {
    outFile = getTestTempFile("test-file-sink-", ".out");
    final String outPath = outFile.getAbsolutePath()
   
    // NB: specify large period to avoid multiple metrics snapshotting:
    new ConfigBuilder().add("*.period", 10000)
        .add("test.sink.mysink0.class", FileSink.class.getName())
        .add("test.sink.mysink0.filename", outPath)
        // NB: we filter by context to exclude "metricssystem" context metrics:
        .add("test.sink.mysink0.context", "test1")
        .save(TestMetricsConfig.getTestFilename("hadoop-metrics2-test"));
View Full Code Here

Examples of org.apache.hadoop.metrics2.impl.ConfigBuilder

  /**
   * Filters should default to accept
   */
  @Test public void emptyConfigShouldAccept() {
    SubsetConfiguration empty = new ConfigBuilder().subset("");
    shouldAccept(empty, "anything");
    shouldAccept(empty, Arrays.asList(new MetricsTag("key", "desc", "value")));
    shouldAccept(empty, mockMetricsRecord("anything", Arrays.asList(
      new MetricsTag("key", "desc", "value"))));
  }
View Full Code Here

Examples of org.apache.hadoop.metrics2.impl.ConfigBuilder

  /**
   * Filters should handle white-listing correctly
   */
  @Test public void includeOnlyShouldOnlyIncludeMatched() {
    SubsetConfiguration wl = new ConfigBuilder()
        .add("p.include", "foo")
        .add("p.include.tags", "foo:f").subset("p");
    shouldAccept(wl, "foo");
    shouldAccept(wl, Arrays.asList(new MetricsTag("bar", "", ""),
                                   new MetricsTag("foo", "", "f")));
View Full Code Here

Examples of org.apache.hadoop.metrics2.impl.ConfigBuilder

  /**
   * Filters should handle black-listing correctly
   */
  @Test public void excludeOnlyShouldOnlyExcludeMatched() {
    SubsetConfiguration bl = new ConfigBuilder()
        .add("p.exclude", "foo")
        .add("p.exclude.tags", "foo:f").subset("p");
    shouldAccept(bl, "bar");
    shouldAccept(bl, Arrays.asList(new MetricsTag("bar", "", "")));
    shouldAccept(bl, mockMetricsRecord("bar", Arrays.asList(
View Full Code Here

Examples of org.apache.hadoop.metrics2.impl.ConfigBuilder

  /**
   * Filters should accepts unmatched item when both include and
   * exclude patterns are present.
   */
  @Test public void shouldAcceptUnmatchedWhenBothAreConfigured() {
    SubsetConfiguration c = new ConfigBuilder()
        .add("p.include", "foo")
        .add("p.include.tags", "foo:f")
        .add("p.exclude", "bar")
        .add("p.exclude.tags", "bar:b").subset("p");
    shouldAccept(c, "foo");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.