From 62d2e64a821bd68daf09e589ca000f2d92f9be39 Mon Sep 17 00:00:00 2001 From: rene-ye Date: Wed, 12 Feb 2020 10:16:19 -0800 Subject: [PATCH] some changes --- .../jdbc/AlwaysEncrypted/AESetup.java | 24 +- .../jdbc/AlwaysEncrypted/EnclaveTest.java | 650 +----------------- .../JDBCEncryptionDecryptionTest.java | 118 ++-- 3 files changed, 64 insertions(+), 728 deletions(-) diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java index 9a2dd9111..441651ceb 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/AESetup.java @@ -183,7 +183,7 @@ static void setAEConnectionString(String serverName, String url, String protocol // show progress if testing multiple servers if (enclaveServer.length > 1) { - System.out.println("Adding enclave configuration: " + enclaveProperties); + System.out.println("Running against: " + enclaveProperties); } } else { AETestConnectionString = connectionString + ";sendTimeAsDateTime=false" @@ -191,26 +191,6 @@ static void setAEConnectionString(String serverName, String url, String protocol } } - /** - * Setup AE connection string and check setup - * - * @param serverName - * @param url - * @param protocol - * @throws SQLException - */ - void checkAESetup(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo)) { - isAEv2 = TestUtils.isAEv2(con); - } catch (SQLException e) { - isAEv2 = false; - } catch (Exception e) { - fail(TestResource.getResource("R_unexpectedErrorMessage") + e.getMessage()); - } - } - @BeforeAll public static void setupAETest() throws Exception { readFromFile(Constants.JAVA_KEY_STORE_FILENAME, "Alias name"); @@ -251,6 +231,8 @@ public static void setupAETest() throws Exception { createCEK(cmkWin, cekWin, null); } } + + isAEv2 = enclaveServer.length > 0; } /** diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/EnclaveTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/EnclaveTest.java index caa1ba9ae..90b549943 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/EnclaveTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/EnclaveTest.java @@ -7,12 +7,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.sql.ParameterMetaData; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; - import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -20,7 +14,6 @@ import org.junit.runners.Parameterized; import com.microsoft.sqlserver.jdbc.EnclavePackageTest; -import com.microsoft.sqlserver.jdbc.RandomData; import com.microsoft.sqlserver.jdbc.SQLServerConnection; import com.microsoft.sqlserver.jdbc.SQLServerStatement; import com.microsoft.sqlserver.jdbc.TestResource; @@ -169,652 +162,11 @@ public void testAEv2Disabled(String serverName, String url, String protocol) thr try (SQLServerConnection con = PrepUtil.getConnection(testConnectionString); SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, true); + testChars(stmt, cekJks, charTable, values, JDBCEncryptionDecryptionTest.TestCase.NORMAL, true); fail(TestResource.getResource("R_expectedExceptionNotThrown")); } catch (Throwable e) { // testChars called fail() assertTrue(e.getMessage().contains(TestResource.getResource("R_AlterAEv2Error"))); } } - - /** - * Test case for char set string for string values - * - * @throws Exception - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSpecificSetter(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = createCharValues(nullable); - - testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, true); - testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for char set string for string values using windows certificate store - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSpecificSetterWindows(String serverName, String url, String protocol) throws Exception { - org.junit.Assume.assumeTrue(System.getProperty("os.name").startsWith("Windows")); - - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = createCharValues(nullable); - - testChars(stmt, cekWin, charTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for char set object for string values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSetObject(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = createCharValues(nullable); - - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, true); - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, true); - } - } - - /** - * Test case for char set object for jdbc string values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSetObjectWithJDBCTypes(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = createCharValues(nullable); - - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - } - } - - /** - * Test case for char set string for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSpecificSetterNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = {null, null, null, null, null, null, null, null, null}; - - testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, true); - testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for char set object for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSetObjectNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = {null, null, null, null, null, null, null, null, null}; - - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, true); - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, true); - } - } - - /** - * Test case for char set null for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testCharSetNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values = {null, null, null, null, null, null, null, null, null}; - - testChars(stmt, cekJks, charTable, values, TestCase.NULL, true); - testChars(stmt, cekAkv, charTable, values, TestCase.NULL, true); - } - } - - /** - * Test case for binary set binary for binary values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySpecificSetter(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(false); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for binary set binary for binary values using windows certificate store - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySpecificSetterWindows(String serverName, String url, String protocol) throws Exception { - org.junit.Assume.assumeTrue(System.getProperty("os.name").startsWith("Windows")); - - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(false); - - testBinaries(stmt, cekWin, binaryTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for binary set object for binary values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySetobject(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(false); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT, true); - } - } - - /** - * Test case for binary set null for binary values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySetNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(true); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NULL, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NULL, true); - } - } - - /** - * Test case for binary set binary for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySpecificSetterNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(true); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for binary set object for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarysetObjectNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(true); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_NULL, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_NULL, true); - } - } - - /** - * Test case for binary set object for jdbc type binary values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testBinarySetObjectWithJDBCTypes(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createBinaryValues(false); - - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - } - } - - /** - * Test case for date set date for date values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSpecificSetter(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for date set date for date values using windows certificate store - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSpecificSetterWindows(String serverName, String url, String protocol) throws Exception { - org.junit.Assume.assumeTrue(System.getProperty("os.name").startsWith("Windows")); - - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekWin, dateTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for date set object for date values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSetObject(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT, true); - } - } - - /** - * Test case for date set object for java date values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSetObjectWithJavaType(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, true); - } - } - - /** - * Test case for date set object for jdbc date values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSetObjectWithJDBCType(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - } - } - - /** - * Test case for date set date for min/max date values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSpecificSetterMinMaxValue(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - RandomData.returnMinMax = true; - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, true); - } - } - - /** - * Test case for date set date for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSetNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - RandomData.returnNull = true; - nullable = true; - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.NULL, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.NULL, true); - } - - nullable = false; - RandomData.returnNull = false; - } - - /** - * Test case for date set object for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testDateSetObjectNull(String serverName, String url, String protocol) throws Exception { - RandomData.returnNull = true; - nullable = true; - - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - LinkedList values = createTemporalTypes(nullable); - - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_NULL, true); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_NULL, true); - } - - nullable = false; - RandomData.returnNull = false; - } - - /** - * Test case for numeric set numeric for numeric values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetter(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, true); - } - } - - /** - * Test case for numeric set numeric for numeric values using windows certificate store - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetterWindows(String serverName, String url, String protocol) throws Exception { - org.junit.Assume.assumeTrue(System.getProperty("os.name").startsWith("Windows")); - - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekWin, numericTable, values1, values2, TestCase.NORMAL, true); - } - } - - /** - * Test case for numeric set object for numeric values F - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSetObject(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT, true); - } - } - - /** - * Test case for numeric set object for jdbc type numeric values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSetObjectWithJDBCTypes(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, true); - } - } - - /** - * Test case for numeric set numeric for max numeric values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetterMaxValue(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - - String[] values1 = {Boolean.TRUE.toString(), "255", "32767", "2147483647", "9223372036854775807", - "1.79E308", "1.123", "3.4E38", "999999999999999999", "12345.12345", "999999999999999999", - "567812.78", "214748.3647", "922337203685477.5807", "999999999999999999999999.9999", - "999999999999999999999999.9999"}; - String[] values2 = {Boolean.TRUE.toString(), "255", "32767", "2147483647", "9223372036854775807", - "1.79E308", "1.123", "3.4E38", "999999999999999999", "12345.12345", "999999999999999999", - "567812.78", "214748.3647", "922337203685477.5807", "999999999999999999999999.9999", - "999999999999999999999999.9999"}; - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, true); - } - } - - /** - * Test case for numeric set numeric for min numeric values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetterMinValue(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values1 = {Boolean.FALSE.toString(), "0", "-32768", "-2147483648", "-9223372036854775808", - "-1.79E308", "1.123", "-3.4E38", "999999999999999999", "12345.12345", "999999999999999999", - "567812.78", "-214748.3648", "-922337203685477.5808", "999999999999999999999999.9999", - "999999999999999999999999.9999"}; - String[] values2 = {Boolean.FALSE.toString(), "0", "-32768", "-2147483648", "-9223372036854775808", - "-1.79E308", "1.123", "-3.4E38", "999999999999999999", "12345.12345", "999999999999999999", - "567812.78", "-214748.3648", "-922337203685477.5808", "999999999999999999999999.9999", - "999999999999999999999999.9999"}; - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, true); - } - } - - /** - * Test case for numeric set numeric for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetterNull(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - nullable = true; - RandomData.returnNull = true; - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, true); - } - - nullable = false; - RandomData.returnNull = false; - } - - /** - * Test case for numeric set object for null values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericSpecificSetterSetObjectNull(String serverName, String url, - String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - nullable = true; - RandomData.returnNull = true; - String[] values1 = createNumericValues(nullable); - String[] values2 = new String[values1.length]; - System.arraycopy(values1, 0, values2, 0, values1.length); - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, true); - } - - nullable = false; - RandomData.returnNull = false; - } - - /** - * Test case for numeric set numeric for null normalization values - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testNumericNormalization(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); - SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { - String[] values1 = {Boolean.TRUE.toString(), "1", "127", "100", "100", "1.123", "1.123", "1.123", - "123456789123456789", "12345.12345", "987654321123456789", "567812.78", "7812.7812", "7812.7812", - "999999999999999999999999.9999", "999999999999999999999999.9999"}; - String[] values2 = {Boolean.TRUE.toString(), "1", "127", "100", "100", "1.123", "1.123", "1.123", - "123456789123456789", "12345.12345", "987654321123456789", "567812.78", "7812.7812", "7812.7812", - "999999999999999999999999.9999", "999999999999999999999999.9999"}; - - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, true); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, true); - } - } - - /** - * Test FMTOnly with Always Encrypted - * - * @throws SQLException - */ - @ParameterizedTest - @MethodSource("enclaveParams") - public void testAEFMTOnly(String serverName, String url, String protocol) throws Exception { - setAEConnectionString(serverName, url, protocol); - try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";useFmtOnly=true", AEInfo); - Statement s = c.createStatement()) { - createTable(NUMERIC_TABLE_AE, cekJks, numericTable); - String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," - + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," - + "?,?,?," + "?,?,?," + "?,?,?" + ")"; - try (PreparedStatement p = c.prepareStatement(sql)) { - ParameterMetaData pmd = p.getParameterMetaData(); - assertTrue(pmd.getParameterCount() == 48); - } - } - } } diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/JDBCEncryptionDecryptionTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/JDBCEncryptionDecryptionTest.java index f142a8933..c3429e35e 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/JDBCEncryptionDecryptionTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/JDBCEncryptionDecryptionTest.java @@ -326,11 +326,12 @@ public void testAkvDecryptColumnEncryptionKey(String serverName, String url, Str @ParameterizedTest @MethodSource("enclaveParams") public void testCharSpecificSetter(String serverName, String url, String protocol) throws Exception { + setAEConnectionString(serverName, url, protocol); try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, false); + testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, isAEv2); } } @@ -343,11 +344,12 @@ public void testCharSpecificSetter(String serverName, String url, String protoco @MethodSource("enclaveParams") @Tag(Constants.reqExternalSetup) public void testCharSpecificSetterAkv(String serverName, String url, String protocol) throws Exception { + setAEConnectionString(serverName, url, protocol); try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo); SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, false); + testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, isAEv2); } } @@ -367,7 +369,7 @@ public void testCharSpecificSetterWindows(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekWin, charTable, values, TestCase.NORMAL, false); + testChars(stmt, cekWin, charTable, values, TestCase.NORMAL, isAEv2); } } @@ -385,7 +387,7 @@ public void testCharSetObjectAkv(String serverName, String url, String protocol) SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, false); + testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -402,7 +404,7 @@ public void testCharSetObject(String serverName, String url, String protocol) th SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, false); + testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -420,7 +422,7 @@ public void testCharSetObjectWithJDBCTypesAkv(String serverName, String url, Str SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -437,7 +439,7 @@ public void testCharSetObjectWithJDBCTypes(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = createCharValues(nullable); - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -455,7 +457,7 @@ public void testCharSpecificSetterNullAkv(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, false); + testChars(stmt, cekAkv, charTable, values, TestCase.NORMAL, isAEv2); } } @@ -472,7 +474,7 @@ public void testCharSpecificSetterNull(String serverName, String url, String pro SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, false); + testChars(stmt, cekJks, charTable, values, TestCase.NORMAL, isAEv2); } } @@ -490,7 +492,7 @@ public void testCharSetObjectNullAkv(String serverName, String url, String proto SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, false); + testChars(stmt, cekAkv, charTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -507,7 +509,7 @@ public void testCharSetObjectNull(String serverName, String url, String protocol SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, false); + testChars(stmt, cekJks, charTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -525,7 +527,7 @@ public void testCharSetNullAkv(String serverName, String url, String protocol) t SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekAkv, charTable, values, TestCase.NULL, false); + testChars(stmt, cekAkv, charTable, values, TestCase.NULL, isAEv2); } } @@ -542,7 +544,7 @@ public void testCharSetNull(String serverName, String url, String protocol) thro SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { String[] values = {null, null, null, null, null, null, null, null, null}; - testChars(stmt, cekJks, charTable, values, TestCase.NULL, false); + testChars(stmt, cekJks, charTable, values, TestCase.NULL, isAEv2); } } @@ -560,7 +562,7 @@ public void testBinarySpecificSetterAkv(String serverName, String url, String pr SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, isAEv2); } } @@ -577,7 +579,7 @@ public void testBinarySpecificSetter(String serverName, String url, String proto SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, isAEv2); } } @@ -597,7 +599,7 @@ public void testBinarySpecificSetterWindows(String serverName, String url, Strin SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekWin, binaryTable, values, TestCase.NORMAL, false); + testBinaries(stmt, cekWin, binaryTable, values, TestCase.NORMAL, isAEv2); } } @@ -615,7 +617,7 @@ public void testBinarySetobjectAkv(String serverName, String url, String protoco SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -632,7 +634,7 @@ public void testBinarySetobject(String serverName, String url, String protocol) SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -650,7 +652,7 @@ public void testBinarySetNullAkv(String serverName, String url, String protocol) SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NULL, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NULL, isAEv2); } } @@ -667,7 +669,7 @@ public void testBinarySetNull(String serverName, String url, String protocol) th SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NULL, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.NULL, isAEv2); } } @@ -685,7 +687,7 @@ public void testBinarySpecificSetterNullAkv(String serverName, String url, Strin SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.NORMAL, isAEv2); } } @@ -702,7 +704,7 @@ public void testBinarySpecificSetterNull(String serverName, String url, String p SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.NORMAL, isAEv2); } } @@ -720,7 +722,7 @@ public void testBinarysetObjectNullAkv(String serverName, String url, String pro SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_NULL, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_NULL, isAEv2); } } @@ -737,7 +739,7 @@ public void testBinarysetObjectNull(String serverName, String url, String protoc SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(true); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_NULL, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_NULL, isAEv2); } } @@ -755,7 +757,7 @@ public void testBinarySetObjectWithJDBCTypesAkv(String serverName, String url, S SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testBinaries(stmt, cekAkv, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -772,7 +774,7 @@ public void testBinarySetObjectWithJDBCTypes(String serverName, String url, Stri SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createBinaryValues(false); - testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testBinaries(stmt, cekJks, binaryTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -790,7 +792,7 @@ public void testDateSpecificSetterAkv(String serverName, String url, String prot SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, isAEv2); } } @@ -807,7 +809,7 @@ public void testDateSpecificSetter(String serverName, String url, String protoco SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, false); + testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, isAEv2); } } @@ -828,7 +830,7 @@ public void testDateSpecificSetterWindows(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekWin, dateTable, values, TestCase.NORMAL, false); + testDates(stmt, cekWin, dateTable, values, TestCase.NORMAL, isAEv2); } } @@ -847,7 +849,7 @@ public void testDateSetObjectAkv(String serverName, String url, String protocol) SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -865,7 +867,7 @@ public void testDateSetObject(String serverName, String url, String protocol) th SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT, false); + testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT, isAEv2); } } @@ -884,7 +886,7 @@ public void testDateSetObjectWithJavaTypeAkv(String serverName, String url, Stri SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, isAEv2); } } @@ -902,7 +904,7 @@ public void testDateSetObjectWithJavaType(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, false); + testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JAVATYPES, isAEv2); } } @@ -921,7 +923,7 @@ public void testDateSetObjectWithJDBCTypeAkv(String serverName, String url, Stri SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -939,7 +941,7 @@ public void testDateSetObjectWithJDBCType(String serverName, String url, String SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -959,7 +961,7 @@ public void testDateSpecificSetterMinMaxValueAkv(String serverName, String url, RandomData.returnMinMax = true; LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.NORMAL, isAEv2); } } @@ -978,7 +980,7 @@ public void testDateSpecificSetterMinMaxValue(String serverName, String url, Str RandomData.returnMinMax = true; LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, false); + testDates(stmt, cekJks, dateTable, values, TestCase.NORMAL, isAEv2); } } @@ -999,7 +1001,7 @@ public void testDateSetNullAkv(String serverName, String url, String protocol) t nullable = true; LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.NULL, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.NULL, isAEv2); } nullable = false; @@ -1022,7 +1024,7 @@ public void testDateSetNull(String serverName, String url, String protocol) thro nullable = true; LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.NULL, false); + testDates(stmt, cekJks, dateTable, values, TestCase.NULL, isAEv2); } nullable = false; @@ -1047,7 +1049,7 @@ public void testDateSetObjectNullAkv(String serverName, String url, String proto SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_NULL, false); + testDates(stmt, cekAkv, dateTable, values, TestCase.SETOBJECT_NULL, isAEv2); } nullable = false; @@ -1071,7 +1073,7 @@ public void testDateSetObjectNull(String serverName, String url, String protocol SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) { LinkedList values = createTemporalTypes(nullable); - testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_NULL, false); + testDates(stmt, cekJks, dateTable, values, TestCase.SETOBJECT_NULL, isAEv2); } nullable = false; @@ -1096,7 +1098,7 @@ public void testNumericSpecificSetterAkv(String serverName, String url, String p String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1117,7 +1119,7 @@ public void testNumericSpecificSetter(String serverName, String url, String prot String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1141,7 +1143,7 @@ public void testNumericSpecificSetterWindows(String serverName, String url, Stri String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekWin, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekWin, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1162,7 +1164,7 @@ public void testNumericSetObjectAkv(String serverName, String url, String protoc String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT, isAEv2); } } @@ -1182,7 +1184,7 @@ public void testNumericSetObject(String serverName, String url, String protocol) String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT, isAEv2); } } @@ -1203,7 +1205,7 @@ public void testNumericSetObjectWithJDBCTypesAkv(String serverName, String url, String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -1223,7 +1225,7 @@ public void testNumericSetObjectWithJDBCTypes(String serverName, String url, Str String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.SETOBJECT_WITH_JDBCTYPES, isAEv2); } } @@ -1250,7 +1252,7 @@ public void testNumericSpecificSetterMaxValueAkv(String serverName, String url, "567812.78", "214748.3647", "922337203685477.5807", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1276,7 +1278,7 @@ public void testNumericSpecificSetterMaxValue(String serverName, String url, Str "567812.78", "214748.3647", "922337203685477.5807", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1302,7 +1304,7 @@ public void testNumericSpecificSetterMinValueAkv(String serverName, String url, "567812.78", "-214748.3648", "-922337203685477.5808", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1327,7 +1329,7 @@ public void testNumericSpecificSetterMinValue(String serverName, String url, Str "567812.78", "-214748.3648", "-922337203685477.5808", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1350,7 +1352,7 @@ public void testNumericSpecificSetterNullAkv(String serverName, String url, Stri String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, isAEv2); } nullable = false; @@ -1375,7 +1377,7 @@ public void testNumericSpecificSetterNull(String serverName, String url, String String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, isAEv2); } nullable = false; @@ -1401,7 +1403,7 @@ public void testNumericSpecificSetterSetObjectNullAkv(String serverName, String String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NULL, isAEv2); } nullable = false; @@ -1426,7 +1428,7 @@ public void testNumericSpecificSetterSetObjectNull(String serverName, String url String[] values2 = new String[values1.length]; System.arraycopy(values1, 0, values2, 0, values1.length); - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NULL, isAEv2); } nullable = false; @@ -1453,7 +1455,7 @@ public void testNumericNormalizationAkv(String serverName, String url, String pr "123456789123456789", "12345.12345", "987654321123456789", "567812.78", "7812.7812", "7812.7812", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekAkv, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } } @@ -1476,7 +1478,7 @@ public void testNumericNormalization(String serverName, String url, String proto "123456789123456789", "12345.12345", "987654321123456789", "567812.78", "7812.7812", "7812.7812", "999999999999999999999999.9999", "999999999999999999999999.9999"}; - testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, false); + testNumerics(stmt, cekJks, numericTable, values1, values2, TestCase.NORMAL, isAEv2); } }