◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
61 changes: 53 additions & 8 deletions src/main/java/org/utplsql/api/TestRunner.java
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import org.utplsql.api.compatibility.CompatibilityProxy;
import org.utplsql.api.db.DatabaseInformation;
import org.utplsql.api.db.DefaultDatabaseInformation;
import org.utplsql.api.exception.SomeTestsFailedException;
import org.utplsql.api.exception.UtPLSQLNotInstalledException;
import org.utplsql.api.reporter.DocumentationReporter;
Expand All @@ -16,6 +17,7 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
* Created by Vinicius Avellar on 12/04/2017.
Expand Up @@ -124,6 +126,26 @@ private void delayedAddReporters() {
}
}

public void run(Connection conn) throws SQLException {

logger.info("TestRunner initialized");
Expand Down Expand Up @@ -156,19 +178,42 @@ public void run(Connection conn) throws SQLException {
options.reporterList.add(new DocumentationReporter().init(conn));
}

try (TestRunnerStatement testRunnerStatement = compatibilityProxy.getTestRunnerStatement(options, conn)) {
logger.info("Running tests");
testRunnerStatement.execute();
logger.info("Running tests finished.");
} catch (SQLException e) {
if (e.getErrorCode() == SomeTestsFailedException.ERROR_CODE) {
throw new SomeTestsFailedException(e.getMessage(), e);
} else if (e.getErrorCode() == UtPLSQLNotInstalledException.ERROR_CODE) {
throw new UtPLSQLNotInstalledException(e);
} else {
throw e;
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Toggle all file notes Toggle all file annotations