From 3a9d8da7b2527d8331c4978a0ed85890ebafc89c Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 11:09:39 -0700 Subject: [PATCH 1/6] update error messages for localization --- .../com/microsoft/sqlserver/jdbc/SQLServerResource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index 3945a2096c..ca6777559c 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -268,7 +268,7 @@ protected Object[][] getContents() { {"R_NullColumnEncryptionKey", "Column encryption key cannot be null."}, {"R_EmptyColumnEncryptionKey", "Empty column encryption key specified."}, {"R_CertificateNotFoundForAlias", "Certificate with alias {0} not found in the store provided by {1}. Verify the certificate has been imported correctly into the certificate location/store."}, - {"R_UnrecoverableKeyAE", "Cannot recover private key from keystore with certificate details {0}. Verify that imported AE certificate contains private key and password provided for certificate is correct."}, + {"R_UnrecoverableKeyAE", "Cannot recover private key from keystore with certificate details {0}. Verify that imported certificate for Always Encrypted contains private key and password provided for certificate is correct."}, {"R_KeyStoreNotFound", "System cannot find the key store file at the specified path. Verify that the path is correct and you have proper permissions to access it."}, {"R_CustomKeyStoreProviderMapNull", "Column encryption key store provider map cannot be null. Expecting a non-null value."}, {"R_EmptyCustomKeyStoreProviderName", "Invalid key store provider name specified. Key store provider names cannot be null or empty."}, @@ -320,8 +320,8 @@ protected Object[][] getContents() { {"R_NoSHA256Algorithm","SHA-256 Algorithm is not supported."}, {"R_VerifySignature","Unable to verify signature of the column encryption key."}, {"R_CEKSignatureNotMatchCMK","The specified encrypted column encryption key signature does not match the signature computed with the column master key (Asymmetric key in Azure Key Vault) in {0}. The encrypted column encryption key may be corrupt, or the specified path may be incorrect."}, - {"R_DecryptCEKError","Unable to decrypt CEK using specified Azure Key Vault key."}, - {"R_EncryptCEKError","Unable to encrypt CEK using specified Azure Key Vault key."}, + {"R_DecryptCEKError","Unable to decrypt column encryption key using specified Azure Key Vault key."}, + {"R_EncryptCEKError","Unable to encrypt column encryption key using specified Azure Key Vault key."}, {"R_CipherTextLengthNotMatchRSASize","CipherText length does not match the RSA key size."}, {"R_GenerateSignature","Unable to generate signature using a specified Azure Key Vault Key URL."}, {"R_SignedHashLengthError","Signed hash length does not match the RSA key size."}, From 3bc6f34f06d148af3eee52069802b360f4abd2a3 Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 11:44:05 -0700 Subject: [PATCH 2/6] fix misspelled words --- .../java/com/microsoft/sqlserver/jdbc/SQLServerResource.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index ca6777559c..b963b75dc5 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -45,7 +45,7 @@ protected Object[][] getContents() { {"R_noServerResponse", "SQL Server did not return a response. The connection has been closed."}, {"R_truncatedServerResponse", "SQL Server returned an incomplete response. The connection has been closed."}, {"R_queryTimedOut", "The query has timed out."}, - {"R_queryCancelled", "The query was canceled."}, + {"R_queryCancelled", "The query was cancelled."}, {"R_errorReadingStream", "An error occurred while reading the value from the stream object. Error: \"{0}\""}, {"R_streamReadReturnedInvalidValue", "The stream read operation returned an invalid value for the amount of data read."}, {"R_mismatchedStreamLength", "The stream value is not the specified length. The specified length was {0}, the actual length is {1}."}, @@ -190,7 +190,7 @@ protected Object[][] getContents() { {"R_socketTimeoutPropertyDescription", "The number of milliseconds to wait before the java.net.SocketTimeoutException is raised."}, {"R_serverPreparedStatementDiscardThresholdPropertyDescription", "The threshold for when to close discarded prepare statements on the server (calling a batch of sp_unprepares). A value of 1 or less will cause sp_unprepare to be called immediately on PreparedStatment close."}, {"R_enablePrepareOnFirstPreparedStatementCallPropertyDescription", "This setting specifies whether a prepared statement is prepared (sp_prepexec) on first use (property=true) or on second after first calling sp_executesql (property=false)."}, - {"R_statementPoolingCacheSizePropertyDescription", "This setting specifies the size of the prepared statement cache for a conection. A value less than 1 means no cache."}, + {"R_statementPoolingCacheSizePropertyDescription", "This setting specifies the size of the prepared statement cache for a connection. A value less than 1 means no cache."}, {"R_gsscredentialPropertyDescription", "Impersonated GSS Credential to access SQL Server."}, {"R_noParserSupport", "An error occurred while instantiating the required parser. Error: \"{0}\""}, {"R_writeOnlyXML", "Cannot read from this SQLXML instance. This instance is for writing data only."}, @@ -375,7 +375,6 @@ protected Object[][] getContents() { {"R_TVPnotWorkWithSetObjectResultSet" , "setObject() with ResultSet is not supported for Table-Valued Parameter. Please use setStructured()."}, {"R_invalidQueryTimeout", "The queryTimeout {0} is not valid."}, {"R_invalidSocketTimeout", "The socketTimeout {0} is not valid."}, - {"R_fipsPropertyDescription", "Determines if enable FIPS compilant SSL connection between the client and the server."}, {"R_invalidFipsConfig", "Could not enable FIPS."}, {"R_invalidFipsEncryptConfig", "Could not enable FIPS due to either encrypt is not true or using trusted certificate settings."}, {"R_invalidFipsProviderConfig", "Could not enable FIPS due to invalid FIPSProvider or TrustStoreType."}, From 6790ecd9bb9ebc9e191b42198c4b90e96dece3f7 Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 12:00:48 -0700 Subject: [PATCH 3/6] adding one error message back --- .../java/com/microsoft/sqlserver/jdbc/SQLServerResource.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index b963b75dc5..e8713e8c7b 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -375,6 +375,7 @@ protected Object[][] getContents() { {"R_TVPnotWorkWithSetObjectResultSet" , "setObject() with ResultSet is not supported for Table-Valued Parameter. Please use setStructured()."}, {"R_invalidQueryTimeout", "The queryTimeout {0} is not valid."}, {"R_invalidSocketTimeout", "The socketTimeout {0} is not valid."}, + {"R_fipsPropertyDescription", "Determines if enable FIPS compilant SSL connection between the client and the server."}, {"R_invalidFipsConfig", "Could not enable FIPS."}, {"R_invalidFipsEncryptConfig", "Could not enable FIPS due to either encrypt is not true or using trusted certificate settings."}, {"R_invalidFipsProviderConfig", "Could not enable FIPS due to invalid FIPSProvider or TrustStoreType."}, From 5bc2a9f897210bdea3ba3464d11d600fd15954ce Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 12:04:12 -0700 Subject: [PATCH 4/6] too bad.. I forgot to fix the misspelled word.... --- .../java/com/microsoft/sqlserver/jdbc/SQLServerResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index e8713e8c7b..8458f2bfbc 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -375,7 +375,7 @@ protected Object[][] getContents() { {"R_TVPnotWorkWithSetObjectResultSet" , "setObject() with ResultSet is not supported for Table-Valued Parameter. Please use setStructured()."}, {"R_invalidQueryTimeout", "The queryTimeout {0} is not valid."}, {"R_invalidSocketTimeout", "The socketTimeout {0} is not valid."}, - {"R_fipsPropertyDescription", "Determines if enable FIPS compilant SSL connection between the client and the server."}, + {"R_fipsPropertyDescription", "Determines if enable FIPS compliant SSL connection between the client and the server."}, {"R_invalidFipsConfig", "Could not enable FIPS."}, {"R_invalidFipsEncryptConfig", "Could not enable FIPS due to either encrypt is not true or using trusted certificate settings."}, {"R_invalidFipsProviderConfig", "Could not enable FIPS due to invalid FIPSProvider or TrustStoreType."}, From 117bd76a705fbd86ac5c89e0f4fc6b73e3f5024b Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 13:54:47 -0700 Subject: [PATCH 5/6] fix tests --- .../jdbc/unit/statement/StatementCancellationTest.java | 2 +- .../sqlserver/jdbc/unit/statement/StatementTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java index 0a2abb2c1e..1083b2e663 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java @@ -59,7 +59,7 @@ public void run() { stmt.execute("WAITFOR DELAY '00:00:" + (DELAY_WAIT_MILLISECONDS / 1000) + "'"); } catch (SQLException e) { - assertTrue(e.getMessage().startsWith("The query was canceled"), "Unexpected error message."); + assertTrue(e.getMessage().startsWith("The query was cancelled"), "Unexpected error message."); } } } diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java index 88b6c54277..443394abb8 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java @@ -366,7 +366,7 @@ public void testCancelBlockedResponse() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was canceled.".equalsIgnoreCase(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was cancelled.".equalsIgnoreCase(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis(); @@ -479,7 +479,7 @@ public void testCancelBlockedResponsePS() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was canceled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was cancelled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis(); @@ -599,7 +599,7 @@ public void testCancelBlockedCursoredResponse() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was canceled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was cancelled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis(); From 29d4e40c14754e5067d9b926f9565681092686fb Mon Sep 17 00:00:00 2001 From: Shawn Sun Date: Thu, 17 Aug 2017 16:54:23 -0700 Subject: [PATCH 6/6] change cancellded to canceled --- .../com/microsoft/sqlserver/jdbc/SQLServerResource.java | 2 +- .../jdbc/unit/statement/StatementCancellationTest.java | 2 +- .../sqlserver/jdbc/unit/statement/StatementTest.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java index 8458f2bfbc..4be131b080 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java @@ -45,7 +45,7 @@ protected Object[][] getContents() { {"R_noServerResponse", "SQL Server did not return a response. The connection has been closed."}, {"R_truncatedServerResponse", "SQL Server returned an incomplete response. The connection has been closed."}, {"R_queryTimedOut", "The query has timed out."}, - {"R_queryCancelled", "The query was cancelled."}, + {"R_queryCancelled", "The query was canceled."}, {"R_errorReadingStream", "An error occurred while reading the value from the stream object. Error: \"{0}\""}, {"R_streamReadReturnedInvalidValue", "The stream read operation returned an invalid value for the amount of data read."}, {"R_mismatchedStreamLength", "The stream value is not the specified length. The specified length was {0}, the actual length is {1}."}, diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java index 1083b2e663..0a2abb2c1e 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementCancellationTest.java @@ -59,7 +59,7 @@ public void run() { stmt.execute("WAITFOR DELAY '00:00:" + (DELAY_WAIT_MILLISECONDS / 1000) + "'"); } catch (SQLException e) { - assertTrue(e.getMessage().startsWith("The query was cancelled"), "Unexpected error message."); + assertTrue(e.getMessage().startsWith("The query was canceled"), "Unexpected error message."); } } } diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java index 443394abb8..88b6c54277 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/StatementTest.java @@ -366,7 +366,7 @@ public void testCancelBlockedResponse() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was cancelled.".equalsIgnoreCase(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was canceled.".equalsIgnoreCase(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis(); @@ -479,7 +479,7 @@ public void testCancelBlockedResponsePS() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was cancelled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was canceled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis(); @@ -599,7 +599,7 @@ public void testCancelBlockedCursoredResponse() throws Exception { assertEquals(false, true, "Expected exception not thrown from ResultSet.next()"); } catch (SQLException e) { - assertTrue("The query was cancelled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); + assertTrue("The query was canceled.".contains(e.getMessage()), "Unexpected exception from ResultSet.next()"); } elapsedMillis += System.currentTimeMillis();