Examples of SubsetConfiguration


Examples of org.apache.commons.configuration.SubsetConfiguration

  }

  @Test
  public void testFlush() throws Exception {

    SubsetConfiguration configuration = createNiceMock(SubsetConfiguration.class);
    Connection connection = createNiceMock(Connection.class);

    // set expectations
    expect(configuration.getParent()).andReturn(null);
    expect(configuration.getPrefix()).andReturn("prefix");
    expect(configuration.getString("databaseUrl")).andReturn("url");
    connection.close();

    // replay
    replay(configuration, connection);
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

    verify(configuration, connection);
  }

  @Test
  public void testGetMetricRecordID() throws Exception {
    SubsetConfiguration configuration = createNiceMock(SubsetConfiguration.class);
    Connection connection = createNiceMock(Connection.class);
    CallableStatement cstmt = createNiceMock(CallableStatement.class);

    // set expectations
    expect(configuration.getParent()).andReturn(null);
    expect(configuration.getPrefix()).andReturn("prefix");
    expect(configuration.getString("databaseUrl")).andReturn("url");

    expect(connection.prepareCall("{call dbo.uspGetMetricRecord(?, ?, ?, ?, ?, ?, ?, ?, ?)}")).andReturn(cstmt);
    cstmt.setNString(1, "context");
    cstmt.setNString(2, "typeName");
    cstmt.setNString(3, "nodeName");
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

    verify(configuration, connection, cstmt);
  }

  @Test
  public void testGetMetricRecordID_nullReturn() throws Exception {
    SubsetConfiguration configuration = createNiceMock(SubsetConfiguration.class);
    Connection connection = createNiceMock(Connection.class);
    CallableStatement cstmt = createNiceMock(CallableStatement.class);

    // set expectations
    expect(configuration.getParent()).andReturn(null);
    expect(configuration.getPrefix()).andReturn("prefix");
    expect(configuration.getString("databaseUrl")).andReturn("url");

    expect(connection.prepareCall("{call dbo.uspGetMetricRecord(?, ?, ?, ?, ?, ?, ?, ?, ?)}")).andReturn(cstmt);
    cstmt.setNString(1, "context");
    cstmt.setNString(2, "typeName");
    cstmt.setNString(3, "nodeName");
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

    verify(configuration, connection, cstmt);
  }

  @Test
  public void testInsertMetricValue() throws Exception {
    SubsetConfiguration configuration = createNiceMock(SubsetConfiguration.class);
    Connection connection = createNiceMock(Connection.class);
    CallableStatement cstmt = createNiceMock(CallableStatement.class);

    // set expectations
    expect(configuration.getParent()).andReturn(null);
    expect(configuration.getPrefix()).andReturn("prefix");
    expect(configuration.getString("databaseUrl")).andReturn("url");

    expect(connection.prepareCall("{call dbo.uspInsertMetricValue(?, ?, ?)}")).andReturn(cstmt);
    cstmt.setLong(1, 9999L);
    cstmt.setNString(2, "metricName");
    cstmt.setNString(3, "metricValue");
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

        // get configuration property
        Object result = getConfiguration().getProperty(name);
        if (result == null)
        {
            // otherwise attempt to create bean from configuration subset
            Configuration subset = new SubsetConfiguration(getConfiguration(), name, PROPERTY_DELIMITER);
            if (!subset.isEmpty())
            {
                result = new ConfigurationDynaBean(subset);
            }
        }
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

        return new ConfigurationDynaClass(getConfiguration());
    }

    public void remove(String name, String key)
    {
        Configuration subset = new SubsetConfiguration(getConfiguration(), name, PROPERTY_DELIMITER);
        subset.setProperty(key, null);
    }
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

        // get configuration property
        Object result = getConfiguration().getProperty(name);
        if (result == null)
        {
            // otherwise attempt to create bean from configuration subset
            Configuration subset = new SubsetConfiguration(getConfiguration(), name, PROPERTY_DELIMITER);
            if (!subset.isEmpty())
            {
                result = new ConfigurationDynaBean(subset);
            }
        }
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

    }

    @Override
    public void remove(String name, String key)
    {
        Configuration subset = new SubsetConfiguration(getConfiguration(), name, PROPERTY_DELIMITER);
        subset.setProperty(key, null);
    }
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

   * Return a subset configuration (so getParent() can be used.)
   * @param prefix  of the subset
   * @return the subset config
   */
  public SubsetConfiguration subset(String prefix) {
    return new SubsetConfiguration(config, prefix, ".");
  }
View Full Code Here

Examples of org.apache.commons.configuration.SubsetConfiguration

import static org.apache.hadoop.metrics2.lib.Interns.*;

public class TestMetricsCollectorImpl {

  @Test public void recordBuilderShouldNoOpIfFiltered() {
    SubsetConfiguration fc = new ConfigBuilder()
        .add("p.exclude", "foo").subset("p");
    MetricsCollectorImpl mb = new MetricsCollectorImpl();
    mb.setRecordFilter(newGlobFilter(fc));
    MetricsRecordBuilderImpl rb = mb.addRecord("foo");
    rb.tag(info("foo", ""), "value").addGauge(info("g0", ""), 1);
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.