Skip to content

Commit 1f3ac9d

Browse files
committed
Move Oracle XE tests to JUnit Jupiter
1 parent a5cd4e9 commit 1f3ac9d

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

modules/oracle-xe/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ dependencies {
66
compileOnly project(':testcontainers-r2dbc')
77
compileOnly 'com.oracle.database.r2dbc:oracle-r2dbc:1.3.0'
88

9+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
10+
11+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
912
testImplementation project(':testcontainers-jdbc-test')
1013
testImplementation 'com.oracle.database.jdbc:ojdbc11:23.9.0.25.07'
1114

@@ -20,3 +23,7 @@ tasks.japicmp {
2023
"org.testcontainers.containers.OracleContainer"
2124
]
2225
}
26+
27+
test {
28+
useJUnitPlatform()
29+
}

modules/oracle-xe/src/test/java/org/testcontainers/containers/jdbc/OracleJDBCDriverTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
import com.zaxxer.hikari.HikariDataSource;
55
import org.apache.commons.dbutils.QueryRunner;
66
import org.apache.commons.dbutils.ResultSetHandler;
7-
import org.junit.Test;
7+
import org.junit.jupiter.api.Test;
88

99
import java.sql.ResultSet;
1010
import java.sql.SQLException;
1111

1212
import static org.assertj.core.api.Assertions.assertThat;
1313

14-
public class OracleJDBCDriverTest {
14+
class OracleJDBCDriverTest {
1515

1616
@Test
17-
public void testOracleWithNoSpecifiedVersion() throws SQLException {
17+
void testOracleWithNoSpecifiedVersion() throws SQLException {
1818
performSimpleTest("jdbc:tc:oracle://hostname/databasename");
1919
}
2020

modules/oracle-xe/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.testcontainers.junit.oracle;
22

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44
import org.testcontainers.containers.OracleContainer;
55
import org.testcontainers.db.AbstractContainerDatabaseTest;
66
import org.testcontainers.utility.DockerImageName;
@@ -11,7 +11,7 @@
1111
import static org.assertj.core.api.Assertions.assertThat;
1212
import static org.assertj.core.api.Assertions.fail;
1313

14-
public class SimpleOracleTest extends AbstractContainerDatabaseTest {
14+
class SimpleOracleTest extends AbstractContainerDatabaseTest {
1515

1616
public static final DockerImageName ORACLE_DOCKER_IMAGE_NAME = DockerImageName.parse(
1717
"gvenzl/oracle-xe:21-slim-faststart"
@@ -32,7 +32,7 @@ private void runTest(OracleContainer container, String databaseName, String user
3232
}
3333

3434
@Test
35-
public void testDefaultSettings() throws SQLException {
35+
void testDefaultSettings() throws SQLException {
3636
try ( // container {
3737
OracleContainer oracle = new OracleContainer("gvenzl/oracle-xe:21-slim-faststart")
3838
// }
@@ -46,14 +46,14 @@ public void testDefaultSettings() throws SQLException {
4646
}
4747

4848
@Test
49-
public void testPluggableDatabase() throws SQLException {
49+
void testPluggableDatabase() throws SQLException {
5050
try (OracleContainer oracle = new OracleContainer(ORACLE_DOCKER_IMAGE_NAME).withDatabaseName("testDB")) {
5151
runTest(oracle, "testDB", "test", "test");
5252
}
5353
}
5454

5555
@Test
56-
public void testPluggableDatabaseAndCustomUser() throws SQLException {
56+
void testPluggableDatabaseAndCustomUser() throws SQLException {
5757
try (
5858
OracleContainer oracle = new OracleContainer("gvenzl/oracle-xe:21-slim-faststart")
5959
.withDatabaseName("testDB")
@@ -65,7 +65,7 @@ public void testPluggableDatabaseAndCustomUser() throws SQLException {
6565
}
6666

6767
@Test
68-
public void testCustomUser() throws SQLException {
68+
void testCustomUser() throws SQLException {
6969
try (
7070
OracleContainer oracle = new OracleContainer(ORACLE_DOCKER_IMAGE_NAME)
7171
.withUsername("testUser")
@@ -76,7 +76,7 @@ public void testCustomUser() throws SQLException {
7676
}
7777

7878
@Test
79-
public void testSID() throws SQLException {
79+
void testSID() throws SQLException {
8080
try (OracleContainer oracle = new OracleContainer(ORACLE_DOCKER_IMAGE_NAME).usingSid();) {
8181
runTest(oracle, "xepdb1", "system", "test");
8282

@@ -87,7 +87,7 @@ public void testSID() throws SQLException {
8787
}
8888

8989
@Test
90-
public void testSIDAndCustomPassword() throws SQLException {
90+
void testSIDAndCustomPassword() throws SQLException {
9191
try (
9292
OracleContainer oracle = new OracleContainer(ORACLE_DOCKER_IMAGE_NAME)
9393
.usingSid()
@@ -98,7 +98,7 @@ public void testSIDAndCustomPassword() throws SQLException {
9898
}
9999

100100
@Test
101-
public void testErrorPaths() throws SQLException {
101+
void testErrorPaths() throws SQLException {
102102
try (OracleContainer oracle = new OracleContainer(ORACLE_DOCKER_IMAGE_NAME)) {
103103
try {
104104
oracle.withDatabaseName("XEPDB1");

0 commit comments

Comments
 (0)