use of com.netflix.config.PollResult in project java-chassis by ServiceComb.
the class TestYAMLConfigurationSource method testPullFromGivenFiles.
@Test
public void testPullFromGivenFiles() throws Exception {
YAMLConfigurationSource configSource = new YAMLConfigurationSource(new File(System.getProperty("user.dir") + "/target/test-classes", "m1.yaml"));
PollResult result = configSource.poll(true, null);
Map<String, Object> configMap = result.getComplete();
assertNotNull(configMap);
assertNotNull(configMap.get("trace.handler.sampler.percent"));
assertEquals("okok", configMap.get("zq.test"));
System.getProperties().clear();
}
use of com.netflix.config.PollResult in project java-chassis by ServiceComb.
the class TestYAMLConfigurationSource method testPullFroGivenURL.
@Test
public void testPullFroGivenURL() throws Exception {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL test1URL = loader.getResource("test1.yaml");
URL test2URL = loader.getResource("test2.yaml");
System.setProperty("cse.configurationSource.additionalUrls", test1URL.toString() + "," + test2URL.toString());
YAMLConfigurationSource configSource = new YAMLConfigurationSource();
PollResult result = configSource.poll(true, null);
Map<String, Object> configMap = result.getComplete();
assertNotNull(configMap);
assertEquals(29, configMap.size());
assertNotNull(configMap.get("trace.handler.sampler.percent"));
assertEquals(0.5, configMap.get("trace.handler.sampler.percent"));
System.getProperties().clear();
}
Aggregations