diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
index 0337934b046..913f9958ca1 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yaml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -39,7 +39,7 @@ body:
- MySQL
- Neo4j
- NGINX
- - OceanBase CE
+ - OceanBase
- Oracle Free
- Oracle XE
- OrientDB
diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml
index 0fd5ccf8d9d..bf73d4d12d4 100644
--- a/.github/ISSUE_TEMPLATE/enhancement.yaml
+++ b/.github/ISSUE_TEMPLATE/enhancement.yaml
@@ -39,7 +39,7 @@ body:
- MySQL
- Neo4j
- NGINX
- - OceanBase CE
+ - OceanBase
- Oracle Free
- Oracle XE
- OrientDB
diff --git a/.github/ISSUE_TEMPLATE/feature.yaml b/.github/ISSUE_TEMPLATE/feature.yaml
index 61d5c78916c..bd09a3db2e4 100644
--- a/.github/ISSUE_TEMPLATE/feature.yaml
+++ b/.github/ISSUE_TEMPLATE/feature.yaml
@@ -39,7 +39,7 @@ body:
- MySQL
- Neo4j
- NGINX
- - OceanBase CE
+ - OceanBase
- Oracle Free
- Oracle XE
- OrientDB
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 0043334eb56..0f33f0a25ae 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -202,7 +202,7 @@ updates:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "gradle"
- directory: "/modules/oceanbase-ce"
+ directory: "/modules/oceanbase"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
diff --git a/.github/labeler.yml b/.github/labeler.yml
index bbef114d227..208679762a9 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -123,10 +123,10 @@
- changed-files:
- any-glob-to-any-file:
- modules/nginx/**/*
-"modules/oceanbase-ce":
+"modules/oceanbase":
- changed-files:
- any-glob-to-any-file:
- - modules/oceanbase-ce/**/*
+ - modules/oceanbase/**/*
"modules/oracle":
- changed-files:
- any-glob-to-any-file:
diff --git a/docs/modules/databases/jdbc.md b/docs/modules/databases/jdbc.md
index 3f2129bd644..d26a43d041c 100644
--- a/docs/modules/databases/jdbc.md
+++ b/docs/modules/databases/jdbc.md
@@ -57,7 +57,7 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
#### Using OceanBase
-`jdbc:tc:oceanbase:4.2.1_bp3:///databasename`
+`jdbc:tc:oceanbasece:4.2.1_bp3:///databasename`
#### Using Oracle
diff --git a/docs/modules/databases/oceanbasece.md b/docs/modules/databases/oceanbase.md
similarity index 82%
rename from docs/modules/databases/oceanbasece.md
rename to docs/modules/databases/oceanbase.md
index 87e84f9b5f5..b90a492a6e4 100644
--- a/docs/modules/databases/oceanbasece.md
+++ b/docs/modules/databases/oceanbase.md
@@ -1,4 +1,4 @@
-# OceanBase-CE Module
+# OceanBase Module
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
@@ -8,14 +8,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:oceanbase-ce:{{latest_version}}"
+ testImplementation "org.testcontainers:oceanbase:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- oceanbase-ce
+ oceanbase
{{latest_version}}
test
diff --git a/mkdocs.yml b/mkdocs.yml
index 086f11de147..4b95b76ccda 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -64,7 +64,7 @@ nav:
- modules/databases/mssqlserver.md
- modules/databases/mysql.md
- modules/databases/neo4j.md
- - modules/databases/oceanbasece.md
+ - modules/databases/oceanbase.md
- modules/databases/oraclefree.md
- modules/databases/oraclexe.md
- modules/databases/orientdb.md
diff --git a/modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainerProvider.java b/modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainerProvider.java
deleted file mode 100644
index fd84a04d328..00000000000
--- a/modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainerProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.testcontainers.containers;
-
-import org.testcontainers.utility.DockerImageName;
-
-/**
- * Factory for OceanBase containers.
- */
-public class OceanBaseContainerProvider extends JdbcDatabaseContainerProvider {
-
- private static final String DEFAULT_TAG = "4.2.1_bp3";
-
- @Override
- public boolean supports(String databaseType) {
- return databaseType.equals(OceanBaseContainer.NAME);
- }
-
- @Override
- public JdbcDatabaseContainer newInstance() {
- return newInstance(DEFAULT_TAG);
- }
-
- @Override
- public JdbcDatabaseContainer newInstance(String tag) {
- if (tag != null) {
- return new OceanBaseContainer(DockerImageName.parse(OceanBaseContainer.DOCKER_IMAGE_NAME).withTag(tag));
- } else {
- return newInstance();
- }
- }
-}
diff --git a/modules/oceanbase-ce/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider b/modules/oceanbase-ce/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider
deleted file mode 100644
index 977e58989c9..00000000000
--- a/modules/oceanbase-ce/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider
+++ /dev/null
@@ -1 +0,0 @@
-org.testcontainers.containers.OceanBaseContainerProvider
diff --git a/modules/oceanbase-ce/src/test/java/org/testcontainers/OceanBaseTestImages.java b/modules/oceanbase-ce/src/test/java/org/testcontainers/OceanBaseTestImages.java
deleted file mode 100644
index b758e8b605f..00000000000
--- a/modules/oceanbase-ce/src/test/java/org/testcontainers/OceanBaseTestImages.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.testcontainers;
-
-import org.testcontainers.utility.DockerImageName;
-
-public class OceanBaseTestImages {
-
- public static final DockerImageName OCEANBASE_CE_IMAGE = DockerImageName.parse("oceanbase/oceanbase-ce:4.2.1_bp3");
-}
diff --git a/modules/oceanbase-ce/build.gradle b/modules/oceanbase/build.gradle
similarity index 72%
rename from modules/oceanbase-ce/build.gradle
rename to modules/oceanbase/build.gradle
index 0e4f901fada..e1f13a7a6a1 100644
--- a/modules/oceanbase-ce/build.gradle
+++ b/modules/oceanbase/build.gradle
@@ -1,4 +1,4 @@
-description = "Testcontainers :: JDBC :: OceanBase CE"
+description = "Testcontainers :: JDBC :: OceanBase"
dependencies {
api project(':jdbc')
diff --git a/modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainer.java b/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java
similarity index 65%
rename from modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainer.java
rename to modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java
index b609ca099fa..68406fd0442 100644
--- a/modules/oceanbase-ce/src/main/java/org/testcontainers/containers/OceanBaseContainer.java
+++ b/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java
@@ -1,10 +1,11 @@
-package org.testcontainers.containers;
+package org.testcontainers.oceanbase;
import org.apache.commons.lang3.StringUtils;
+import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.utility.DockerImageName;
/**
- * Testcontainers implementation for OceanBase.
+ * Testcontainers implementation for OceanBase Community Edition.
*
* Supported image: {@code oceanbase/oceanbase-ce}
*
@@ -14,33 +15,35 @@
*
RPC: 2882
*
*/
-public class OceanBaseContainer extends JdbcDatabaseContainer {
+public class OceanBaseCEContainer extends JdbcDatabaseContainer {
- static final String NAME = "oceanbase";
+ static final String NAME = "oceanbasece";
static final String DOCKER_IMAGE_NAME = "oceanbase/oceanbase-ce";
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse(DOCKER_IMAGE_NAME);
private static final Integer SQL_PORT = 2881;
+
private static final Integer RPC_PORT = 2882;
private static final String SYSTEM_TENANT_NAME = "sys";
- private static final String DEFAULT_TEST_TENANT_NAME = "test";
+
private static final String DEFAULT_USERNAME = "root";
+
private static final String DEFAULT_PASSWORD = "";
+
private static final String DEFAULT_DATABASE_NAME = "test";
- private boolean enableFastboot;
- private String mode;
- private String tenantName = DEFAULT_TEST_TENANT_NAME;
+ private String tenantName = "test";
+
private String driverClassName = "com.mysql.cj.jdbc.Driver";
- public OceanBaseContainer(String dockerImageName) {
+ public OceanBaseCEContainer(String dockerImageName) {
this(DockerImageName.parse(dockerImageName));
}
- public OceanBaseContainer(DockerImageName dockerImageName) {
+ public OceanBaseCEContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
@@ -83,34 +86,13 @@ protected String getTestQueryString() {
return "SELECT 1";
}
- /**
- * Enable fastboot.
- *
- * @return this
- */
- public OceanBaseContainer enableFastboot() {
- this.enableFastboot = true;
- return self();
- }
-
- /**
- * Set the deployment mode, see Docker Hub for more details.
- *
- * @param mode the deployment mode
- * @return this
- */
- public OceanBaseContainer withMode(String mode) {
- this.mode = mode;
- return self();
- }
-
/**
* Set the non-system tenant to be created for testing.
*
* @param tenantName the name of tenant to be created
* @return this
*/
- public OceanBaseContainer withTenant(String tenantName) {
+ public OceanBaseCEContainer withTenant(String tenantName) {
if (StringUtils.isEmpty(tenantName)) {
throw new IllegalArgumentException("Tenant name cannot be null or empty");
}
@@ -127,32 +109,19 @@ public OceanBaseContainer withTenant(String tenantName) {
* @param driverClassName the driver class name
* @return this
*/
- public OceanBaseContainer withDriverClassName(String driverClassName) {
+ public OceanBaseCEContainer withDriverClassName(String driverClassName) {
if (StringUtils.isEmpty(driverClassName)) {
throw new IllegalArgumentException("Driver class name cannot be null or empty");
}
if (!driverClassName.contains("mysql") && !driverClassName.contains("oceanbase")) {
throw new IllegalArgumentException("Driver class name should contains 'mysql' or 'oceanbase'");
}
- try {
- Class.forName(driverClassName);
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException("Driver class not found", e);
- }
this.driverClassName = driverClassName;
return self();
}
@Override
protected void configure() {
- if (StringUtils.isNotBlank(mode)) {
- withEnv("MODE", mode);
- }
- if (enableFastboot) {
- withEnv("FASTBOOT", "true");
- }
- if (!DEFAULT_TEST_TENANT_NAME.equals(tenantName)) {
- withEnv("OB_TENANT_NAME", tenantName);
- }
+ withEnv("OB_TENANT_NAME", tenantName);
}
}
diff --git a/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainerProvider.java b/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainerProvider.java
new file mode 100644
index 00000000000..88bb8514e07
--- /dev/null
+++ b/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainerProvider.java
@@ -0,0 +1,32 @@
+package org.testcontainers.oceanbase;
+
+import org.testcontainers.containers.JdbcDatabaseContainer;
+import org.testcontainers.containers.JdbcDatabaseContainerProvider;
+import org.testcontainers.utility.DockerImageName;
+
+/**
+ * Factory for OceanBase Community Edition containers.
+ */
+public class OceanBaseCEContainerProvider extends JdbcDatabaseContainerProvider {
+
+ private static final String DEFAULT_TAG = "4.2.1_bp3";
+
+ @Override
+ public boolean supports(String databaseType) {
+ return databaseType.equals(OceanBaseCEContainer.NAME);
+ }
+
+ @Override
+ public JdbcDatabaseContainer newInstance() {
+ return newInstance(DEFAULT_TAG);
+ }
+
+ @Override
+ public JdbcDatabaseContainer newInstance(String tag) {
+ if (tag != null) {
+ return new OceanBaseCEContainer(DockerImageName.parse(OceanBaseCEContainer.DOCKER_IMAGE_NAME).withTag(tag));
+ } else {
+ return newInstance();
+ }
+ }
+}
diff --git a/modules/oceanbase/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider b/modules/oceanbase/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider
new file mode 100644
index 00000000000..505bfe5e088
--- /dev/null
+++ b/modules/oceanbase/src/main/resources/META-INF/services/org.testcontainers.containers.JdbcDatabaseContainerProvider
@@ -0,0 +1 @@
+org.testcontainers.oceanbase.OceanBaseCEContainerProvider
diff --git a/modules/oceanbase-ce/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java b/modules/oceanbase/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java
similarity index 80%
rename from modules/oceanbase-ce/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java
rename to modules/oceanbase/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java
index d540c71e7cf..67331a0c09a 100644
--- a/modules/oceanbase-ce/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java
+++ b/modules/oceanbase/src/test/java/org/testcontainers/jdbc/oceanbase/OceanBaseJdbcDriverTest.java
@@ -13,7 +13,7 @@ public class OceanBaseJdbcDriverTest extends AbstractJDBCDriverTest {
@Parameterized.Parameters(name = "{index} - {0}")
public static Iterable