From 6e0590f97b81648ed48f1e3a1c054dc361b40bc2 Mon Sep 17 00:00:00 2001 From: Himadri Singh Date: Thu, 13 Feb 2014 19:10:08 +0530 Subject: [PATCH] Test udpate --- .../coordination/CostBalancerStrategyTest.java | 13 ++++++++++++- .../server/coordinator/DruidCoordinatorTest.java | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/io/druid/server/coordination/CostBalancerStrategyTest.java b/server/src/test/java/io/druid/server/coordination/CostBalancerStrategyTest.java index c4b1306be19..0bd1cbf7748 100644 --- a/server/src/test/java/io/druid/server/coordination/CostBalancerStrategyTest.java +++ b/server/src/test/java/io/druid/server/coordination/CostBalancerStrategyTest.java @@ -74,7 +74,7 @@ public class CostBalancerStrategyTest } @Test - public void test() throws InterruptedException { + public void testCostBalancerStrategy() throws InterruptedException { DataSegment segment = getSegment(1000); CostBalancerStrategy strategy = new CostBalancerStrategy(DateTime.now(DateTimeZone.UTC)); @@ -83,4 +83,15 @@ public class CostBalancerStrategyTest Assert.assertEquals("Best Server should be BEST_SERVER", "BEST_SERVER", holder.getServer().getName()); } + @Test + public void testCostBalancerMultithreadStrategy() throws InterruptedException { + DataSegment segment = getSegment(1000); + + CostBalancerStrategy strategy = new CostBalancerStrategy(DateTime.now(DateTimeZone.UTC)); + ServerHolder holder = strategy.findNewSegmentHomeReplicator(segment, serverHolderList); + Assert.assertNotNull("Should be able to find a place for new segment!!", holder); + Assert.assertEquals("Best Server should be BEST_SERVER", "BEST_SERVER", holder.getServer().getName()); + } + + } diff --git a/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java b/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java index 58323faa863..74ea71ad105 100644 --- a/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java +++ b/server/src/test/java/io/druid/server/coordinator/DruidCoordinatorTest.java @@ -95,6 +95,12 @@ public class DruidCoordinatorTest { return null; } + + @Override + public String getCoordinatorBalancerStrategy() + { + return null; + } }, new ZkPathsConfig(){