Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8be0c92
add methods produceReportWithCoverage and getHtmlCoverage
PhilippSalvisberg May 30, 2020
9605a71
add test for produceReportWithCoverage
PhilippSalvisberg May 30, 2020
c18c484
execute setup and teardown per test
PhilippSalvisberg May 30, 2020
758872c
add null checks for parameters
PhilippSalvisberg May 30, 2020
55b8727
add public openInBrowser method
PhilippSalvisberg May 30, 2020
fd0d3df
reuse code coverage test setup with actual coverage result
PhilippSalvisberg May 30, 2020
5284796
add support to run tests with code coverage in one run
PhilippSalvisberg May 30, 2020
b1985e6
add test with code coverage
PhilippSalvisberg May 30, 2020
e280483
run code coverage via realtime reporter if possible
PhilippSalvisberg May 30, 2020
22610ee
no dedicated connection required anymore
PhilippSalvisberg May 30, 2020
e677de7
configure default fetch size of 100 (except for consumeReport)
PhilippSalvisberg May 30, 2020
667b5fc
add resources for code coverage (icon and tooltip text)
PhilippSalvisberg May 30, 2020
c2e7b12
calculate default schemas and provide getter; handle test env.
PhilippSalvisberg May 30, 2020
acfb60e
populate default value for schemas under test
PhilippSalvisberg May 30, 2020
6f5e7cb
test calcuation of default schemas under test
PhilippSalvisberg May 30, 2020
89565a4
add code coverage to toolbar of realtime reporter (all tests)
PhilippSalvisberg May 30, 2020
d589045
use list of schemas instead of top schema as default
PhilippSalvisberg May 30, 2020
84ffaeb
amend test based on new default logic
PhilippSalvisberg May 30, 2020
64cbad0
add code coverage context menu on overview table
PhilippSalvisberg May 30, 2020
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
configure default fetch size of 100 (except for consumeReport)
  • Loading branch information
PhilippSalvisberg committed May 30, 2020
commit e677de759f455895f6752e9beed582b6d466d0b2
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class RealtimeReporterDao {
public RealtimeReporterDao(final Connection conn) {
this.conn = conn;
jdbcTemplate = new JdbcTemplate(new SingleConnectionDataSource(conn, true));
jdbcTemplate.setFetchSize(1);
jdbcTemplate.setFetchSize(UtplsqlDao.FETCH_ROWS);
}

public boolean isSupported() {
Expand Down Expand Up @@ -143,26 +143,31 @@ public void consumeReport(final String reporterId, final RealtimeReporterEventCo
sb.append(" ? := l_reporter.get_lines_cursor();\n");
sb.append("END;");
final String plsql = sb.toString();
jdbcTemplate.execute(plsql, new CallableStatementCallback<Void>() {
@Override
public Void doInCallableStatement(final CallableStatement cs) throws SQLException {
cs.setString(1, reporterId);
cs.registerOutParameter(2, OracleTypes.CURSOR);
cs.execute();
final ResultSet rs = (ResultSet) cs.getObject(2);
while (rs.next()) {
final String itemType = rs.getString("item_type");
final Clob textClob = rs.getClob("text");
final String textString = textClob.getSubString(1, ((int) textClob.length()));
final RealtimeReporterEvent event = convert(itemType, textString);
if (event != null) {
consumer.process(event);
jdbcTemplate.setFetchSize(1);
try {
jdbcTemplate.execute(plsql, new CallableStatementCallback<Void>() {
@Override
public Void doInCallableStatement(final CallableStatement cs) throws SQLException {
cs.setString(1, reporterId);
cs.registerOutParameter(2, OracleTypes.CURSOR);
cs.execute();
final ResultSet rs = (ResultSet) cs.getObject(2);
while (rs.next()) {
final String itemType = rs.getString("item_type");
final Clob textClob = rs.getClob("text");
final String textString = textClob.getSubString(1, ((int) textClob.length()));
final RealtimeReporterEvent event = convert(itemType, textString);
if (event != null) {
consumer.process(event);
}
}
rs.close();
return null;
}
rs.close();
return null;
}
});
});
} finally {
jdbcTemplate.setFetchSize(UtplsqlDao.FETCH_ROWS);
}
}

public String getHtmlCoverage(final String reporterId) {
Expand Down
2 changes: 2 additions & 0 deletions sqldev/src/main/java/org/utplsql/sqldev/dal/UtplsqlDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class UtplsqlDao {
public static final int FIRST_VERSION_WITH_ANNOTATION_API = 3001003;
public static final int FIRST_VERSION_WITHOUT_INTERNAL_API = 3001008;
public static final int FIRST_VERSION_WITH_HAS_SUITES_API = 3001008;
public static final int FETCH_ROWS = 100;
private JdbcTemplate jdbcTemplate;
// cache fields
private Boolean cachedDbaViewAccessible;
Expand All @@ -50,6 +51,7 @@ public class UtplsqlDao {

public UtplsqlDao(final Connection conn) {
jdbcTemplate = new JdbcTemplate(new SingleConnectionDataSource(conn, true));
jdbcTemplate.setFetchSize(FETCH_ROWS);
}

/**
Expand Down