use of com.torodb.standalone.CliConfig in project torodb by torodb.
the class ConfigTest method testParseWithLogPackagesParam.
@Test
public void testParseWithLogPackagesParam() throws Exception {
final String logPackage = "com.torodb";
final LogLevel logLevel = LogLevel.NONE;
CliConfig cliConfig = new CliConfig() {
@Override
public List<String> getParams() {
String[] params = new String[] { "/generic/logPackages/" + logPackage + "=" + logLevel.name() };
return Arrays.asList(params);
}
};
Config config = CliConfigUtils.readConfig(cliConfig);
Assert.assertTrue("/generic/logPackages not defined", config.getGeneric().getLogPackages() != null);
Assert.assertTrue("/generic/logPackages/" + logPackage + " not defined", config.getGeneric().getLogPackages().get(logPackage) != null);
Assert.assertEquals("/generic/logPackages has not 1 entry", 1, config.getGeneric().getLogPackages().size());
Assert.assertEquals("/generic/logPackages/" + logPackage + " has different value than that specified", logLevel, config.getGeneric().getLogPackages().get(logPackage));
}
Aggregations