bowenli86 commented on a change in pull request #9399: 
[FLINK-13526][sql-client] Switching to a non existing catalog or data…
URL: https://github.com/apache/flink/pull/9399#discussion_r312327916
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
 ##########
 @@ -506,6 +506,30 @@ public void testUseCatalogAndUseDatabase() throws 
Exception {
                }
        }
 
+       @Test
+       public void testUseNonExistingDatabase() throws Exception {
+               final Executor executor = createDefaultExecutor(clusterClient);
+               final SessionContext session = new 
SessionContext("test-session", new Environment());
+
+               try {
+                       executor.useDatabase(session, "nonexistingdb");
+               } catch (SqlExecutionException e) {
+                       // expected
+               }
+       }
+
+       @Test
+       public void testUseNonExistingCatalog() throws Exception {
+               final Executor executor = createDefaultExecutor(clusterClient);
+               final SessionContext session = new 
SessionContext("test-session", new Environment());
+
+               try {
+                       executor.useCatalog(session, "nonexistingcatalog");
+               } catch (SqlExecutionException e) {
 
 Review comment:
   shall we just assert the exception is expected instead of try-catch-ignore?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to