You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Sebastian Nagel (JIRA)" <ji...@apache.org> on 2014/07/09 17:51:04 UTC

[jira] [Commented] (NUTCH-1813) Use \u.... escapes for non-ASCII chars in TestURLUtil

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

Sebastian Nagel commented on NUTCH-1813:
----------------------------------------

Hi [~vschiavoni], I'm not able to reproduce it. Is the Java file (src/test/org/apache/nutch/util/TestURLUtil.java) in the right encoding (utf-8).
We should use \u.... escapes for non-ASCII characters to prevent such errors. Thanks!

> Use \u.... escapes for non-ASCII chars in TestURLUtil
> -----------------------------------------------------
>
>                 Key: NUTCH-1813
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1813
>             Project: Nutch
>          Issue Type: Bug
>         Environment: java version "1.7.0_51"
> Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
> Mac OSX 10.9.4, MacBookPro 64 Bit.
>            Reporter: Valerio Schiavoni
>
> To reproduce, git clone the latest 2.x branch and execute the TestURLUtil tests.
> There are 4 test failures and 1 error.
> Failing tests:
> testToUNICODE:org.junit.ComparisonFailure: expected:<http://www.[��]evir.com> but was:<http://www.[ç]evir.com>
> 	at org.junit.Assert.assertEquals(Assert.java:115)
> 	at org.junit.Assert.assertEquals(Assert.java:144)
> 	at org.apache.nutch.util.TestURLUtil.testToUNICODE(TestURLUtil.java:263)
> testChooseRepr:org.junit.ComparisonFailure: expected:<http://www.[b].com> but was:<http://www.[a].com>
> 	at org.junit.Assert.assertEquals(Assert.java:115)
> 	at org.junit.Assert.assertEquals(Assert.java:144)
> 	at org.apache.nutch.util.TestURLUtil.testChooseRepr(TestURLUtil.java:179)
> testGetDomainName:
> org.junit.ComparisonFailure: expected:<[apache.]org> but was:<[]org>
> 	at org.junit.Assert.assertEquals(Assert.java:115)
> 	at org.junit.Assert.assertEquals(Assert.java:144)
> 	at org.apache.nutch.util.TestURLUtil.testGetDomainName(TestURLUtil.java:35)
> testToASCII:
> java.lang.AssertionError: expected:<http://www.xn--evir-zoa.com> but was:<null>
> 	at org.junit.Assert.fail(Assert.java:88)
> 	at org.junit.Assert.failNotEquals(Assert.java:743)
> 	at org.junit.Assert.assertEquals(Assert.java:118)
> 	at org.junit.Assert.assertEquals(Assert.java:144)
> 	at org.apache.nutch.util.TestURLUtil.testToASCII(TestURLUtil.java:273)



--
This message was sent by Atlassian JIRA
(v6.2#6252)