mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 03:22:59 +00:00
Merge pull request #2674 from ebean-orm/feature/ebean-test-container-5
Bump to ebean-test-docker 5.0-RC1
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import io.ebean.docker.commands.ElasticConfig;
|
||||
import io.ebean.docker.commands.ElasticContainer;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -19,27 +18,18 @@ class ElasticSearchSetup {
|
||||
}
|
||||
|
||||
void run() {
|
||||
ElasticConfig elasticConfig = readConfig();
|
||||
if (elasticConfig != null) {
|
||||
new ElasticContainer(elasticConfig).start();
|
||||
}
|
||||
}
|
||||
|
||||
ElasticConfig readConfig() {
|
||||
|
||||
String version = read("version", null);
|
||||
if (version == null) {
|
||||
// we need an explicit version to run
|
||||
return null;
|
||||
if (version != null) {
|
||||
Properties properties = populateDockerProperties(version);
|
||||
ElasticContainer.newBuilder(version)
|
||||
.properties(properties)
|
||||
.build()
|
||||
.start();
|
||||
}
|
||||
|
||||
return new ElasticConfig(version, populateDockerProperties(version));
|
||||
}
|
||||
|
||||
private Properties populateDockerProperties(String version) {
|
||||
|
||||
PropertiesBuilder properties = new PropertiesBuilder();
|
||||
|
||||
String mode = config.getProperty("ebean.test.shutdown");
|
||||
if (mode != null) {
|
||||
properties.set("shutdown", mode);
|
||||
@@ -63,7 +53,7 @@ class ElasticSearchSetup {
|
||||
|
||||
private static class PropertiesBuilder {
|
||||
|
||||
private Properties dockerProperties = new Properties();
|
||||
private final Properties dockerProperties = new Properties();
|
||||
|
||||
private void set(String key, String val) {
|
||||
dockerProperties.setProperty("elastic." + key, val);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import io.ebean.docker.commands.RedisConfig;
|
||||
import io.ebean.docker.commands.RedisContainer;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -16,9 +15,10 @@ class RedisSetup {
|
||||
String host = dockerHost.dockerHost(properties.getProperty("ebean.test.dockerHost"));
|
||||
properties.setProperty("redis.host", host);
|
||||
}
|
||||
RedisConfig redisConfig = new RedisConfig(version, properties);
|
||||
RedisContainer container = new RedisContainer(redisConfig);
|
||||
container.start();
|
||||
RedisContainer.newBuilder(version)
|
||||
.properties(properties)
|
||||
.build()
|
||||
.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.CockroachConfig;
|
||||
import io.ebean.docker.commands.CockroachContainer;
|
||||
|
||||
public class StartCockroach {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
CockroachConfig config = new CockroachConfig("v21.2.4");
|
||||
config.setDbName("unit");
|
||||
|
||||
CockroachContainer container = new CockroachContainer(config);
|
||||
container.start();
|
||||
CockroachContainer.newBuilder("v21.2.4")
|
||||
.dbName("unit")
|
||||
.build()
|
||||
.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.Db2Config;
|
||||
import io.ebean.docker.commands.Db2Container;
|
||||
|
||||
public class StartDb2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Db2Config config = new Db2Config("11.5.6.0a");
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setPassword("unit");
|
||||
|
||||
// to change collation, charset and other parameters like pagesize:
|
||||
config.setCreateOptions("USING CODESET UTF-8 TERRITORY DE COLLATE USING IDENTITY PAGESIZE 32768");
|
||||
config.setConfigOptions("USING STRING_UNITS CODEUNITS32");
|
||||
|
||||
Db2Container container = new Db2Container(config);
|
||||
container.startWithDropCreate();
|
||||
Db2Container.newBuilder("11.5.6.0a")
|
||||
.dbName("unit")
|
||||
.user("unit")
|
||||
.password("unit")
|
||||
// to change collation, charset and other parameters like pagesize:
|
||||
.configOptions("USING CODESET UTF-8 TERRITORY DE COLLATE USING IDENTITY PAGESIZE 32768")
|
||||
.configOptions("USING STRING_UNITS CODEUNITS32")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.MariaDBConfig;
|
||||
import io.ebean.docker.commands.MariaDBContainer;
|
||||
|
||||
public class StartMariaDb {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
MariaDBConfig config = new MariaDBConfig("10.5");
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setPassword("unit");
|
||||
|
||||
MariaDBContainer container = new MariaDBContainer(config);
|
||||
container.startWithDropCreate();
|
||||
MariaDBContainer.newBuilder("10.5")
|
||||
.dbName("unit")
|
||||
.user("unit")
|
||||
.password("unit")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.MySqlConfig;
|
||||
import io.ebean.docker.commands.MySqlContainer;
|
||||
|
||||
public class StartMySql {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
MySqlConfig config = new MySqlConfig("8.0");
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setPassword("unit");
|
||||
MySqlContainer.newBuilder("8.0")
|
||||
.dbName("unit")
|
||||
.user("unit")
|
||||
.password("unit")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
|
||||
// by default this mysql docker collation is case sensitive
|
||||
// using utf8mb4_bin
|
||||
@@ -22,7 +23,5 @@ public class StartMySql {
|
||||
// config.setCollation("utf8mb4_unicode_ci");
|
||||
// config.setCharacterSet("utf8mb4");
|
||||
|
||||
MySqlContainer container = new MySqlContainer(config);
|
||||
container.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.NuoDBConfig;
|
||||
import io.ebean.docker.commands.NuoDBContainer;
|
||||
|
||||
public class StartNuoDB {
|
||||
|
||||
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.startWithDropCreate();
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.OracleConfig;
|
||||
import io.ebean.docker.commands.OracleContainer;
|
||||
|
||||
public class StartOracle {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
OracleConfig config = new OracleConfig();
|
||||
config.setUser("test_ebean");
|
||||
|
||||
OracleContainer container = new OracleContainer(config);
|
||||
container.startWithDropCreate();
|
||||
OracleContainer.newBuilder("latest")
|
||||
.user("test_ebean")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.PostgresConfig;
|
||||
import io.ebean.docker.commands.PostgresContainer;
|
||||
|
||||
public class StartPostgres {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
PostgresConfig config = new PostgresConfig("13");
|
||||
config.setPort(5432);
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setPassword("unit");
|
||||
config.setContainerName("pg13x");
|
||||
config.setExtensions("hstore,pgcrypto");
|
||||
|
||||
PostgresContainer container = new PostgresContainer(config);
|
||||
container.startWithDropCreate();
|
||||
PostgresContainer.newBuilder("13")
|
||||
.port(5432)
|
||||
.dbName("unit")
|
||||
.user("unit")
|
||||
.password("unit")
|
||||
.containerName("pg13x")
|
||||
.extensions("hstore,pgcrypto")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.SqlServerConfig;
|
||||
import io.ebean.docker.commands.SqlServerContainer;
|
||||
|
||||
public class StartSqlServer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SqlServerConfig config = new SqlServerConfig("2019-GA-ubuntu-16.04");
|
||||
config.setDbName("test_ebean");
|
||||
config.setUser("test_ebean");
|
||||
SqlServerContainer.newBuilder("2019-GA-ubuntu-16.04")
|
||||
.dbName("test_ebean")
|
||||
.user("test_ebean")
|
||||
.build()
|
||||
.start();
|
||||
|
||||
// by default this sqlserver docker collation is case sensitive
|
||||
// using MSSQL_COLLATION=Latin1_General_100_BIN2
|
||||
@@ -20,8 +20,5 @@ public class StartSqlServer {
|
||||
|
||||
//config.setCollation("default");
|
||||
//config.setCollation("Latin1_General_100_CI");
|
||||
|
||||
SqlServerContainer container = new SqlServerContainer(config);
|
||||
container.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.YugabyteConfig;
|
||||
import io.ebean.docker.commands.YugabyteContainer;
|
||||
|
||||
public class StartYugabyte {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// Check add extensions ?
|
||||
YugabyteConfig config = new YugabyteConfig("2.11.2.0-b89");
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setExtensions("pgcrypto");
|
||||
|
||||
YugabyteContainer container = new YugabyteContainer(config);
|
||||
container.startWithDropCreate();
|
||||
YugabyteContainer.newBuilder("2.11.2.0-b89")
|
||||
.dbName("unit")
|
||||
.user("unit")
|
||||
.extensions("pgcrypto")
|
||||
.build()
|
||||
.startWithDropCreate();
|
||||
|
||||
// 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
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<ebean-ddl-runner.version>1.3</ebean-ddl-runner.version>
|
||||
<ebean-migration-auto.version>1.2</ebean-migration-auto.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</ebean-test-docker.version>
|
||||
<ebean-datasource.version>7.5</ebean-datasource.version>
|
||||
<ebean-agent.version>13.5.0</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>13.5.0</ebean-maven-plugin.version>
|
||||
|
||||
Reference in New Issue
Block a user