use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.
the class PostgresConfigLoadingTest method getConnectionConfig.
private ConnectionConfig getConnectionConfig() throws IOException {
AtlasDbConfig config = getPostgresTestConfig();
KeyValueServiceConfig keyValueServiceConfig = config.keyValueService();
DbKeyValueServiceConfig dbkvsConfig = (DbKeyValueServiceConfig) keyValueServiceConfig;
return dbkvsConfig.connection();
}
use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.
the class AtlasDbCommandUtilsTest method canSerializeAndDeserializeAtlasDbConfig.
@Test
public void canSerializeAndDeserializeAtlasDbConfig() throws IOException {
SslConfiguration ssl = SslConfiguration.of(new File("var/security/truststore.jks").toPath(), new File("var/security/keystore.jks").toPath(), "keystorePassword");
@SuppressWarnings("deprecation") AtlasDbConfig bigConfig = ImmutableAtlasDbConfig.builder().leader(ImmutableLeaderConfig.builder().quorumSize(1).addLeaders(LOCAL_SERVER_NAME).localServer(LOCAL_SERVER_NAME).sslConfiguration(ssl).learnerLogDir(new File("var/data/paxos/learner").getAbsoluteFile()).acceptorLogDir(new File("var/data/paxos/acceptor").getAbsoluteFile()).build()).keyValueService(ImmutableCassandraKeyValueServiceConfig.builder().keyspace("test").replicationFactor(3).servers(ImmutableSet.of(new InetSocketAddress("host1", 9160), new InetSocketAddress("host2", 9160), new InetSocketAddress("host3", 9160))).ssl(true).sslConfiguration(ssl).build()).build();
String configAsString = AtlasDbCommandUtils.serialiseConfiguration(bigConfig);
AtlasDbConfig deserializedConfig = AtlasDbConfigs.loadFromString(configAsString, "", AtlasDbConfig.class);
assertThat(bigConfig).isEqualTo(deserializedConfig);
}
use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.
the class AtlasDbCommandUtilsTest method clientConfigMatchesRuntimeConfigForTimelock.
@Test
public void clientConfigMatchesRuntimeConfigForTimelock() {
AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(minimalEmbeddedConfig, Optional.of(runtimeConfig));
assertThat(clientConfig).isEqualTo(timeLockConfig);
}
use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.
the class AtlasDbCommandUtilsTest method timestampBlockContainsLeadersAfterConvertingConfig.
@Test
public void timestampBlockContainsLeadersAfterConvertingConfig() {
AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(minimalLeaderConfig, Optional.of(EMPTY_RUNTIME_CONFIG));
assertThat(clientConfig.timestamp().get().servers()).containsExactly(LOCAL_SERVER_NAME);
}
use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.
the class AtlasDbCommandUtilsTest method clientConfigMatchesServerConfigForTimelock.
@Test
public void clientConfigMatchesServerConfigForTimelock() {
AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(timeLockConfig, Optional.of(EMPTY_RUNTIME_CONFIG));
assertThat(clientConfig).isEqualTo(timeLockConfig);
}
Aggregations