use of com.torodb.standalone.config.model.backend.derby.Derby in project torodb by torodb.
the class ConfigTest method testParseWithYAMLUsingDerby.
@Test
public void testParseWithYAMLUsingDerby() throws Exception {
CliConfig cliConfig = new CliConfig() {
@Override
public boolean hasConfFile() {
return true;
}
@Override
public InputStream getConfInputStream() {
return ConfigTest.class.getResourceAsStream("/test-parse-with-yaml-using-derby.yml");
}
};
Config config = CliConfigUtils.readConfig(cliConfig);
Assert.assertTrue("/backend not defined", config.getBackend() != null);
Assert.assertEquals("/backend/derby not defined", Derby.class, config.getBackend().getBackendImplementation().getClass());
Assert.assertTrue("/backend/derby not identified as AbstractDerby", config.getBackend().is(Derby.class));
Assert.assertTrue("/backend/derby not identified as AbstractDerby Like", config.getBackend().isLike(Derby.class));
Assert.assertEquals("/backend/derby/host has different value than that specified", "localhost", config.getBackend().as(Derby.class).getHost());
Assert.assertEquals("/backend/derby/port has different value than that specified", Integer.valueOf(5432), config.getBackend().as(Derby.class).getPort());
Assert.assertEquals("/backend/derby/user has different value than that specified", "root", config.getBackend().as(Derby.class).getUser());
Assert.assertEquals("/backend/derby/password specified but should have not been read from parameters", null, config.getBackend().as(Derby.class).getPassword());
}
use of com.torodb.standalone.config.model.backend.derby.Derby in project torodb by torodb.
the class ConfigTest method testParseWithYAMLAndReplaceBackendWithParam.
@Test
public void testParseWithYAMLAndReplaceBackendWithParam() throws Exception {
CliConfig cliConfig = new CliConfig() {
@Override
public boolean hasConfFile() {
return true;
}
@Override
public InputStream getConfInputStream() {
return ConfigTest.class.getResourceAsStream("/test-parse-with-yaml.yml");
}
@Override
public List<String> getParams() {
String[] params = new String[] { "/backend=null", "/backend/derby/host=localhost", "/backend/derby/port=5432", "/backend/derby/user=root" };
return Arrays.asList(params);
}
};
Config config = CliConfigUtils.readConfig(cliConfig);
Assert.assertTrue("/backend not defined", config.getBackend() != null);
Assert.assertEquals("/backend/derby not defined", Derby.class, config.getBackend().getBackendImplementation().getClass());
Assert.assertTrue("/backend/derby not identified as AbstractDerby", config.getBackend().is(Derby.class));
Assert.assertTrue("/backend/derby not identified as AbstractDerby Like", config.getBackend().isLike(Derby.class));
Assert.assertEquals("/backend/derby/host has different value than that specified", "localhost", config.getBackend().as(Derby.class).getHost());
Assert.assertEquals("/backend/derby/port has different value than that specified", Integer.valueOf(5432), config.getBackend().as(Derby.class).getPort());
Assert.assertEquals("/backend/derby/user has different value than that specified", "root", config.getBackend().as(Derby.class).getUser());
Assert.assertEquals("/backend/derby/password specified but should have not been read from parameters", null, config.getBackend().as(Derby.class).getPassword());
}
use of com.torodb.standalone.config.model.backend.derby.Derby in project torodb by torodb.
the class ToroDbBootstrapServiceTest method setUp.
@Before
public void setUp() {
config = new Config();
config.getProtocol().getMongo().setReplication(null);
config.getBackend().setBackendImplementation(new Derby());
config.getBackend().as(Derby.class).setPassword("torodb");
config.getGeneric().setLogLevel(LogLevel.TRACE);
ConfigUtils.validateBean(config);
}