phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/6] phoenix git commit: PHOENIX-3557 Provide a good error message when an invalid test pattern was provided
Date Fri, 06 Jan 2017 05:06:12 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/d79943a9
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d79943a9
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d79943a9

Branch: refs/heads/4.x-HBase-1.1
Commit: d79943a9d19320317f76830ec67bd1d2b67b026b
Parents: 2e7a8c6
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 23:48:55 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/d79943a9/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