Example usage for org.apache.commons.configuration AbstractConfiguration getInt

List of usage examples for org.apache.commons.configuration AbstractConfiguration getInt

Introduction

In this page you can find the example usage for org.apache.commons.configuration AbstractConfiguration getInt.

Prototype

public int getInt(String key) 

Source Link

Usage

From source file:org.apache.servicecomb.config.TestConfigUtil.java

@Test
public void testAddConfig() {
    Map<String, Object> config = new HashMap<>();
    config.put("service_description.name", "service_name_test");
    ConfigUtil.setConfigs(config);/* w  w  w. j ava2s  .  c  om*/
    ConfigUtil.addConfig("service_description.version", "1.0.2");
    ConfigUtil.addConfig("cse.test.enabled", true);
    ConfigUtil.addConfig("cse.test.num", 10);
    AbstractConfiguration configuration = ConfigUtil.createDynamicConfig();
    Assert.assertEquals(configuration.getString("service_description.name"), "service_name_test");
    Assert.assertTrue(configuration.getBoolean("cse.test.enabled"));
    Assert.assertEquals(configuration.getInt("cse.test.num"), 10);
}