phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject [11/26] phoenix git commit: PHOENIX-3557 Provide a good error message when an invalid test pattern was provided
Date Fri, 27 Jan 2017 01:18:55 GMT
PHOENIX-3557 Provide a good error message when an invalid test pattern was provided


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

Branch: refs/heads/calcite
Commit: e4c6f5cde940931bb4be82c7aa7959de58857ad8
Parents: a0e5efc
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 5 13:37:59 2017 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jan 5 22:19:13 2017 -0500

----------------------------------------------------------------------
 .../org/apache/phoenix/end2end/End2EndTestDriver.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e4c6f5cd/phoenix-core/src/it/java/org/apache/phoenix/end2end/End2EndTestDriver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/End2EndTestDriver.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/End2EndTestDriver.java
index a505c1e..feb506f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/End2EndTestDriver.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/End2EndTestDriver.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.hadoop.hbase.ClassFinder;
@@ -38,6 +39,8 @@ import org.junit.runner.Description;
 import org.junit.runner.JUnitCore;
 import org.junit.runner.Result;
 import org.junit.runner.notification.Failure;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class drives the End2End tests suite execution against an
@@ -45,6 +48,7 @@ import org.junit.runner.notification.Failure;
  */
 public class End2EndTestDriver extends AbstractHBaseTool {
     
+    private static final Logger LOG = LoggerFactory.getLogger(End2EndTestDriver.class);
     private static final String SHORT_REGEX_ARG = "r";
     private static final String SKIP_TESTS = "n";
     
@@ -73,7 +77,13 @@ public class End2EndTestDriver extends AbstractHBaseTool {
       }
 
       public void setPattern(String pattern) {
-        testFilterRe = Pattern.compile(pattern);
+        try {
+          testFilterRe = Pattern.compile(pattern);
+        } catch (PatternSyntaxException e) {
+          LOG.error("Failed to find tests using pattern '" + pattern
+              + "'. Is it a valid Java regular expression?", e);
+          throw e;
+        }
       }
 
       @Override


Mime
View raw message