kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject kylin git commit: KYLIN-1540 REST API for deleting segment, fix UT
Date Tue, 29 Mar 2016 05:55:53 GMT
Repository: kylin
Updated Branches:
  refs/heads/1.3.x ed56aca0e -> 72a247713


KYLIN-1540 REST API for deleting segment, fix UT

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

Branch: refs/heads/1.3.x
Commit: 72a247713fa08bef378cf6a53dd75b746cd467fa
Parents: ed56aca
Author: shaofengshi <shaofengshi@apache.org>
Authored: Tue Mar 29 13:54:27 2016 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Tue Mar 29 13:54:27 2016 +0800

----------------------------------------------------------------------
 .../kylin/rest/controller/CubeControllerTest.java       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/72a24771/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java
b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java
index e939a54..5f1c720 100644
--- a/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java
+++ b/server/src/test/java/org/apache/kylin/rest/controller/CubeControllerTest.java
@@ -19,11 +19,13 @@
 package org.apache.kylin.rest.controller;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.apache.kylin.common.util.JsonUtil;
 import org.apache.kylin.cube.CubeInstance;
+import org.apache.kylin.cube.CubeSegment;
 import org.apache.kylin.cube.model.CubeDesc;
 import org.apache.kylin.cube.model.RowKeyColDesc;
 import org.apache.kylin.metadata.model.DataModelDesc;
@@ -262,12 +264,20 @@ public class CubeControllerTest extends ServiceTestBase {
         Assert.assertNotNull(cubes);
 
         int segNumber = cubeService.getCubeManager().getCube(cubeName).getSegments().size();
+        String segmentName = "19691231160000_20131112000000";
+        CubeSegment segment = cubeService.getCubeManager().getCube(cubeName).getSegment(segmentName,
null);
 
-        cubeController.deleteSegment(cubeName, "19691231160000_20131112000000");
+        cubeController.deleteSegment(cubeName, segmentName);
 
         int newSegNumber = cubeService.getCubeManager().getCube(cubeName).getSegments().size();
 
         Assert.assertTrue(segNumber == newSegNumber + 1);
+
+        // addback the segment
+        CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
+        cube.getSegments().add(segment);
+        Collections.sort(cube.getSegments());
+        cubeService.getCubeManager().updateCube(cube);
     }
 
 }


Mime
View raw message