diff --git a/test/jdk/javax/sql/junit/test/rowset/CommonRowSetTests.java b/test/jdk/javax/sql/junit/test/rowset/CommonRowSetTests.java index 4dcbbf7ea76..5e8163fbf05 100644 --- a/test/jdk/javax/sql/junit/test/rowset/CommonRowSetTests.java +++ b/test/jdk/javax/sql/junit/test/rowset/CommonRowSetTests.java @@ -544,9 +544,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0004(RowSet rs) throws Exception { - assertThrows(SQLException.class, () -> { - rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT); - }); + assertThrows(SQLException.class, () -> rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT)); } /* @@ -630,9 +628,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0013(RowSet rs) throws Exception { - assertThrows(SQLException.class, () -> { - rs.setFetchSize(-1); - }); + assertThrows(SQLException.class, () -> rs.setFetchSize(-1)); } /* @@ -671,9 +667,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0016(RowSet rs) throws Exception { - assertThrows(SQLException.class, () -> { - rs.setMaxFieldSize(-1); - }); + assertThrows(SQLException.class, () -> rs.setMaxFieldSize(-1)); } /* @@ -800,9 +794,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0027(RowSet rs) throws Exception { - assertThrows(SQLException.class, () -> { - rs.setQueryTimeout(-1); - }); + assertThrows(SQLException.class, () -> rs.setQueryTimeout(-1)); } @@ -935,9 +927,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0106(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setBigDecimal("one", BigDecimal.ONE); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setBigDecimal("one", BigDecimal.ONE)); } /* @@ -986,9 +976,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0110(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setBlob("one", new StubBlob()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setBlob("one", new StubBlob())); } /* @@ -998,9 +986,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0111(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setBoolean("one", true); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setBoolean("one", true)); } /* @@ -1114,9 +1100,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0120(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setClob("one", new StubClob()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setClob("one", new StubClob())); } /* @@ -1126,9 +1110,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0121(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setDate("one", Date.valueOf(LocalDate.now())); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setDate("one", Date.valueOf(LocalDate.now()))); } /* @@ -1138,10 +1120,8 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0122(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setDate("one", Date.valueOf(LocalDate.now()), - Calendar.getInstance()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setDate("one", Date.valueOf(LocalDate.now()), + Calendar.getInstance())); } /* @@ -1151,9 +1131,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0123(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setTime("one", Time.valueOf(LocalTime.now())); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setTime("one", Time.valueOf(LocalTime.now()))); } /* @@ -1163,10 +1141,8 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0124(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setTime("one", Time.valueOf(LocalTime.now()), - Calendar.getInstance()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setTime("one", Time.valueOf(LocalTime.now()), + Calendar.getInstance())); } /* @@ -1176,9 +1152,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0125(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now())); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()))); } /* @@ -1188,10 +1162,8 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0126(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()), - Calendar.getInstance()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()), + Calendar.getInstance())); } /* @@ -1201,9 +1173,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0127(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setDouble("one", 2.0d); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setDouble("one", 2.0d)); } /* @@ -1213,9 +1183,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0128(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setFloat("one", 2.0f); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setFloat("one", 2.0f)); } /* @@ -1225,9 +1193,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0129(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setInt("one", 21); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setInt("one", 21)); } /* @@ -1237,9 +1203,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0130(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setLong("one", 21l); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setLong("one", 21l)); } /* @@ -1327,9 +1291,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0137(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNClob("one", new StubNClob()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNClob("one", new StubNClob())); } /* @@ -1365,9 +1327,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0140(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNClob(1, new StubNClob()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNClob(1, new StubNClob())); } /* @@ -1377,9 +1337,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0141(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNString(1, query); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNString(1, query)); } /* @@ -1389,9 +1347,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0142(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNull("one", Types.INTEGER); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNull("one", Types.INTEGER)); } /* @@ -1401,9 +1357,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0143(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNull("one", Types.INTEGER, "my.type"); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNull("one", Types.INTEGER, "my.type")); } /* @@ -1413,9 +1367,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0144(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setObject("one", query, Types.VARCHAR); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setObject("one", query, Types.VARCHAR)); } /* @@ -1425,9 +1377,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0145(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setObject("one", query, Types.VARCHAR, 0); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setObject("one", query, Types.VARCHAR, 0)); } /* @@ -1437,9 +1387,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0146(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setObject("one", query); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setObject("one", query)); } /* @@ -1462,9 +1410,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0148(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setSQLXML("one", new StubSQLXML()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setSQLXML("one", new StubSQLXML())); } /* @@ -1474,9 +1420,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0149(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setSQLXML(1, new StubSQLXML()); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setSQLXML(1, new StubSQLXML())); } /* @@ -1486,9 +1430,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0150(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNString(1, query); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNString(1, query)); } /* @@ -1498,9 +1440,7 @@ public abstract class CommonRowSetTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("rowSetType") public void commonRowSetTest0151(RowSet rs) throws Exception { - assertThrows(SQLFeatureNotSupportedException.class, () -> { - rs.setNString("one", query); - }); + assertThrows(SQLFeatureNotSupportedException.class, () -> rs.setNString("one", query)); } /* diff --git a/test/jdk/javax/sql/junit/test/rowset/RowSetMetaDataTests.java b/test/jdk/javax/sql/junit/test/rowset/RowSetMetaDataTests.java index 7241d284e07..59dc4f43033 100644 --- a/test/jdk/javax/sql/junit/test/rowset/RowSetMetaDataTests.java +++ b/test/jdk/javax/sql/junit/test/rowset/RowSetMetaDataTests.java @@ -59,9 +59,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getCatalogName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getCatalogName(col)); } /* @@ -70,9 +68,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test01(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnClassName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnClassName(col)); } /* @@ -81,9 +77,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test02(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnDisplaySize(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnDisplaySize(col)); } /* @@ -92,9 +86,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test03(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnLabel(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnLabel(col)); } /* @@ -103,9 +95,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test04(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnName(col)); } /* @@ -114,9 +104,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test05(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnType(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnType(col)); } /* @@ -125,9 +113,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test06(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getColumnTypeName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getColumnTypeName(col)); } /* @@ -136,9 +122,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test07(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getPrecision(col); - }); + assertThrows(SQLException.class, () -> rsmd.getPrecision(col)); } /* @@ -147,9 +131,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test08(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getScale(col); - }); + assertThrows(SQLException.class, () -> rsmd.getScale(col)); } /* @@ -158,9 +140,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test09(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getSchemaName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getSchemaName(col)); } /* @@ -169,9 +149,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test10(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.getTableName(col); - }); + assertThrows(SQLException.class, () -> rsmd.getTableName(col)); } /* @@ -180,9 +158,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test11(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isAutoIncrement(col); - }); + assertThrows(SQLException.class, () -> rsmd.isAutoIncrement(col)); } /* @@ -191,9 +167,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test12(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isCaseSensitive(col); - }); + assertThrows(SQLException.class, () -> rsmd.isCaseSensitive(col)); } /* @@ -202,9 +176,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test13(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isCurrency(col); - }); + assertThrows(SQLException.class, () -> rsmd.isCurrency(col)); } /* @@ -213,9 +185,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test14(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isDefinitelyWritable(col); - }); + assertThrows(SQLException.class, () -> rsmd.isDefinitelyWritable(col)); } /* @@ -224,9 +194,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test15(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isNullable(col); - }); + assertThrows(SQLException.class, () -> rsmd.isNullable(col)); } /* @@ -235,9 +203,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test16(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isReadOnly(col); - }); + assertThrows(SQLException.class, () -> rsmd.isReadOnly(col)); } /* @@ -246,9 +212,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test17(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isSearchable(col); - }); + assertThrows(SQLException.class, () -> rsmd.isSearchable(col)); } /* @@ -257,9 +221,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test18(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isSigned(col); - }); + assertThrows(SQLException.class, () -> rsmd.isSigned(col)); } /* @@ -268,9 +230,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test19(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.isWritable(col); - }); + assertThrows(SQLException.class, () -> rsmd.isWritable(col)); } /* @@ -279,9 +239,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test20(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setAutoIncrement(col, true); - }); + assertThrows(SQLException.class, () -> rsmd.setAutoIncrement(col, true)); } /* @@ -290,9 +248,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test21(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setCaseSensitive(col, true); - }); + assertThrows(SQLException.class, () -> rsmd.setCaseSensitive(col, true)); } /* @@ -301,9 +257,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test22(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setCatalogName(col, null); - }); + assertThrows(SQLException.class, () -> rsmd.setCatalogName(col, null)); } /* @@ -312,9 +266,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test23(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setColumnDisplaySize(col, 5); - }); + assertThrows(SQLException.class, () -> rsmd.setColumnDisplaySize(col, 5)); } /* @@ -323,9 +275,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test24(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setColumnLabel(col, "label"); - }); + assertThrows(SQLException.class, () -> rsmd.setColumnLabel(col, "label")); } /* @@ -334,9 +284,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test25(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setColumnName(col, "F1"); - }); + assertThrows(SQLException.class, () -> rsmd.setColumnName(col, "F1")); } /* @@ -345,9 +293,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test26(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setColumnType(col, Types.CHAR); - }); + assertThrows(SQLException.class, () -> rsmd.setColumnType(col, Types.CHAR)); } /* @@ -356,9 +302,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test27(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setColumnTypeName(col, "F1"); - }); + assertThrows(SQLException.class, () -> rsmd.setColumnTypeName(col, "F1")); } /* @@ -367,9 +311,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test28(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setCurrency(col, true); - }); + assertThrows(SQLException.class, () -> rsmd.setCurrency(col, true)); } /* @@ -378,9 +320,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test29(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setNullable(col, ResultSetMetaData.columnNoNulls); - }); + assertThrows(SQLException.class, () -> rsmd.setNullable(col, ResultSetMetaData.columnNoNulls)); } /* @@ -389,9 +329,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test30(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setPrecision(col, 2); - }); + assertThrows(SQLException.class, () -> rsmd.setPrecision(col, 2)); } /* @@ -400,9 +338,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test31(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setScale(col, 2); - }); + assertThrows(SQLException.class, () -> rsmd.setScale(col, 2)); } /* @@ -411,9 +347,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test32(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setSchemaName(col, "Gotham"); - }); + assertThrows(SQLException.class, () -> rsmd.setSchemaName(col, "Gotham")); } /* @@ -422,9 +356,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test33(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setSearchable(col, false); - }); + assertThrows(SQLException.class, () -> rsmd.setSearchable(col, false)); } /* @@ -433,9 +365,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test34(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setSigned(col, false); - }); + assertThrows(SQLException.class, () -> rsmd.setSigned(col, false)); } /* @@ -444,9 +374,7 @@ public class RowSetMetaDataTests extends BaseTest { @ParameterizedTest(autoCloseArguments = false) @MethodSource("invalidColumnRanges") public void test35(Integer col) throws Exception { - assertThrows(SQLException.class, () -> { - rsmd.setTableName(col, "SUPERHEROS"); - }); + assertThrows(SQLException.class, () -> rsmd.setTableName(col, "SUPERHEROS")); } /* diff --git a/test/jdk/javax/sql/junit/test/rowset/spi/SyncFactoryTests.java b/test/jdk/javax/sql/junit/test/rowset/spi/SyncFactoryTests.java index 214a3abfd4e..260cf150f59 100644 --- a/test/jdk/javax/sql/junit/test/rowset/spi/SyncFactoryTests.java +++ b/test/jdk/javax/sql/junit/test/rowset/spi/SyncFactoryTests.java @@ -187,9 +187,7 @@ public class SyncFactoryTests { */ @Test public void test08() throws Exception { - assertThrows(SyncFactoryException.class, () -> { - SyncFactory.setJNDIContext(null); - }); + assertThrows(SyncFactoryException.class, () -> SyncFactory.setJNDIContext(null)); } /*