diff --git a/build.gradle.kts b/build.gradle.kts index f9a9b7a..eb9a908 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,11 +38,11 @@ dependencies { api("com.google.code.findbugs:jsr305:3.0.2") // This dependency is used internally, and not exposed to consumers on their own compile classpath. - implementation("org.slf4j:slf4j-api:1.7.26") - implementation("com.oracle.ojdbc:ojdbc8:$ojdbcVersion") { - exclude(group = "com.oracle.ojdbc") + implementation("org.slf4j:slf4j-api:1.7.36") + implementation("com.oracle.database.jdbc:ojdbc8:$ojdbcVersion") { + exclude(group = "com.oracle.database.jdbc", module = "ucp") } - implementation("com.oracle.ojdbc:orai18n:$ojdbcVersion") + implementation("com.oracle.database.nls:orai18n:$ojdbcVersion") // Use Jupiter test framework testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion") diff --git a/src/main/java/org/utplsql/api/TestRunner.java b/src/main/java/org/utplsql/api/TestRunner.java index fe0c485..92afc90 100644 --- a/src/main/java/org/utplsql/api/TestRunner.java +++ b/src/main/java/org/utplsql/api/TestRunner.java @@ -145,8 +145,8 @@ public TestRunner addTags(Collection tags) { return this; } - public TestRunner catchOraStuck( boolean catchOraStuck ) { - this.options.catchOraStuck = catchOraStuck; + public TestRunner oraStuckTimeout(Integer oraStuckTimeout ) { + this.options.oraStuckTimeout = oraStuckTimeout; return this; } @@ -218,7 +218,7 @@ public void run(Connection conn) throws SQLException { TestRunnerStatement testRunnerStatement = null; try { - testRunnerStatement = ( options.catchOraStuck ) ? initStatementWithTimeout(conn) : initStatement(conn); + testRunnerStatement = ( options.oraStuckTimeout > 0 ) ? initStatementWithTimeout(conn, options.oraStuckTimeout) : initStatement(conn); logger.info("Running tests"); testRunnerStatement.execute(); logger.info("Running tests finished."); @@ -236,7 +236,7 @@ private TestRunnerStatement initStatement( Connection conn ) throws SQLException return compatibilityProxy.getTestRunnerStatement(options, conn); } - private TestRunnerStatement initStatementWithTimeout( Connection conn ) throws OracleCreateStatmenetStuckException, SQLException { + private TestRunnerStatement initStatementWithTimeout( Connection conn, int timeout ) throws OracleCreateStatmenetStuckException, SQLException { ExecutorService executor = Executors.newSingleThreadExecutor(); Callable callable = () -> compatibilityProxy.getTestRunnerStatement(options, conn); Future future = executor.submit(callable); @@ -244,7 +244,7 @@ private TestRunnerStatement initStatementWithTimeout( Connection conn ) throws O // We want to leave the statement open in case of stuck scenario TestRunnerStatement testRunnerStatement = null; try { - testRunnerStatement = future.get(2, TimeUnit.SECONDS); + testRunnerStatement = future.get(timeout, TimeUnit.SECONDS); } catch (TimeoutException e) { logger.error("Detected Oracle driver stuck during Statement initialization"); executor.shutdownNow(); diff --git a/src/main/java/org/utplsql/api/TestRunnerOptions.java b/src/main/java/org/utplsql/api/TestRunnerOptions.java index de8ee12..c17f3ce 100644 --- a/src/main/java/org/utplsql/api/TestRunnerOptions.java +++ b/src/main/java/org/utplsql/api/TestRunnerOptions.java @@ -30,7 +30,7 @@ public class TestRunnerOptions { public boolean randomTestOrder = false; public Integer randomTestOrderSeed; public final Set tags = new LinkedHashSet<>(); - public boolean catchOraStuck = false; + public Integer oraStuckTimeout = 0; public String getTagsAsString() { return String.join(",", tags); diff --git a/src/main/java/org/utplsql/api/Version.java b/src/main/java/org/utplsql/api/Version.java index bb336b6..18b5de4 100644 --- a/src/main/java/org/utplsql/api/Version.java +++ b/src/main/java/org/utplsql/api/Version.java @@ -33,10 +33,14 @@ public class Version implements Comparable { public final static Version V3_1_6 = new Version("3.1.6", 3, 1, 6, 2729, true); public final static Version V3_1_7 = new Version("3.1.7", 3, 1, 7, 3085, true); public final static Version V3_1_8 = new Version("3.1.8", 3, 1, 8, 3188, true); + public final static Version V3_1_9 = new Version("3.1.9", 3, 1, 9, 3268, true); + public final static Version V3_1_10 = new Version("3.1.10", 3, 1, 10, 3347, true); + public final static Version V3_1_11 = new Version("3.1.11", 3, 1, 11, 3557, true); + public final static Version V3_1_12 = new Version("3.1.12", 3, 1, 12, 3876, true); private final static Map knownVersions = - Stream.of(V3_0_0, V3_0_1, V3_0_2, V3_0_3, V3_0_4, V3_1_0, V3_1_1, V3_1_2, V3_1_3, V3_1_4, V3_1_5, V3_1_6, V3_1_7, V3_1_8) + Stream.of(V3_0_0, V3_0_1, V3_0_2, V3_0_3, V3_0_4, V3_1_0, V3_1_1, V3_1_2, V3_1_3, V3_1_4, V3_1_5, V3_1_6, V3_1_7, V3_1_8, V3_1_9, V3_1_10, V3_1_11, V3_1_12) .collect(toMap(Version::toString, Function.identity())); - public final static Version LATEST = V3_1_8; + public final static Version LATEST = V3_1_12; private final String origString; private final Integer major;