rdblue commented on code in PR #8340:
URL: https://github.com/apache/iceberg/pull/8340#discussion_r1367146172


##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -604,6 +604,27 @@ public void testCreateNamespace() {
     // Test with no metadata
     catalog.createNamespace(testNamespace);
     assertThat(catalog.namespaceExists(testNamespace)).isTrue();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb"))).isTrue();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb", 
"ns1"))).isTrue();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb", "ns1", 
"ns2"))).isTrue();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb_"))).isFalse();
+    assertThat(catalog.namespaceExists(Namespace.of("testD_"))).isFalse();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb."))).isFalse();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb.ns"))).isFalse();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb.ns_"))).isFalse();
+    assertThat(catalog.namespaceExists(Namespace.of("testDb%"))).isFalse();
+
+    Namespace underscore = Namespace.of("te%t_b");
+    assertThat(catalog.namespaceExists(underscore))
+        .as("Should false to namespace doesn't exist")
+        .isFalse();
+
+    Namespace underscore2 = Namespace.of("special_name%space");
+    catalog.createNamespace(underscore2);
+    assertThat(catalog.namespaceExists(underscore2)).isTrue();
+    assertThat(catalog.namespaceExists(Namespace.of("special_name%spa_e")))

Review Comment:
   For all of these test cases, can you add both positive and negative 
assertions? That is, test that the namespace doesn't exist and then create it 
and test that it does.
   
   I think we also need to test existence by creating a nested namespace. 
That's probably a new test case.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to