[ 
https://issues.apache.org/jira/browse/DRILL-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461307#comment-16461307
 ] 

ASF GitHub Bot commented on DRILL-6272:
---------------------------------------

vrozov commented on a change in pull request #1225: DRILL-6272: Refactor 
dynamic UDFs and function initializer tests to g…
URL: https://github.com/apache/drill/pull/1225#discussion_r185567423
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTTAS.java
 ##########
 @@ -164,121 +165,93 @@ public void 
testResolveTemporaryTableWithPartialSchema() throws Exception {
   @Test
   public void testPartitionByWithTemporaryTables() throws Exception {
     String temporaryTableName = "temporary_table_with_partitions";
-    mockRandomUUID(UUID.nameUUIDFromBytes(temporaryTableName.getBytes()));
+    cleanSessionDirectory();
     test("create TEMPORARY table %s partition by (c1) as select * from (" +
         "select 'A' as c1 from (values(1)) union all select 'B' as c1 from 
(values(1))) t", temporaryTableName);
-    checkPermission(temporaryTableName);
+    checkPermission();
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreationOutsideOfDefaultTemporaryWorkspace() throws 
Exception {
-    try {
-      String temporaryTableName = 
"temporary_table_outside_of_default_workspace";
-      test("create TEMPORARY table %s.%s as select 'A' as c1 from 
(values(1))", temp2_schema, temporaryTableName);
-    } catch (UserRemoteException e) {
-      assertThat(e.getMessage(), containsString(String.format(
-          "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
-              "outside of default temporary workspace [%s].", 
DFS_TMP_SCHEMA)));
-      throw e;
-    }
+    String temporaryTableName = "temporary_table_outside_of_default_workspace";
+
+    expectUserRemoteExceptionWithMessage(String.format(
+      "VALIDATION ERROR: Temporary tables are not allowed to be created / 
dropped " +
+        "outside of default temporary workspace [%s].", DFS_TMP_SCHEMA));
+
+    test("create TEMPORARY table %s.%s as select 'A' as c1 from (values(1))", 
temp2_schema, temporaryTableName);
   }
 
-  @Test(expected = UserRemoteException.class)
+  @Test
   public void testCreateWhenTemporaryTableExistsWithoutSchema() throws 
Exception {
     String temporaryTableName = "temporary_table_exists_without_schema";
-    try {
-      test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-      test("create TEMPORARY table %s as select 'A' as c1 from (values(1))", 
temporaryTableName);
-    } catch (UserRemoteException e) {
-      assertThat(e.getMessage(), containsString(String.format(
-         "VALIDATION ERROR: A table or view with given name [%s]" +
-             " already exists in schema [%s]", temporaryTableName, 
DFS_TMP_SCHEMA)));
-      throw e;
-    }
+
+    expectUserRemoteExceptionWithTableExistsMessage(temporaryTableName, 
DFS_TMP_SCHEMA);
 
 Review comment:
   Move it between `test` calls. My understanding the first one should succeed 
without exception.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Remove binary jars files from source distribution
> -------------------------------------------------
>
>                 Key: DRILL-6272
>                 URL: https://issues.apache.org/jira/browse/DRILL-6272
>             Project: Apache Drill
>          Issue Type: Task
>            Reporter: Vlad Rozov
>            Assignee: Arina Ielchiieva
>            Priority: Critical
>             Fix For: 1.14.0
>
>
> Per [~vrozov] the source distribution contains binary jar files under 
> exec/java-exec/src/test/resources/jars



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to