diff --git a/.travis.yml b/.travis.yml index 29d7f41..0c3726d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,8 @@ env: - UTPLSQL_VERSION="v3.1.6" - UTPLSQL_VERSION="v3.1.7" - UTPLSQL_VERSION="v3.1.8" + - UTPLSQL_VERSION="v3.1.9" + - UTPLSQL_VERSION="v3.1.10" - UTPLSQL_VERSION="develop" UTPLSQL_FILE="utPLSQL" diff --git a/src/main/java/org/utplsql/api/TestRunner.java b/src/main/java/org/utplsql/api/TestRunner.java index 437549a..fe0c485 100644 --- a/src/main/java/org/utplsql/api/TestRunner.java +++ b/src/main/java/org/utplsql/api/TestRunner.java @@ -145,6 +145,11 @@ public TestRunner addTags(Collection tags) { return this; } + public TestRunner catchOraStuck( boolean catchOraStuck ) { + this.options.catchOraStuck = catchOraStuck; + return this; + } + public TestRunnerOptions getOptions() { return options; } private void delayedAddReporters() { @@ -213,7 +218,7 @@ public void run(Connection conn) throws SQLException { TestRunnerStatement testRunnerStatement = null; try { - testRunnerStatement = initStatementWithTimeout(conn); + testRunnerStatement = ( options.catchOraStuck ) ? initStatementWithTimeout(conn) : initStatement(conn); logger.info("Running tests"); testRunnerStatement.execute(); logger.info("Running tests finished."); @@ -227,6 +232,10 @@ public void run(Connection conn) throws SQLException { } } + private TestRunnerStatement initStatement( Connection conn ) throws SQLException { + return compatibilityProxy.getTestRunnerStatement(options, conn); + } + private TestRunnerStatement initStatementWithTimeout( Connection conn ) throws OracleCreateStatmenetStuckException, SQLException { ExecutorService executor = Executors.newSingleThreadExecutor(); Callable callable = () -> compatibilityProxy.getTestRunnerStatement(options, conn); diff --git a/src/main/java/org/utplsql/api/TestRunnerOptions.java b/src/main/java/org/utplsql/api/TestRunnerOptions.java index 3fe39c1..de8ee12 100644 --- a/src/main/java/org/utplsql/api/TestRunnerOptions.java +++ b/src/main/java/org/utplsql/api/TestRunnerOptions.java @@ -30,6 +30,7 @@ public class TestRunnerOptions { public boolean randomTestOrder = false; public Integer randomTestOrderSeed; public final Set tags = new LinkedHashSet<>(); + public boolean catchOraStuck = false; public String getTagsAsString() { return String.join(",", tags);