From 11599e405adc0e2e94ae1ffcd8298a7023524fdb Mon Sep 17 00:00:00 2001 From: wangxianbin1987 Date: Tue, 19 Apr 2016 10:04:02 +0800 Subject: [PATCH] KYLIN-1596 UT fail, due to String encoding CharsetEncoder mismatch Signed-off-by: wangxianbin1987 --- .../org/apache/kylin/invertedindex/InvertedIndexLocalTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invertedindex/src/test/java/org/apache/kylin/invertedindex/InvertedIndexLocalTest.java b/invertedindex/src/test/java/org/apache/kylin/invertedindex/InvertedIndexLocalTest.java index 4b74fdd..5aff1b0 100644 --- a/invertedindex/src/test/java/org/apache/kylin/invertedindex/InvertedIndexLocalTest.java +++ b/invertedindex/src/test/java/org/apache/kylin/invertedindex/InvertedIndexLocalTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; @@ -171,7 +172,11 @@ public class InvertedIndexLocalTest extends LocalFileMetadataTestCase { @Nullable @Override public byte[] apply(String input) { - return input.getBytes(); + try { + return input.getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } } }))); } -- 2.6.3.windows.1