use of org.rx.core.YamlConfiguration in project rxlib by RockyLOMO.
the class CoreTester method yamlConf.
@Test
public void yamlConf() {
System.out.println(FilenameUtils.getFullPath("b.txt"));
System.out.println(FilenameUtils.getFullPath("c:\\a\\b.txt"));
System.out.println(FilenameUtils.getFullPath("/a/b.txt"));
YamlConfiguration conf = YamlConfiguration.RX_CONF;
conf.enableWatch();
sleep(60000);
}
use of org.rx.core.YamlConfiguration in project rxlib by RockyLOMO.
the class CoreTester method rxConf.
// endregion
@Test
public void rxConf() {
Iterable<Object> all = new Yaml().loadAll(Reflects.getResource("application.yml"));
List<Object> list = IterableUtils.toList(all);
YamlConfiguration conf = YamlConfiguration.RX_CONF;
System.out.println(conf.getYaml());
Map codeMap = conf.readAs("org.rx.test.CoreTester", Map.class);
System.out.println(codeMap);
String codeFormat = conf.readAs("org.rx.test.CoreTester.exceptionHandle<IllegalArgumentException>", String.class);
System.out.println(codeFormat);
assert eq(codeFormat, "Test IAException, value={0}");
RxConfig rxConf = RxConfig.INSTANCE;
assert rxConf.getId().equals("Rx");
assert rxConf.getThreadPool().getReplicas() == 4;
assert rxConf.getNet().getConnectTimeoutMillis() == 40000;
assert rxConf.getLogTypeWhitelist().size() == 2;
assert rxConf.getJsonSkipTypes().size() == 1;
}
Aggregations