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

Sebastian Nagel edited comment on NUTCH-2228 at 2/22/16 8:38 PM:
-----------------------------------------------------------------

The name of the failing test "testInvalidPatterns" indicates that it is 
intended to check whether syntax errors in regular expressions are properly 
caught. A solution could be to replace {{\h}} by, e.g., {{\s+**}} which will be 
hardly become valid in the next Java version. The error is properly caught and 
reported in the logs:
{noformat}
2016-02-22 21:35:42,067 ERROR replace.FieldReplacer 
(FieldReplacer.java:<init>(97)) - Pattern this\s+**plugin for field 
metatag.description failed to compile: java.util.regex.PatternSyntaxException: 
Dangling meta character '*' near index 7
this\s+**plugin
       ^
{noformat}



was (Author: wastl-nagel):
The name of the failing test "testInvalidPatterns" indicates that it is 
intended to check whether syntax errors in regular expressions are properly 
caught. A solution could be to replace {\h} by, e.g., {\s+**} which will be 
hardly become valid in the next Java version. The error is properly caught and 
reported in the logs:
{noformat}
2016-02-22 21:35:42,067 ERROR replace.FieldReplacer 
(FieldReplacer.java:<init>(97)) - Pattern this\s+**plugin for field 
metatag.description failed to compile: java.util.regex.PatternSyntaxException: 
Dangling meta character '*' near index 7
this\s+**plugin
       ^
{noformat}


> index-replace unit test fails
> -----------------------------
>
>                 Key: NUTCH-2228
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2228
>             Project: Nutch
>          Issue Type: Bug
>          Components: indexer
>    Affects Versions: 1.11
>            Reporter: Markus Jelsma
>            Priority: Blocker
>             Fix For: 1.12
>
>
> {code}
> ------------- Standard Error -----------------
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/markus/projects/apache/nutch/trunk/build/test/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/home/markus/projects/apache/nutch/trunk/build/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
> ------------- ---------------- ---------------
> Testcase: testGlobalAndUrlNotMatchesPattern took 1.052 sec
> Testcase: testGlobalReplacement took 0.149 sec
> Testcase: testReplacementsWithFlags took 0.105 sec
> Testcase: testUrlMatchesPattern took 0.116 sec
> Testcase: testReplacementsDifferentTarget took 0.099 sec
> Testcase: testReplacementsRunInSpecifedOrder took 0.1 sec
> Testcase: testInvalidPatterns took 0.078 sec
>         FAILED
> expected:<With this []plugin, I control th...> but was:<With this [awesome 
> ]plugin, I control th...>
> junit.framework.AssertionFailedError: expected:<With this []plugin, I control 
> th...> but was:<With this [awesome ]plugin, I control th...>
>         at 
> org.apache.nutch.indexer.replace.TestIndexReplace.testInvalidPatterns(TestIndexReplace.java:203)
> Testcase: testGlobalAndUrlMatchesPattern took 0.079 sec
> Testcase: testUrlNotMatchesPattern took 0.06 sec
> Testcase: testPropertyParse took 0.03 sec
> {code}
> Does the initial committer know what the outcome of the test should be?



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

Reply via email to