You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/06/18 01:25:44 UTC

[3/3] kylin git commit: KYLIN-1766 fix RowKeyDecoderTest

KYLIN-1766 fix RowKeyDecoderTest


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a82662bc
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a82662bc
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a82662bc

Branch: refs/heads/master
Commit: a82662bcd1b1fd8cb476e07e6b679d89a1337a96
Parents: 5ee5a3d
Author: Li Yang <li...@apache.org>
Authored: Thu Jun 16 17:49:09 2016 +0800
Committer: Yang Li <li...@apache.org>
Committed: Sat Jun 18 09:06:44 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/cube/kv/RowKeyDecoderTest.java     | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/a82662bc/core-cube/src/test/java/org/apache/kylin/cube/kv/RowKeyDecoderTest.java
----------------------------------------------------------------------
diff --git a/core-cube/src/test/java/org/apache/kylin/cube/kv/RowKeyDecoderTest.java b/core-cube/src/test/java/org/apache/kylin/cube/kv/RowKeyDecoderTest.java
index 43498d3..7b8000c 100644
--- a/core-cube/src/test/java/org/apache/kylin/cube/kv/RowKeyDecoderTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/cube/kv/RowKeyDecoderTest.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.util.List;
 
 import org.apache.kylin.common.util.Bytes;
+import org.apache.kylin.common.util.DateFormat;
 import org.apache.kylin.common.util.LocalFileMetadataTestCase;
 import org.apache.kylin.cube.CubeInstance;
 import org.apache.kylin.cube.CubeManager;
@@ -57,7 +58,7 @@ public class RowKeyDecoderTest extends LocalFileMetadataTestCase {
 
         rowKeyDecoder.decode(key);
         List<String> values = rowKeyDecoder.getValues();
-        assertEquals("[2012-12-15, 11848, Health & Beauty, Fragrances, Women, FP-GTC, 0, 15]", values.toString());
+        assertEquals("[" + millis("2012-12-15") + ", 11848, Health & Beauty, Fragrances, Women, FP-GTC, 0, 15]", values.toString());
     }
 
     @Test
@@ -70,7 +71,7 @@ public class RowKeyDecoderTest extends LocalFileMetadataTestCase {
 
         rowKeyDecoder.decode(key);
         List<String> values = rowKeyDecoder.getValues();
-        assertEquals("[10000000, 2012-01-02, 20213, Collectibles, Postcards, US StateCities & Towns, ABIN, 0, -99]", values.toString());
+        assertEquals("[10000000, " + millis("2012-01-02") + ", 20213, Collectibles, Postcards, US StateCities & Towns, ABIN, 0, -99]", values.toString());
     }
 
     @Test
@@ -98,6 +99,11 @@ public class RowKeyDecoderTest extends LocalFileMetadataTestCase {
         RowKeyDecoder rowKeyDecoder = new RowKeyDecoder(cube.getFirstSegment());
         rowKeyDecoder.decode(encodedKey);
         List<String> values = rowKeyDecoder.getValues();
-        assertEquals("[2012-12-15, 11848, Health & Beauty, Fragrances, Women, \u520a\u767b\u683c\u5f0f, 0, 15]", values.toString());
+        assertEquals("[" + millis("2012-12-15") + ", 11848, Health & Beauty, Fragrances, Women, \u520a\u767b\u683c\u5f0f, 0, 15]", values.toString());
     }
+
+    private String millis(String dateStr) {
+        return String.valueOf(DateFormat.stringToMillis(dateStr));
+    }
+
 }