[
https://issues.apache.org/jira/browse/HADOOP-11165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Chu updated HADOOP-11165:
---------------------------------
Attachment: HADOOP-11165.1.patch
Attaching a fix to {{TestUTF8}}.
{{new String(..., "UTF-8")}} in JDK8 now correctly corresponds to decoding in
_UTF-8_, instead of _Modified UTF-8_ which the {{DataInput}} and {{DataOutput}}
interfaces use.
Made the following changes:
* in _testGetBytes_, we now convert the Modified UTF8 formatted bytes to String
properly using DataInput's {{readUTF}}.
* Remove one test from _testIO_ that uses the {{new String(..., "UTF-8")}} to
decode UTF-8 because that does not read modified UTF8 anymore in JDK8.
I built + ran successfully using JDK6/7/8.
> TestUTF8 fails when run against java 8
> --------------------------------------
>
> Key: HADOOP-11165
> URL: https://issues.apache.org/jira/browse/HADOOP-11165
> Project: Hadoop Common
> Issue Type: Test
> Reporter: Ted Yu
> Assignee: Stephen Chu
> Priority: Minor
> Attachments: HADOOP-11165.1.patch
>
>
> Using jdk1.8.0_20 , I got:
> {code}
> testGetBytes(org.apache.hadoop.io.TestUTF8) Time elapsed: 0.007 sec <<<
> FAILURE!
> junit.framework.ComparisonFailure:
> expected:<쑼ь⣄鬘㟻햫紖燺[?炀⑰풸낓⨵ἲꬌホ쭷㛕曬䟊⁍䴥䳠領蟭뱻宭竕昚鍳튇ꊕ혶齲쏈㠮胨䩦隼䍻킿喝벁ࢼ듿饭玳Մ剌䒤?䳛슟녚沖᯳?訨
> 牙⍖?䎠旘薑春觀葝礫⁑ﻱ⣽゚굿뒦ݦ︀偆?]古絥萟浐> but
> was:<쑼ь⣄鬘㟻햫紖燺[�炀⑰풸낓⨵ἲꬌホ쭷㛕曬䟊⁍䴥䳠領蟭뱻宭竕昚鍳튇ꊕ혶齲쏈㠮胨䩦隼䍻킿喝벁ࢼ듿饭玳Մ剌䒤�䳛슟녚᯳�訨牙⍖�䎠旘薑春觀葝礫⁑ﻱ⣽゚굿뒦ݦ︀偆�]古絥萟浐>
> at junit.framework.Assert.assertEquals(Assert.java:100)
> at junit.framework.Assert.assertEquals(Assert.java:107)
> at junit.framework.TestCase.assertEquals(TestCase.java:269)
> at org.apache.hadoop.io.TestUTF8.testGetBytes(TestUTF8.java:58)
> testIO(org.apache.hadoop.io.TestUTF8) Time elapsed: 0.002 sec <<< FAILURE!
> junit.framework.ComparisonFailure:
> expected:<...ᨍ⁖粩⧬车﹂脖朷䝄懒댵突疼資⍣眠畠忁[?]䪐ゑ鬍鍅遻ꈸ釡> but
> was:<...ᨍ⁖粩⧬车﹂脖朷䝄懒댵突疼資⍣眠畠忁[�]䪐ゑ鬍鍅遻>ꈸ釡>
> at junit.framework.Assert.assertEquals(Assert.java:100)
> at junit.framework.Assert.assertEquals(Assert.java:107)
> at junit.framework.TestCase.assertEquals(TestCase.java:269)
> at org.apache.hadoop.io.TestUTF8.testIO(TestUTF8.java:86)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)