Search in sources :

Example 16 with CliConfig

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));
}
Also used : Config(com.torodb.standalone.config.model.Config) CliConfig(com.torodb.standalone.CliConfig) CliConfig(com.torodb.standalone.CliConfig) LogLevel(com.torodb.packaging.config.model.generic.LogLevel) Test(org.junit.Test)

Aggregations

CliConfig (com.torodb.standalone.CliConfig)16 Test (org.junit.Test)16 Config (com.torodb.standalone.config.model.Config)10 Postgres (com.torodb.standalone.config.model.backend.postgres.Postgres)5 Derby (com.torodb.standalone.config.model.backend.derby.Derby)2 LogLevel (com.torodb.packaging.config.model.generic.LogLevel)1 IndexFilter (com.torodb.packaging.config.model.protocol.mongo.FilterList.IndexFilter)1 File (java.io.File)1