Skip to content

Commit 4d8ae08

Browse files
authored
Remove a bunch of references to @ExcludeFromJacocoGeneratedReport (#3269)
This marks a bunch of methods to be included in our code coverage report. I went through all the references, and I believe I left 3 categories of things that are excluded: 1. Methods that are simply some variant of throw OperationNotSupported. We have a lot of these, because we override parts of JDBC, but haven't implemented all of it yet. 2. There's a handful of Hollow or NoOp classes. I want to investigate these further, and validate whether we should (a) remove them or (b) at least have tests that have them where there supposed to go 3. `PlannerDebuggerCommandHandler` -- I believe this command starts the planner repl, so that you can step through the cascades planner execution. Given that the planner repl is entirely internal, and interactive, I feel like this is ok. 4. `LaunchSQLLine` - as noted in the comment on the class, this is just a little helper to make it easier to debug with sqlline. I will add though, that I removed some of the exceptions for things used by SQLLine, so we may want tests that test SQLLine integration, at which point we could debug from those tests, and thus delete `LaunchSQLLine` entirely.
1 parent 9ca9e5f commit 4d8ae08

File tree

25 files changed

+8
-96
lines changed

25 files changed

+8
-96
lines changed

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalDatabaseMetaData.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,11 @@ default boolean nullsAreSortedAtEnd() throws SQLException {
243243
}
244244

245245
@Override
246-
@ExcludeFromJacocoGeneratedReport
247246
default String getDatabaseProductName() throws SQLException {
248247
return DATABASE_PRODUCT_NAME;
249248
}
250249

251250
@Override
252-
@ExcludeFromJacocoGeneratedReport
253251
default String getDatabaseProductVersion() throws SQLException {
254252
return BuildVersion.getInstance().getVersion();
255253
}
@@ -261,13 +259,11 @@ default String getDriverName() throws SQLException {
261259
}
262260

263261
@Override
264-
@ExcludeFromJacocoGeneratedReport
265262
default String getDriverVersion() throws SQLException {
266263
return BuildVersion.getInstance().getVersion();
267264
}
268265

269266
@Override
270-
@ExcludeFromJacocoGeneratedReport //nothing to test
271267
default int getDriverMajorVersion() {
272268
try {
273269
return BuildVersion.getInstance().getMajorVersion();
@@ -277,7 +273,6 @@ default int getDriverMajorVersion() {
277273
}
278274

279275
@Override
280-
@ExcludeFromJacocoGeneratedReport //nothing to test
281276
default int getDriverMinorVersion() {
282277
try {
283278
return BuildVersion.getInstance().getMinorVersion();
@@ -347,13 +342,11 @@ default boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
347342
}
348343

349344
@Override
350-
@ExcludeFromJacocoGeneratedReport
351345
default String getIdentifierQuoteString() throws SQLException {
352346
return "\"";
353347
}
354348

355349
@Override
356-
@ExcludeFromJacocoGeneratedReport
357350
default String getSQLKeywords() throws SQLException {
358351
return "";
359352
}
@@ -515,13 +508,11 @@ default boolean supportsExtendedSQLGrammar() throws SQLException {
515508
}
516509

517510
@Override
518-
@ExcludeFromJacocoGeneratedReport
519511
default boolean supportsANSI92EntryLevelSQL() throws SQLException {
520512
return true;
521513
}
522514

523515
@Override
524-
@ExcludeFromJacocoGeneratedReport
525516
default boolean supportsANSI92IntermediateSQL() throws SQLException {
526517
return false;
527518
}

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalDriver.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import com.apple.foundationdb.relational.api.exceptions.RelationalException;
2424
import com.apple.foundationdb.relational.util.BuildVersion;
25-
import com.apple.foundationdb.relational.util.ExcludeFromJacocoGeneratedReport;
2625

2726
import javax.annotation.Nonnull;
2827
import java.net.URI;
@@ -36,7 +35,6 @@
3635
/**
3736
* A Driver which is used to connect to a Relational Database.
3837
*/
39-
@ExcludeFromJacocoGeneratedReport
4038
public interface RelationalDriver extends Driver {
4139

4240
default RelationalConnection connect(@Nonnull URI url) throws SQLException {

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalPreparedStatement.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ default void cancel() throws SQLException {
498498
}
499499

500500
@Override
501-
@ExcludeFromJacocoGeneratedReport
502501
default SQLWarning getWarnings() throws SQLException {
503502
// For now, return null until warnings are implemented.
504503
// Throwing an exception stops all processing. See TODO (Implement JDBC Warnings in Relational embedded Driver)

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalResultSet.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,11 @@ default Object getObject(String columnLabel, Map<String, Class<?>> map) throws S
359359
throw new SQLFeatureNotSupportedException("Not implemented in the relational layer", ErrorCode.UNSUPPORTED_OPERATION.getErrorCode());
360360
}
361361

362-
@ExcludeFromJacocoGeneratedReport
363362
@Override
364363
default <T> T unwrap(Class<T> iface) throws SQLException {
365364
return iface.cast(this);
366365
}
367366

368-
@ExcludeFromJacocoGeneratedReport
369367
@Override
370368
default boolean isWrapperFor(Class<?> iface) throws SQLException {
371369
return iface.isInstance(this);

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalResultSetMetaData.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ default int getScale(int column) throws SQLException {
101101
}
102102

103103
@Override
104-
@ExcludeFromJacocoGeneratedReport
105104
default String getTableName(int column) throws SQLException {
106105
// Throwing an exception here messes up sqlline drawing results. Just do what Oracle apparently does here
107106
// and return an empty String for now until we implement ResultSet context attributes like table name.

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/RelationalStatement.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ default void cancel() throws SQLException {
123123
}
124124

125125
@Override
126-
@ExcludeFromJacocoGeneratedReport
127126
default SQLWarning getWarnings() throws SQLException {
128127
// Return null warnings for now until implemented.
129128
// Throwing an exception stops all processing.

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/SqlTypeNamesSupport.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import com.apple.foundationdb.annotation.API;
2424

25-
import com.apple.foundationdb.relational.util.ExcludeFromJacocoGeneratedReport;
26-
2725
import java.sql.Array;
2826
import java.sql.Struct;
2927
import java.sql.Types;
@@ -36,7 +34,6 @@
3634
* recordlayer.
3735
*/
3836
// Used by fdb-relational-jdbc module in JDBCRelationalArray.
39-
@ExcludeFromJacocoGeneratedReport
4037
@API(API.Status.EXPERIMENTAL)
4138
public final class SqlTypeNamesSupport {
4239
private SqlTypeNamesSupport() {

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/util/Assert.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
/**
3333
* A set of helper methods for validating input, pre-conditions, ... etc.
3434
*/
35-
@ExcludeFromJacocoGeneratedReport //just assertions, hard to test in a useful way
3635
@API(API.Status.EXPERIMENTAL)
3736
public final class Assert {
3837

fdb-relational-cli/src/main/java/com/apple/foundationdb/relational/cli/sqlline/Customize.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
package com.apple.foundationdb.relational.cli.sqlline;
2222

2323
import com.apple.foundationdb.annotation.API;
24-
25-
import com.apple.foundationdb.relational.util.ExcludeFromJacocoGeneratedReport;
26-
2724
import sqlline.BuiltInProperty;
2825
import sqlline.CommandHandler;
2926
import sqlline.OutputFormat;
@@ -45,6 +42,7 @@
4542
* on how this works. The main thing we add is output of Relational STRUCT and ARRAY missing from basic sqlline.
4643
*/
4744
@API(API.Status.EXPERIMENTAL)
45+
@SuppressWarnings("unused") // retrieved by sqlline via reflection
4846
public class Customize extends sqlline.Application {
4947
// Overriding {@link #getDefaultInteractiveMode()}, and {@link #getConnectInteractiveModes()} doesn't work -- bug
5048
// because sqlline does this <code>new HashSet<>(new Application().getConnectInteractiveModes()))</code> -- so we have
@@ -57,22 +55,19 @@ public class Customize extends sqlline.Application {
5755
* @return Our options instance.
5856
*/
5957
@Override
60-
@ExcludeFromJacocoGeneratedReport // Hard to make a test that makes sense given this an sqlline internal.
6158
public SqlLineOpts getOpts(SqlLine sqlLine) {
6259
// Set do-not-ask-for-login credentials -- login not supported on Relational, not yet.
6360
sqlLine.getOpts().set(BuiltInProperty.CONNECT_INTERACTION_MODE, "notAskCredentials");
6461
return sqlLine.getOpts();
6562
}
6663

6764
@Override
68-
@ExcludeFromJacocoGeneratedReport // Hard to make a test that makes sense given this an sqlline internal.
6965
public String getInfoMessage() {
7066
// Prepend 'Relational' to hint Relational context.
7167
return "Relational " + getVersion();
7268
}
7369

7470
@Override
75-
@ExcludeFromJacocoGeneratedReport // Hard to make a test that makes sense given this an sqlline internal.
7671
public Map<String, OutputFormat> getOutputFormats(SqlLine sqlLine) {
7772
// final Map<String, OutputFormat> outputFormats = new HashMap<>();
7873
// outputFormats.put("vertical", new VerticalOutputFormat(sqlLine));
@@ -97,7 +92,6 @@ public Map<String, OutputFormat> getOutputFormats(SqlLine sqlLine) {
9792
}
9893

9994
@Override
100-
@ExcludeFromJacocoGeneratedReport // Hard to make a test that makes sense given this an sqlline internal.
10195
public Collection<CommandHandler> getCommandHandlers(SqlLine sqlLine) {
10296
// Make a copy of super handlers list to get around the super making the list unmodifiable.
10397
List<CommandHandler> handlers = new ArrayList<>(super.getCommandHandlers(sqlLine));

fdb-relational-cli/src/main/java/sqlline/SetSchema.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
package sqlline;
2222

2323
import com.apple.foundationdb.annotation.API;
24-
25-
import com.apple.foundationdb.relational.util.ExcludeFromJacocoGeneratedReport;
2624
import org.jline.reader.Completer;
2725

2826
import java.sql.SQLException;
@@ -36,7 +34,6 @@
3634
@SuppressWarnings("PMD.GuardLogStatement")
3735
@API(API.Status.EXPERIMENTAL)
3836
public class SetSchema extends AbstractCommandHandler {
39-
@ExcludeFromJacocoGeneratedReport // Hard to make a test that makes sense given this an sqlline internal.
4037
public SetSchema(SqlLine sqlLine) {
4138
super(sqlLine, new String[]{"setschema", "ss"}, "Set Relational Schema: e.g. !ss <SCHEMA_NAME>.",
4239
Collections.<Completer>emptyList());

0 commit comments

Comments
 (0)