|
3 | 3 | import com.beust.jcommander.Parameter; |
4 | 4 | import com.beust.jcommander.Parameters; |
5 | 5 | import org.utplsql.api.*; |
| 6 | +import org.utplsql.api.exception.DatabaseNotCompatibleException; |
6 | 7 | import org.utplsql.api.exception.SomeTestsFailedException; |
7 | 8 | import org.utplsql.api.reporter.Reporter; |
8 | 9 | import org.utplsql.api.reporter.ReporterFactory; |
@@ -80,6 +81,9 @@ public List<String> getTestPaths() { |
80 | 81 | public int run() throws Exception { |
81 | 82 | final ConnectionInfo ci = getConnectionInfo(); |
82 | 83 |
|
| 84 | + // First of all do a compatibility check and fail-fast |
| 85 | + checkFrameworkCompatibility(ci); |
| 86 | + |
83 | 87 | final List<ReporterOptions> reporterOptionsList = getReporterOptionsList(); |
84 | 88 | final List<String> testPaths = getTestPaths(); |
85 | 89 | final List<Reporter> reporterList = new ArrayList<>(); |
@@ -199,6 +203,19 @@ public List<ReporterOptions> getReporterOptionsList() { |
199 | 203 | return reporterOptionsList; |
200 | 204 | } |
201 | 205 |
|
| 206 | + private void checkFrameworkCompatibility(ConnectionInfo ci) throws SQLException { |
| 207 | + try |
| 208 | + { |
| 209 | + DBHelper.failOnVersionCompatibilityCheckFailed(ci.getConnection()); |
| 210 | + } |
| 211 | + catch ( DatabaseNotCompatibleException e ) |
| 212 | + { |
| 213 | + System.out.println(e.getMessage()); |
| 214 | + |
| 215 | + throw e; |
| 216 | + } |
| 217 | + } |
| 218 | + |
202 | 219 | public FileMapperOptions getMapperOptions(List<String> mappingParams, List<String> filePaths) { |
203 | 220 | FileMapperOptions mapperOptions = new FileMapperOptions(filePaths); |
204 | 221 |
|
|
0 commit comments