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/16 09:49:20 UTC
kylin git commit: KYLIN-1766 fix RowKeyDecoderTest
Repository: kylin
Updated Branches:
refs/heads/KYLIN-1766 86a8bc1e6 -> 980c8c646
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/980c8c64
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/980c8c64
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/980c8c64
Branch: refs/heads/KYLIN-1766
Commit: 980c8c646c5afa842298ff73483dd979955742b8
Parents: 86a8bc1
Author: Li Yang <li...@apache.org>
Authored: Thu Jun 16 17:49:09 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Thu Jun 16 17:49:09 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/980c8c64/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));
+ }
+
}