Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b4d2af

Browse files
pesseSamuel Nitsche
authored andcommitted
Included possibility to skip CompatibilityCheck
If check is skipped, the API expects the latest framework version to be present
1 parent 7a469d4 commit 6b4d2af

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/main/java/org/utplsql/api/TestRunner.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,17 @@ public TestRunner failOnErrors(boolean failOnErrors) {
7979
return this;
8080
}
8181

82+
public TestRunner skipCompatibilityCheck( boolean skipCompatibilityCheck )
83+
{
84+
options.skipCompatibilityCheck = skipCompatibilityCheck;
85+
return this;
86+
}
87+
8288
public void run(Connection conn) throws SomeTestsFailedException, SQLException, DatabaseNotCompatibleException {
8389

8490
// First of all check version compatibility
85-
DBHelper.failOnVersionCompatibilityCheckFailed(conn);
91+
if ( !options.skipCompatibilityCheck )
92+
DBHelper.failOnVersionCompatibilityCheckFailed(conn);
8693

8794
for (Reporter r : options.reporterList)
8895
validateReporter(conn, r);

src/main/java/org/utplsql/api/TestRunnerOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ public class TestRunnerOptions {
2121
public FileMapperOptions sourceMappingOptions;
2222
public FileMapperOptions testMappingOptions;
2323
public boolean failOnErrors = false;
24+
public boolean skipCompatibilityCheck = false;
2425
}

src/test/java/org/utplsql/api/TestRunnerTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ public void runWithDefaultParameters() {
2828
}
2929
}
3030

31+
@Test
32+
public void runWithoutCompatibilityCheck() {
33+
try {
34+
Connection conn = db.newConnection();
35+
new TestRunner()
36+
.skipCompatibilityCheck(true)
37+
.run(conn);
38+
} catch (SQLException e) {
39+
Assert.fail(e.getMessage());
40+
}
41+
}
42+
3143
@Test
3244
public void runWithManyReporters() {
3345
try {

0 commit comments

Comments
 (0)