Test udpate

This commit is contained in:
Himadri Singh 2014-02-13 19:10:08 +05:30
parent c2604657ed
commit 6e0590f97b
2 changed files with 18 additions and 1 deletions

View File

@ -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());
}
}

View File

@ -95,6 +95,12 @@ public class DruidCoordinatorTest
{
return null;
}
@Override
public String getCoordinatorBalancerStrategy()
{
return null;
}
},
new ZkPathsConfig(){