Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSI test failures #1604

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

Large diffs are not rendered by default.

Expand Up @@ -138,18 +138,18 @@ public static void initValues() throws Exception {
populateTable3();
populateTable4();

createTable(CHAR_TABLE_AE, cekJks, charTable);
createTable(NUMERIC_TABLE_AE, cekJks, numericTable);
createTable(BINARY_TABLE_AE, cekJks, binaryTable);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, charTable);
createTable(AETestConnectionString, NUMERIC_TABLE_AE, cekJks, numericTable);
createTable(AETestConnectionString, BINARY_TABLE_AE, cekJks, binaryTable);

createDateTableCallableStatement(cekJks);
populateCharNormalCase(charValues);
populateNumericSetObject(numericValues);
populateBinaryNormalCase(byteValues);
populateCharNormalCase(AETestConnectionString, charValues);
populateNumericSetObject(AETestConnectionString, numericValues);
populateBinaryNormalCase(AETestConnectionString, byteValues);
populateDateNormalCase();

createTable(SCALE_DATE_TABLE_AE, cekJks, dateScaleTable);
populateDateScaleNormalCase(dateValues);
createTable(AETestConnectionString, SCALE_DATE_TABLE_AE, cekJks, dateScaleTable);
populateDateScaleNormalCase(AETestConnectionString, dateValues);
}

@AfterAll
Expand Down Expand Up @@ -347,10 +347,10 @@ private static void dropTables() throws SQLException {
}

private static void createSPTables(String cekName) throws SQLException {
createTable(table1, cekJks, SP_table1);
createTable(table2, cekJks, SP_table2);
createTable(table3, cekJks, SP_table3);
createTable(table4, cekJks, SP_table4);
createTable(AETestConnectionString, table1, cekJks, SP_table1);
createTable(AETestConnectionString, table2, cekJks, SP_table2);
createTable(AETestConnectionString, table3, cekJks, SP_table3);
createTable(AETestConnectionString, table4, cekJks, SP_table4);

String sql = "create table " + table5 + " ("
+ "c1 int ENCRYPTED WITH (ENCRYPTION_TYPE = DETERMINISTIC, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256', COLUMN_ENCRYPTION_KEY = "
Expand Down
Expand Up @@ -183,9 +183,9 @@ public void testAEv2Disabled(String serverName, String url, String protocol) thr
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
String[] values = createCharValues(false);
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(values);
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekJks);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(AETestConnectionString, values);
testAlterColumnEncryption(AETestConnectionString, stmt, CHAR_TABLE_AE, charTable, cekJks);
fail(TestResource.getResource("R_expectedExceptionNotThrown"));
} catch (Throwable e) {
// testChars called fail()
Expand All @@ -203,9 +203,9 @@ public void testChar(String serverName, String url, String protocol) throws Exce
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(createCharValues(false));
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekJks);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(AETestConnectionString, createCharValues(false));
testAlterColumnEncryption(AETestConnectionString, stmt, CHAR_TABLE_AE, charTable, cekJks);
}
}

Expand All @@ -219,9 +219,9 @@ public void testCharAkv(String serverName, String url, String protocol) throws E
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekAkv, charTable);
populateCharNormalCase(createCharValues(false));
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekAkv);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekAkv, charTable);
populateCharNormalCase(AETestConnectionString, createCharValues(false));
testAlterColumnEncryption(AETestConnectionString, stmt, CHAR_TABLE_AE, charTable, cekAkv);
}
}

Expand All @@ -236,7 +236,7 @@ public void testAEFMTOnly(String serverName, String url, String protocol) throws
setAEConnectionString(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";useFmtOnly=true", AEInfo);
Statement s = c.createStatement()) {
createTable(NUMERIC_TABLE_AE, cekJks, numericTable);
createTable(AETestConnectionString, NUMERIC_TABLE_AE, cekJks, numericTable);
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?" + ")";
Expand All @@ -256,7 +256,7 @@ public void testAlter(String serverName, String url, String protocol) throws Exc
setAEConnectionString(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
Statement s = c.createStatement()) {
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, varcharTableSimple);
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + CHAR_TABLE_AE + " VALUES (?,?,?)");
pstmt.setString(1, "a");
pstmt.setString(2, "b");
Expand All @@ -277,7 +277,7 @@ public void testNumericRichQuery(String serverName, String url, String protocol)
setAEConnectionString(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
Statement s = c.createStatement()) {
createTable(NUMERIC_TABLE_AE, cekJks, numericTableSimple);
createTable(AETestConnectionString, NUMERIC_TABLE_AE, cekJks, numericTableSimple);
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + NUMERIC_TABLE_AE + " VALUES (?,?,?)");
pstmt.setInt(1, 1);
pstmt.setInt(2, 2);
Expand All @@ -304,7 +304,7 @@ public void testStringRichQuery(String serverName, String url, String protocol)
setAEConnectionString(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
Statement s = c.createStatement()) {
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, varcharTableSimple);
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + CHAR_TABLE_AE + " VALUES (?,?,?)");
pstmt.setString(1, "a");
pstmt.setString(2, "b");
Expand All @@ -331,7 +331,7 @@ public void testAlterNoEncrypt(String serverName, String url, String protocol) t
setAEConnectionString(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString, AEInfo);
Statement s = c.createStatement()) {
createTable(CHAR_TABLE_AE, cekJks, varcharTableSimple);
createTable(AETestConnectionString, CHAR_TABLE_AE, cekJks, varcharTableSimple);
PreparedStatement pstmt = c.prepareStatement("INSERT INTO " + CHAR_TABLE_AE + " VALUES (?,?,?)");
pstmt.setString(1, "a");
pstmt.setString(2, "b");
Expand Down