Skip to content

Commit 18c96b5

Browse files
committed
Incorporated review comments
1 parent c9faea5 commit 18c96b5

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java

+14-16
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,7 @@ public void setup() throws Exception {
27302730
* @throws Exception
27312731
*/
27322732
@Test
2733-
public void testExecuteUpdateInsertAndGenKeys() throws Exception {
2733+
public void testExecuteUpdateInsertAndGenKeys() {
27342734
try (Connection con = getConnection()) {
27352735
try(Statement stmt = con.createStatement()) {
27362736
String sql = "INSERT INTO " + tableName + " (NAME) VALUES('test')";
@@ -2755,7 +2755,7 @@ public void testExecuteUpdateInsertAndGenKeys() throws Exception {
27552755
* @throws Exception
27562756
*/
27572757
@Test
2758-
public void testExecuteInsertAndGenKeys() throws Exception {
2758+
public void testExecuteInsertAndGenKeys() {
27592759
try (Connection con = getConnection()) {
27602760
try(Statement stmt = con.createStatement()) {
27612761
String sql = "INSERT INTO " + tableName + " (NAME) VALUES('test')";
@@ -2780,7 +2780,7 @@ public void testExecuteInsertAndGenKeys() throws Exception {
27802780
* @throws Exception
27812781
*/
27822782
@Test
2783-
public void testExecuteInsertAndSelect() throws Exception {
2783+
public void testExecuteInsertAndSelect() {
27842784

27852785
try (Connection con = getConnection()) {
27862786
try(Statement stmt = con.createStatement()) {
@@ -2818,7 +2818,7 @@ public void testExecuteInsertAndSelect() throws Exception {
28182818
* @throws Exception
28192819
*/
28202820
@Test
2821-
public void testExecuteMergeAndSelect() throws Exception {
2821+
public void testExecuteMergeAndSelect() {
28222822
try (Connection con = getConnection()) {
28232823
try(Statement stmt = con.createStatement()) {
28242824
boolean retval = stmt.execute("MERGE INTO " + tableName + " AS target USING (VALUES ('test1')) AS source (name) ON target.name = source.name WHEN NOT MATCHED THEN INSERT (name) VALUES ('test1'); SELECT NAME FROM " + tableName + " WHERE ID = 1");
@@ -2855,7 +2855,7 @@ public void testExecuteMergeAndSelect() throws Exception {
28552855
* @throws Exception
28562856
*/
28572857
@Test
2858-
public void testExecuteInsertManyRowsAndSelect() throws Exception {
2858+
public void testExecuteInsertManyRowsAndSelect() {
28592859
try (Connection con = getConnection()) {
28602860
try (Statement stmt = con.createStatement()) {
28612861
boolean retval = stmt.execute("INSERT INTO " + tableName + " SELECT NAME FROM " + tableName + " SELECT NAME FROM " + tableName + " WHERE ID = 1");
@@ -2892,7 +2892,7 @@ public void testExecuteInsertManyRowsAndSelect() throws Exception {
28922892
* @throws Exception
28932893
*/
28942894
@Test
2895-
public void testExecuteTwoInsertsRowsAndSelect() throws Exception {
2895+
public void testExecuteTwoInsertsRowsAndSelect() {
28962896
try (Connection con = getConnection()) {
28972897
try(Statement stmt = con.createStatement()) {
28982898
boolean retval = stmt.execute("INSERT INTO " + tableName + " (NAME) VALUES('test') INSERT INTO " + tableName + " (NAME) VALUES('test') SELECT NAME from " + tableName + " WHERE ID = 1");
@@ -2930,7 +2930,7 @@ public void testExecuteTwoInsertsRowsAndSelect() throws Exception {
29302930
* @throws Exception
29312931
*/
29322932
@Test
2933-
public void testExecuteUpdAndSelect() throws Exception {
2933+
public void testExecuteUpdAndSelect() {
29342934
try (Connection con = getConnection()) {
29352935
try(Statement stmt = con.createStatement()) {
29362936
boolean retval = stmt.execute("UPDATE " + tableName +" SET NAME = 'test' SELECT NAME FROM " + tableName + " WHERE ID = 1");
@@ -2966,7 +2966,7 @@ public void testExecuteUpdAndSelect() throws Exception {
29662966
* @throws Exception
29672967
*/
29682968
@Test
2969-
public void testExecuteDelAndSelect() throws Exception {
2969+
public void testExecuteDelAndSelect() {
29702970
try (Connection con = getConnection()) {
29712971
try(Statement stmt = con.createStatement()) {
29722972
boolean retval = stmt.execute("DELETE FROM " + tableName +" WHERE ID = 1 SELECT NAME FROM " + tableName + " WHERE ID = 2");
@@ -2997,15 +2997,13 @@ public void testExecuteDelAndSelect() throws Exception {
29972997
}
29982998

29992999
@AfterEach
3000-
public void terminate() throws Exception {
3000+
public void terminate() {
30013001
try (Connection con = getConnection(); Statement stmt = con.createStatement()) {
3002-
try {
3003-
TestUtils.dropTriggerIfExists(triggerName, stmt);
3004-
TestUtils.dropTableIfExists(idTableName, stmt);
3005-
TestUtils.dropTableIfExists(tableName, stmt);
3006-
} catch (SQLException e) {
3007-
fail(TestResource.getResource("R_unexpectedException") + e.getMessage());
3008-
}
3002+
TestUtils.dropTriggerIfExists(triggerName, stmt);
3003+
TestUtils.dropTableIfExists(idTableName, stmt);
3004+
TestUtils.dropTableIfExists(tableName, stmt);
3005+
} catch (SQLException e) {
3006+
fail(TestResource.getResource("R_unexpectedException") + e.getMessage());
30093007
}
30103008
}
30113009
}

0 commit comments

Comments
 (0)