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

Skip to content
Merged
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
Fix issues reported by sonarlint
  • Loading branch information
viniciusam committed May 25, 2017
commit 625a25fe349f4de842ea8a25a1c1133208021844
2 changes: 2 additions & 0 deletions src/main/java/io/github/utplsql/api/DBHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
public final class DBHelper {

private DBHelper() {}

/**
* Return a new sys_guid from database.
* @param conn the connection
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/utplsql/api/OutputBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void fetchAvailable(Connection conn, Callback cb) throws SQLException {
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try {
preparedStatement = conn.prepareCall("SELECT * FROM table(ut_output_buffer.get_lines(?))");
preparedStatement = conn.prepareStatement("SELECT * FROM table(ut_output_buffer.get_lines(?))");
preparedStatement.setString(1, getReporter().getReporterId());
resultSet = preparedStatement.executeQuery();

Expand Down
23 changes: 10 additions & 13 deletions src/main/java/io/github/utplsql/api/TestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public class TestRunner {
private List<String> includeObjects = new ArrayList<>();
private List<String> excludeObjects = new ArrayList<>();

public TestRunner() {
}

public TestRunner addPath(String path) {
this.pathList.add(path);
return this;
Expand Down Expand Up @@ -84,11 +81,11 @@ public void run(Connection conn) throws SQLException {
OracleConnection oraConn = conn.unwrap(OracleConnection.class);
Array pathArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.pathList.toArray());
Array reporterArray = oraConn.createARRAY(CustomTypes.UT_REPORTERS, this.reporterList.toArray());
Array coverageSchemes = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.coverageSchemes.toArray());
Array sourceFiles = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.sourceFiles.toArray());
Array testFiles = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.testFiles.toArray());
Array includeObjects = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.includeObjects.toArray());
Array excludeObjects = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.excludeObjects.toArray());
Array coverageSchemesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.coverageSchemes.toArray());
Array sourceFilesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.sourceFiles.toArray());
Array testFilesArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.testFiles.toArray());
Array includeObjectsArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.includeObjects.toArray());
Array excludeObjectsArray = oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST, this.excludeObjects.toArray());

CallableStatement callableStatement = null;
try {
Expand All @@ -101,11 +98,11 @@ public void run(Connection conn) throws SQLException {
"END;");
callableStatement.setArray(1, pathArray);
callableStatement.setArray(2, reporterArray);
callableStatement.setArray(3, coverageSchemes);
callableStatement.setArray(4, sourceFiles);
callableStatement.setArray(5, testFiles);
callableStatement.setArray(6, includeObjects);
callableStatement.setArray(7, excludeObjects);
callableStatement.setArray(3, coverageSchemesArray);
callableStatement.setArray(4, sourceFilesArray);
callableStatement.setArray(5, testFilesArray);
callableStatement.setArray(6, includeObjectsArray);
callableStatement.setArray(7, excludeObjectsArray);
callableStatement.execute();
} finally {
if (callableStatement != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static Reporter createReporter(String reporterName) {
case CustomTypes.UT_COVERALLS_REPORTER: return new CoverallsReporter();
case CustomTypes.UT_COVERAGE_SONAR_REPORTER: return new CoverageSonarReporter();
case CustomTypes.UT_SONAR_TEST_REPORTER: return new SonarTestReporter();
default: throw new RuntimeException("Reporter " + reporterName + " not implemented.");
}
throw new RuntimeException("Reporter " + reporterName + " not implemented.");
}

}