Bump to ebean-test-docker 5.0-RC1

This commit is contained in:
Rob Bygrave committed 2022-04-29 16:43:48 +12:00
1 parent 4bdb48d340
commit b18226711b
12 files changed
+64 -100

No files matched your search

@@ -1,6 +1,5 @@
package io.ebean.test.config.platform; package io.ebean.test.config.platform;
import io.ebean.docker.commands.ElasticConfig;
import io.ebean.docker.commands.ElasticContainer; import io.ebean.docker.commands.ElasticContainer;
import java.util.Properties; import java.util.Properties;
@@ -19,27 +18,18 @@ class ElasticSearchSetup {
} }
void run() { void run() {
ElasticConfig elasticConfig = readConfig();
if (elasticConfig != null) {
new ElasticContainer(elasticConfig).start();
}
}
ElasticConfig readConfig() {
String version = read("version", null); String version = read("version", null);
if (version == null) { if (version != null) {
// we need an explicit version to run Properties properties = populateDockerProperties(version);
return null; ElasticContainer.newBuilder(version)
.properties(properties)
.build()
.start();
} }
return new ElasticConfig(version, populateDockerProperties(version));
} }
private Properties populateDockerProperties(String version) { private Properties populateDockerProperties(String version) {
PropertiesBuilder properties = new PropertiesBuilder(); PropertiesBuilder properties = new PropertiesBuilder();
String mode = config.getProperty("ebean.test.shutdown"); String mode = config.getProperty("ebean.test.shutdown");
if (mode != null) { if (mode != null) {
properties.set("shutdown", mode); properties.set("shutdown", mode);
@@ -63,7 +53,7 @@ class ElasticSearchSetup {
private static class PropertiesBuilder { private static class PropertiesBuilder {
private Properties dockerProperties = new Properties(); private final Properties dockerProperties = new Properties();
private void set(String key, String val) { private void set(String key, String val) {
dockerProperties.setProperty("elastic." + key, val); dockerProperties.setProperty("elastic." + key, val);
@@ -1,6 +1,5 @@
package io.ebean.test.config.platform; package io.ebean.test.config.platform;
import io.ebean.docker.commands.RedisConfig;
import io.ebean.docker.commands.RedisContainer; import io.ebean.docker.commands.RedisContainer;
import java.util.Properties; import java.util.Properties;
@@ -16,9 +15,10 @@ class RedisSetup {
String host = dockerHost.dockerHost(properties.getProperty("ebean.test.dockerHost")); String host = dockerHost.dockerHost(properties.getProperty("ebean.test.dockerHost"));
properties.setProperty("redis.host", host); properties.setProperty("redis.host", host);
} }
RedisConfig redisConfig = new RedisConfig(version, properties); RedisContainer.newBuilder(version)
RedisContainer container = new RedisContainer(redisConfig); .properties(properties)
container.start(); .build()
.start();
} }
} }
} }
@@ -1,16 +1,13 @@
package main; package main;
import io.ebean.docker.commands.CockroachConfig;
import io.ebean.docker.commands.CockroachContainer; import io.ebean.docker.commands.CockroachContainer;
public class StartCockroach { public class StartCockroach {
public static void main(String[] args) { public static void main(String[] args) {
CockroachContainer.newBuilder("v21.2.4")
CockroachConfig config = new CockroachConfig("v21.2.4"); .dbName("unit")
config.setDbName("unit"); .build()
.start();
CockroachContainer container = new CockroachContainer(config);
container.start();
} }
} }
+9 -13
View File
@@ -1,22 +1,18 @@
package main; package main;
import io.ebean.docker.commands.Db2Config;
import io.ebean.docker.commands.Db2Container; import io.ebean.docker.commands.Db2Container;
public class StartDb2 { public class StartDb2 {
public static void main(String[] args) { public static void main(String[] args) {
Db2Container.newBuilder("11.5.6.0a")
Db2Config config = new Db2Config("11.5.6.0a"); .dbName("unit")
config.setDbName("unit"); .user("unit")
config.setUser("unit"); .password("unit")
config.setPassword("unit"); // to change collation, charset and other parameters like pagesize:
.configOptions("USING CODESET UTF-8 TERRITORY DE COLLATE USING IDENTITY PAGESIZE 32768")
// to change collation, charset and other parameters like pagesize: .configOptions("USING STRING_UNITS CODEUNITS32")
config.setCreateOptions("USING CODESET UTF-8 TERRITORY DE COLLATE USING IDENTITY PAGESIZE 32768"); .build()
config.setConfigOptions("USING STRING_UNITS CODEUNITS32"); .startWithDropCreate();
Db2Container container = new Db2Container(config);
container.startWithDropCreate();
} }
} }
@@ -1,18 +1,15 @@
package main; package main;
import io.ebean.docker.commands.MariaDBConfig;
import io.ebean.docker.commands.MariaDBContainer; import io.ebean.docker.commands.MariaDBContainer;
public class StartMariaDb { public class StartMariaDb {
public static void main(String[] args) { public static void main(String[] args) {
MariaDBContainer.newBuilder("10.5")
MariaDBConfig config = new MariaDBConfig("10.5"); .dbName("unit")
config.setDbName("unit"); .user("unit")
config.setUser("unit"); .password("unit")
config.setPassword("unit"); .build()
.startWithDropCreate();
MariaDBContainer container = new MariaDBContainer(config);
container.startWithDropCreate();
} }
} }
@@ -1,16 +1,17 @@
package main; package main;
import io.ebean.docker.commands.MySqlConfig;
import io.ebean.docker.commands.MySqlContainer; import io.ebean.docker.commands.MySqlContainer;
public class StartMySql { public class StartMySql {
public static void main(String[] args) { public static void main(String[] args) {
MySqlConfig config = new MySqlConfig("8.0"); MySqlContainer.newBuilder("8.0")
config.setDbName("unit"); .dbName("unit")
config.setUser("unit"); .user("unit")
config.setPassword("unit"); .password("unit")
.build()
.startWithDropCreate();
// by default this mysql docker collation is case sensitive // by default this mysql docker collation is case sensitive
// using utf8mb4_bin // using utf8mb4_bin
@@ -22,7 +23,5 @@ public class StartMySql {
// config.setCollation("utf8mb4_unicode_ci"); // config.setCollation("utf8mb4_unicode_ci");
// config.setCharacterSet("utf8mb4"); // config.setCharacterSet("utf8mb4");
MySqlContainer container = new MySqlContainer(config);
container.startWithDropCreate();
} }
} }
@@ -1,16 +1,14 @@
package main; package main;
import io.ebean.docker.commands.NuoDBConfig;
import io.ebean.docker.commands.NuoDBContainer; import io.ebean.docker.commands.NuoDBContainer;
public class StartNuoDB { public class StartNuoDB {
public static void main(String[] args) { public static void main(String[] args) {
NuoDBContainer container = NuoDBContainer.newBuilder("4.0")
.schema("test_user")
.build();
NuoDBConfig config = new NuoDBConfig();
config.setSchema("test_user");
NuoDBContainer container = new NuoDBContainer(config);
container.stopRemove(); container.stopRemove();
container.startWithDropCreate(); container.startWithDropCreate();
} }
@@ -1,16 +1,13 @@
package main; package main;
import io.ebean.docker.commands.OracleConfig;
import io.ebean.docker.commands.OracleContainer; import io.ebean.docker.commands.OracleContainer;
public class StartOracle { public class StartOracle {
public static void main(String[] args) { public static void main(String[] args) {
OracleContainer.newBuilder("latest")
OracleConfig config = new OracleConfig(); .user("test_ebean")
config.setUser("test_ebean"); .build()
.startWithDropCreate();
OracleContainer container = new OracleContainer(config);
container.startWithDropCreate();
} }
} }
@@ -1,21 +1,18 @@
package main; package main;
import io.ebean.docker.commands.PostgresConfig;
import io.ebean.docker.commands.PostgresContainer; import io.ebean.docker.commands.PostgresContainer;
public class StartPostgres { public class StartPostgres {
public static void main(String[] args) { public static void main(String[] args) {
PostgresContainer.newBuilder("13")
PostgresConfig config = new PostgresConfig("13"); .port(5432)
config.setPort(5432); .dbName("unit")
config.setDbName("unit"); .user("unit")
config.setUser("unit"); .password("unit")
config.setPassword("unit"); .containerName("pg13x")
config.setContainerName("pg13x"); .extensions("hstore,pgcrypto")
config.setExtensions("hstore,pgcrypto"); .build()
.startWithDropCreate();
PostgresContainer container = new PostgresContainer(config);
container.startWithDropCreate();
} }
} }
@@ -1,15 +1,15 @@
package main; package main;
import io.ebean.docker.commands.SqlServerConfig;
import io.ebean.docker.commands.SqlServerContainer; import io.ebean.docker.commands.SqlServerContainer;
public class StartSqlServer { public class StartSqlServer {
public static void main(String[] args) { public static void main(String[] args) {
SqlServerContainer.newBuilder("2019-GA-ubuntu-16.04")
SqlServerConfig config = new SqlServerConfig("2019-GA-ubuntu-16.04"); .dbName("test_ebean")
config.setDbName("test_ebean"); .user("test_ebean")
config.setUser("test_ebean"); .build()
.start();
// by default this sqlserver docker collation is case sensitive // by default this sqlserver docker collation is case sensitive
// using MSSQL_COLLATION=Latin1_General_100_BIN2 // using MSSQL_COLLATION=Latin1_General_100_BIN2
@@ -20,8 +20,5 @@ public class StartSqlServer {
//config.setCollation("default"); //config.setCollation("default");
//config.setCollation("Latin1_General_100_CI"); //config.setCollation("Latin1_General_100_CI");
SqlServerContainer container = new SqlServerContainer(config);
container.start();
} }
} }
@@ -1,20 +1,16 @@
package main; package main;
import io.ebean.docker.commands.YugabyteConfig;
import io.ebean.docker.commands.YugabyteContainer; import io.ebean.docker.commands.YugabyteContainer;
public class StartYugabyte { public class StartYugabyte {
public static void main(String[] args) { public static void main(String[] args) {
YugabyteContainer.newBuilder("2.11.2.0-b89")
// Check add extensions ? .dbName("unit")
YugabyteConfig config = new YugabyteConfig("2.11.2.0-b89"); .user("unit")
config.setDbName("unit"); .extensions("pgcrypto")
config.setUser("unit"); .build()
config.setExtensions("pgcrypto"); .startWithDropCreate();
YugabyteContainer container = new YugabyteContainer(config);
container.startWithDropCreate();
// Run container ut_yugabyte with host:localhost port:6433 db:unit user:unit/test shutdown:None // Run container ut_yugabyte with host:localhost port:6433 db:unit user:unit/test shutdown:None
// docker run -d --name ut_yugabyte -p 6433:5433 -p 7000:7000 -p 9000:9000 -p 9042:9042 yugabytedb/yugabyte:2.11.2.0-b89 bin/yugabyted start --daemon=false // docker run -d --name ut_yugabyte -p 6433:5433 -p 7000:7000 -p 9000:9000 -p 9042:9042 yugabytedb/yugabyte:2.11.2.0-b89 bin/yugabyted start --daemon=false
+1 -1
View File
@@ -44,7 +44,7 @@
<ebean-ddl-runner.version>1.3</ebean-ddl-runner.version> <ebean-ddl-runner.version>1.3</ebean-ddl-runner.version>
<ebean-migration-auto.version>1.2</ebean-migration-auto.version> <ebean-migration-auto.version>1.2</ebean-migration-auto.version>
<ebean-migration.version>13.0.0</ebean-migration.version> <ebean-migration.version>13.0.0</ebean-migration.version>
<ebean-test-docker.version>4.9</ebean-test-docker.version> <ebean-test-docker.version>5.0-RC1</ebean-test-docker.version>
<ebean-datasource.version>7.5</ebean-datasource.version> <ebean-datasource.version>7.5</ebean-datasource.version>
<ebean-agent.version>13.5.0</ebean-agent.version> <ebean-agent.version>13.5.0</ebean-agent.version>
<ebean-maven-plugin.version>13.5.0</ebean-maven-plugin.version> <ebean-maven-plugin.version>13.5.0</ebean-maven-plugin.version>