You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Andrew Purtell (JIRA)" <ji...@apache.org> on 2015/04/17 06:10:58 UTC

[jira] [Commented] (PHOENIX-1874) Add tests for both JONI and Java regex usage

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

Andrew Purtell commented on PHOENIX-1874:
-----------------------------------------

If you're interested in some regexes to test, OpenJDK includes some test cases here that could be useful:

http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/a942e0b52477/test/java/util/regex/
http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/a942e0b52477/test/java/util/regex/TestCases.txt
http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/a942e0b52477/test/java/util/regex/SupplementaryTestCases.txt

Not all of them will pass with both Java Pattern or JONI regex. I extracted a tiny subset for an HBase unit test as a sanity check as https://github.com/apache/hbase/blob/master/hbase-server/src/test/java/org/apache/hadoop/hbase/filter/TestRegexComparator.java 



> Add tests for both JONI and Java regex usage
> --------------------------------------------
>
>                 Key: PHOENIX-1874
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1874
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Shuxiong Ye
>             Fix For: 5.0.0, 4.4.0
>
>
> We should have tests that use both the JONI regex library and the Java regex library. One easy way would be to do the following:
> - Pull out the regex related tests from VariableLengthPKIT into a new abstract RegExIT test class
> - Derive two concrete class from RegExIT: JoniRegExIT and JavaRegExIT
> - Set QueryServices.USE_BYTE_BASED_REGEX_ATTRIB to true in one and false in the other. You'd do this by each having a static doSetup() method like this:
> {code}
>     @BeforeClass
>     @Shadower(classBeingShadowed = BaseHBaseManagedTimeIT.class)
>     public static void doSetup() throws Exception {
>         Map<String,String> props = Maps.newHashMapWithExpectedSize(3);            
>         props.put(QueryServices.USE_BYTE_BASED_REGEX_ATTRIB,
>             Boolean.toString(true));
>         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)