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

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added -scc/--skip-compatibility-check option
If option is on, cli expects the most actual framework version to be present
  • Loading branch information
pesse authored and Samuel Nitsche committed Nov 9, 2017
commit a51488198d445600db35813456edca0a64f08db5
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.utplsql</groupId>
<artifactId>cli</artifactId>
<version>3.0.3-SNAPSHOT</version>
<version>3.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>cli</name>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>org.utplsql</groupId>
<artifactId>java-api</artifactId>
<version>3.0.3-SNAPSHOT</version>
<version>3.0.4-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
30 changes: 22 additions & 8 deletions src/main/java/org/utplsql/cli/RunCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

/**
* Created by vinicius.moreira on 19/04/2017.
*
* @author vinicious moreira
* @author pesse
*/
@Parameters(separators = "=", commandDescription = "run tests")
public class RunCommand {
Expand Down Expand Up @@ -70,6 +73,12 @@ public class RunCommand {
"-name_subexpression=0] - path to project test files")
private List<String> testPathParams = new ArrayList<>();

@Parameter(
names = {"-scc", "--skip-compatibility-check"},
description = "Skips the check for compatibility with database framework. CLI expects the framework to be " +
"most actual. Use this if you use CLI with a development version of utPLSQL-framework")
private boolean skipCompatibilityCheck = false;

public ConnectionInfo getConnectionInfo() {
return connectionInfoList.get(0);
}
Expand Down Expand Up @@ -133,6 +142,7 @@ public int run() throws Exception {
.testMappingOptions(testMappingOptions[0])
.colorConsole(this.colorConsole)
.failOnErrors(true)
.skipCompatibilityCheck(skipCompatibilityCheck)
.run(conn);
} catch (SomeTestsFailedException e) {
returnCode[0] = this.failureExitCode;
Expand Down Expand Up @@ -204,15 +214,19 @@ public List<ReporterOptions> getReporterOptionsList() {
}

private void checkFrameworkCompatibility(ConnectionInfo ci) throws SQLException {
try
{
DBHelper.failOnVersionCompatibilityCheckFailed(ci.getConnection());
}
catch ( DatabaseNotCompatibleException e )
{
System.out.println(e.getMessage());

throw e;
if ( !skipCompatibilityCheck ) {
try {
DBHelper.failOnVersionCompatibilityCheckFailed(ci.getConnection());
} catch (DatabaseNotCompatibleException e) {
System.out.println(e.getMessage());

throw e;
}
}
else {
System.out.println("Skipping Compatibility check with framework version, expecting the latest version " +
"to be installed in database");
}
}

Expand Down