Skip to content

Commit

Permalink
Review comments applied.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Apr 27, 2019
1 parent 002c5ff commit 12dd3f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/test/java/com/microsoft/sqlserver/jdbc/TestResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ protected Object[][] getContents() {
{"R_cannotOpenDatabase", "Cannot open database"}, {"R_shouldNotConnect", "Should not have connected"},
{"R_loginFailed", "Login failed"}, {"R_exitedMoreSeconds", "Exited in more than {0} seconds."},
{"R_exitedLessSeconds", "Exited in less than {0} seconds."},
{"R_invalidArgumentExecutor", "The argument executor is not valid"},
{"R_invalidArgumentCatalog", "The argument catalog is not valid"},
{"R_threadInterruptNotSet", "Thread's interrupt status is not set."},
{"R_connectMirrored", "Connecting to a mirrored"},
{"R_trustStorePasswordNotSet", "The DataSource trustStore password needs to be set."},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource;
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
import com.microsoft.sqlserver.jdbc.TestResource;
import com.microsoft.sqlserver.jdbc.TestUtils;
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
import com.microsoft.sqlserver.testframework.AbstractTest;
import com.microsoft.sqlserver.testframework.Constants;
Expand Down Expand Up @@ -80,7 +81,8 @@ public void testEncryptedConnection() throws SQLException {
ds.setEncrypt(true);
ds.setTrustServerCertificate(true);
ds.setPacketSize(8192);
try (Connection con = ds.getConnection()) {}
try (Connection con = ds.getConnection()) {
}
}

@Test
Expand All @@ -95,7 +97,8 @@ class MyEventListener implements javax.sql.ConnectionEventListener {
boolean connClosed = false;
boolean errorOccurred = false;

public MyEventListener() {}
public MyEventListener() {
}

public void connectionClosed(ConnectionEvent event) {
connClosed = true;
Expand Down Expand Up @@ -457,7 +460,7 @@ public void testAbortBadParam() throws SQLException {
try {
conn.abort(null);
} catch (SQLException e) {
assertTrue(e.getMessage().contains(TestResource.getResource("R_invalidArgumentExecutor")));
assertTrue(e.getMessage().matches(TestUtils.formatErrorMsg("R_invalidArgument")));
}
}
}
Expand Down Expand Up @@ -503,7 +506,8 @@ public void run() {
ds.setServerName("invalidServerName" + UUID.randomUUID());
ds.setLoginTimeout(5);

try (Connection con = ds.getConnection()) {} catch (SQLException e) {
try (Connection con = ds.getConnection()) {
} catch (SQLException e) {
isInterrupted = Thread.currentThread().isInterrupted();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public void testGetFunctionsWithWrongParams() throws SQLException {
conn.getMetaData().getFunctions("", null, "xp_%");
fail(TestResource.getResource("R_noSchemaShouldFail"));
} catch (SQLException e) {
assert (e.getMessage().contains(TestResource.getResource("R_invalidArgumentCatalog")));
assert (e.getMessage().matches(TestUtils.formatErrorMsg("R_invalidArgument")));
}
}

Expand Down

0 comments on commit 12dd3f7

Please sign in to comment.