Search in sources :

Example 1 with DockerPort

use of com.palantir.docker.compose.connection.DockerPort in project atlasdb by palantir.

the class HikariCpConnectionManagerTest method createConnectionConfig.

private static ConnectionConfig createConnectionConfig(int maxConnections) {
    DockerPort port = docker.containers().container("postgres").port(POSTGRES_PORT_NUMBER);
    InetSocketAddress postgresAddress = new InetSocketAddress(port.getIp(), port.getExternalPort());
    return ImmutablePostgresConnectionConfig.builder().dbName("atlas").dbLogin("palantir").dbPassword(ImmutableMaskedValue.of("palantir")).host(postgresAddress.getHostName()).port(postgresAddress.getPort()).maxConnections(maxConnections).checkoutTimeout(2000).build();
}
Also used : DockerPort(com.palantir.docker.compose.connection.DockerPort) InetSocketAddress(java.net.InetSocketAddress)

Example 2 with DockerPort

use of com.palantir.docker.compose.connection.DockerPort in project atlasdb by palantir.

the class MultiCassandraUtils method waitForCassandraContainer.

private static void waitForCassandraContainer(Container container) {
    DockerPort containerPort = new DockerPort(container.getContainerName(), CASSANDRA_PORT, CASSANDRA_PORT);
    Awaitility.await().atMost(60, TimeUnit.SECONDS).until(containerPort::isListeningNow);
}
Also used : DockerPort(com.palantir.docker.compose.connection.DockerPort)

Example 3 with DockerPort

use of com.palantir.docker.compose.connection.DockerPort in project atlasdb by palantir.

the class StartupIndependenceUtils method killCassandraNodes.

public static void killCassandraNodes(List<String> nodes) throws InterruptedException {
    runOnCassandraNodes(nodes, MultiCassandraUtils::killCassandraContainer);
    nodes.forEach(node -> {
        DockerPort containerPort = new DockerPort(node, CASSANDRA_PORT, CASSANDRA_PORT);
        assertSatisfiedWithin(10, () -> !containerPort.isListeningNow());
    });
}
Also used : DockerPort(com.palantir.docker.compose.connection.DockerPort)

Example 4 with DockerPort

use of com.palantir.docker.compose.connection.DockerPort in project kafka-connect-cdc-mssql by jcustenborder.

the class MsSqlSettingsExtension method handleResolve.

@Override
protected Object handleResolve(ParameterContext parameterContext, ExtensionContext extensionContext, Annotation annotation, DockerComposeRule docker) throws ParameterResolutionException {
    Container container = docker.containers().container(MsSqlTestConstants.CONTAINER_NAME);
    DockerPort dockerPort = container.port(MsSqlTestConstants.PORT);
    return MsSqlTestConstants.settings(dockerPort.getIp(), dockerPort.getExternalPort());
}
Also used : Container(com.palantir.docker.compose.connection.Container) DockerPort(com.palantir.docker.compose.connection.DockerPort)

Example 5 with DockerPort

use of com.palantir.docker.compose.connection.DockerPort in project atlasdb by palantir.

the class DbkvsPostgresTestSuite method getKvsConfig.

public static DbKeyValueServiceConfig getKvsConfig() {
    DockerPort port = docker.containers().container("postgres").port(POSTGRES_PORT_NUMBER);
    InetSocketAddress postgresAddress = new InetSocketAddress(port.getIp(), port.getExternalPort());
    ConnectionConfig connectionConfig = ImmutablePostgresConnectionConfig.builder().dbName("atlas").dbLogin("palantir").dbPassword(ImmutableMaskedValue.of("palantir")).host(postgresAddress.getHostName()).port(postgresAddress.getPort()).build();
    return ImmutableDbKeyValueServiceConfig.builder().connection(connectionConfig).ddl(ImmutablePostgresDdlConfig.builder().compactInterval(HumanReadableDuration.days(2)).build()).build();
}
Also used : DockerPort(com.palantir.docker.compose.connection.DockerPort) InetSocketAddress(java.net.InetSocketAddress) ImmutablePostgresConnectionConfig(com.palantir.nexus.db.pool.config.ImmutablePostgresConnectionConfig) ConnectionConfig(com.palantir.nexus.db.pool.config.ConnectionConfig)

Aggregations

DockerPort (com.palantir.docker.compose.connection.DockerPort)9 InetSocketAddress (java.net.InetSocketAddress)4 URL (java.net.URL)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 CassandraKeyValueServiceConfig (com.palantir.atlasdb.cassandra.CassandraKeyValueServiceConfig)1 ImmutableCassandraKeyValueServiceConfig (com.palantir.atlasdb.cassandra.ImmutableCassandraKeyValueServiceConfig)1 Container (com.palantir.docker.compose.connection.Container)1 ConnectionConfig (com.palantir.nexus.db.pool.config.ConnectionConfig)1 ImmutablePostgresConnectionConfig (com.palantir.nexus.db.pool.config.ImmutablePostgresConnectionConfig)1 BufferedReader (java.io.BufferedReader)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 HttpURLConnection (java.net.HttpURLConnection)1 Proxy (java.net.Proxy)1 Map (java.util.Map)1 HttpsURLConnection (javax.net.ssl.HttpsURLConnection)1