zstan commented on code in PR #13037:
URL: https://github.com/apache/ignite/pull/13037#discussion_r3115649851
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java:
##########
@@ -477,6 +479,186 @@ public void testParametersMetadata() throws Exception {
}
}
+ /**
+ * Test behavior when neither key nor value should be wrapped.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testNoWrap() throws SQLException {
+ doTestKeyValueWrap(false, false, false);
+ }
+
+ /**
+ * Test behavior when only key is wrapped.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testKeyWrap() throws SQLException {
+ doTestKeyValueWrap(true, false, false);
+ }
+
+ /**
+ * Test behavior when only value is wrapped.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testValueWrap() throws SQLException {
+ doTestKeyValueWrap(false, true, false);
+ }
+
+ /**
+ * Test behavior when both key and value is wrapped.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testKeyAndValueWrap() throws SQLException {
+ doTestKeyValueWrap(true, true, false);
+ }
+
+ /**
+ * Test behavior when neither key nor value should be wrapped.
+ * Key and value are UUID.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testUuidNoWrap() throws SQLException {
+ doTestKeyValueWrap(false, false, true);
+ }
+
+ /**
+ * Test behavior when only key is wrapped.
+ * Key and value are UUID.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testUuidKeyWrap() throws SQLException {
+ doTestKeyValueWrap(true, false, true);
+ }
+
+ /**
+ * Test behavior when only value is wrapped.
+ * Key and value are UUID.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testUuidValueWrap() throws SQLException {
+ doTestKeyValueWrap(false, true, true);
+ }
+
+ /**
+ * Test behavior when both key and value is wrapped.
+ * Key and value are UUID.
+ * @throws SQLException if failed.
+ */
+ @Test
+ public void testUuidKeyAndValueWrap() throws SQLException {
+ doTestKeyValueWrap(true, true, true);
+ }
+
+ /**
+ * Test behavior for given combination of wrap flags.
+ * @param wrapKey Whether key wrap should be enforced.
+ * @param wrapVal Whether value wrap should be enforced.
+ * @throws SQLException if failed.
+ */
+ private void doTestKeyValueWrap(boolean wrapKey, boolean wrapVal, boolean
testUuid) throws SQLException {
+ try {
+ String sql = testUuid ? String.format("CREATE TABLE T (\"Id\" UUID
primary key, \"xX\" UUID) WITH " +
+ "\"wrap_key=%b,wrap_value=%b", wrapKey, wrapVal) :
+ String.format("CREATE TABLE T (\"Id\" int primary key, \"xX\"
varchar) WITH " +
+ "\"wrap_key=%b,wrap_value=%b", wrapKey, wrapVal);
+
+ UUID guid = UUID.randomUUID();
+
+ if (wrapKey)
Review Comment:
i extend tests and seems it`s all ok there, or i miss smth (
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]