drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [6/9] drill git commit: DRILL-5297: when the generated plan mismatches, PlanTest print the generated plan along with expected pattern
Date Mon, 03 Apr 2017 05:12:06 GMT
DRILL-5297: when the generated plan mismatches, PlanTest print the generated plan along with
expected pattern

close #798


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/4c7e3a19
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/4c7e3a19
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/4c7e3a19

Branch: refs/heads/master
Commit: 4c7e3a194ca8055980420f201f8df4ea0f9e4cfc
Parents: 152c87a
Author: chunhui-shi <cshi@maprtech.com>
Authored: Fri Mar 24 18:40:15 2017 -0700
Committer: Jinfeng Ni <jni@apache.org>
Committed: Fri Mar 31 15:32:34 2017 -0700

----------------------------------------------------------------------
 exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java | 4 ++--
 .../java/org/apache/drill/TestPlanVerificationUtilities.java    | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/4c7e3a19/exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java b/exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java
index 5d1cdbf..e422a77 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/PlanTestBase.java
@@ -86,7 +86,7 @@ public class PlanTestBase extends BaseTestQuery {
       for (final String s : expectedPatterns) {
         final Pattern p = Pattern.compile(s);
         final Matcher m = p.matcher(plan);
-        assertTrue(EXPECTED_NOT_FOUND + s, m.find());
+        assertTrue(EXPECTED_NOT_FOUND + s +"\n" + plan, m.find());
       }
     }
 
@@ -95,7 +95,7 @@ public class PlanTestBase extends BaseTestQuery {
       for (final String s : excludedPatterns) {
         final Pattern p = Pattern.compile(s);
         final Matcher m = p.matcher(plan);
-        assertFalse(UNEXPECTED_FOUND + s, m.find());
+        assertFalse(UNEXPECTED_FOUND + s +"\n" + plan, m.find());
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/4c7e3a19/exec/java-exec/src/test/java/org/apache/drill/TestPlanVerificationUtilities.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestPlanVerificationUtilities.java
b/exec/java-exec/src/test/java/org/apache/drill/TestPlanVerificationUtilities.java
index 1d8ebc7..4accb36 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestPlanVerificationUtilities.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestPlanVerificationUtilities.java
@@ -20,6 +20,7 @@ package org.apache.drill;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class TestPlanVerificationUtilities extends PlanTestBase {
 
@@ -41,14 +42,14 @@ public class TestPlanVerificationUtilities extends PlanTestBase {
       testPlanMatchingPatterns(query,
           new String[] {expectedPattern}, new String[] {expectedPattern});
     } catch (AssertionError ex) {
-      assertEquals(ex.getMessage(), UNEXPECTED_FOUND + expectedPattern);
+      assertTrue(ex.getMessage().contains(UNEXPECTED_FOUND));
     }
 
     try {
       testPlanMatchingPatterns(query,
           new String[] {excludedPattern}, new String[] {excludedPattern});
     } catch (AssertionError ex) {
-      assertEquals(ex.getMessage(), EXPECTED_NOT_FOUND + excludedPattern);
+      assertTrue(ex.getMessage().contains(EXPECTED_NOT_FOUND));
     }
   }
 }


Mime
View raw message