|
7 | 7 | import org.slf4j.LoggerFactory; |
8 | 8 | import org.utplsql.api.*; |
9 | 9 | import org.utplsql.api.compatibility.CompatibilityProxy; |
| 10 | +import org.utplsql.api.compatibility.OptionalFeatures; |
10 | 11 | import org.utplsql.api.db.DefaultDatabaseInformation; |
11 | 12 | import org.utplsql.api.exception.DatabaseNotCompatibleException; |
12 | 13 | import org.utplsql.api.exception.OracleCreateStatmenetStuckException; |
@@ -174,11 +175,7 @@ public int doRun() throws OracleCreateStatmenetStuckException { |
174 | 175 | initDatabase(dataSource); |
175 | 176 | reporterList = initReporters(dataSource); |
176 | 177 |
|
177 | | - // Output a message if --failureExitCode is set but database framework is not capable of |
178 | | - String msg = RunCommandChecker.getCheckFailOnErrorMessage(failureExitCode, compatibilityProxy.getUtPlsqlVersion()); |
179 | | - if (msg != null) { |
180 | | - System.out.println(msg); |
181 | | - } |
| 178 | + checkForCompatibility(compatibilityProxy.getUtPlsqlVersion()); |
182 | 179 |
|
183 | 180 | ExecutorService executorService = Executors.newFixedThreadPool(1 + reporterList.size()); |
184 | 181 |
|
@@ -240,6 +237,27 @@ public int run() { |
240 | 237 | return Cli.DEFAULT_ERROR_CODE; |
241 | 238 | } |
242 | 239 |
|
| 240 | + private void checkForCompatibility( Version utPlSqlVersion ) { |
| 241 | + if (!OptionalFeatures.FAIL_ON_ERROR.isAvailableFor(utPlSqlVersion) && failureExitCode != 1 ) { |
| 242 | + System.out.println("You specified option `--failure-exit-code` but your database framework version (" + |
| 243 | + utPlSqlVersion.getNormalizedString() + ") is not able to " + |
| 244 | + "redirect failureCodes. Please upgrade to a newer version if you want to use that feature."); |
| 245 | + } |
| 246 | + |
| 247 | + if ( !OptionalFeatures.RANDOM_EXECUTION_ORDER.isAvailableFor(utPlSqlVersion) && randomTestOrder ) { |
| 248 | + System.out.println("You specified option `-random` but your database framework version (" + |
| 249 | + utPlSqlVersion.getNormalizedString() + ") is not able to " + |
| 250 | + "redirect failureCodes. Please upgrade to a newer version if you want to use that feature."); |
| 251 | + } |
| 252 | + |
| 253 | + if ( !OptionalFeatures.RANDOM_EXECUTION_ORDER.isAvailableFor(utPlSqlVersion) && randomTestOrderSeed != null ) { |
| 254 | + System.out.println("You specified option `-seed` but your database framework version (" + |
| 255 | + utPlSqlVersion.getNormalizedString() + ") is not able to " + |
| 256 | + "redirect failureCodes. Please upgrade to a newer version if you want to use that feature."); |
| 257 | + } |
| 258 | + |
| 259 | + } |
| 260 | + |
243 | 261 | TestRunner newTestRunner( List<Reporter> reporterList) { |
244 | 262 |
|
245 | 263 | final File baseDir = new File("").getAbsoluteFile(); |
|
0 commit comments