From 187126dd4be89f8657d38b140652e829d0e0d8a8 Mon Sep 17 00:00:00 2001 From: fjy Date: Thu, 4 Dec 2014 10:49:36 -0800 Subject: [PATCH] fix broken unit tests --- .../client/CachingClusteredClientTest.java | 12 +++++++ .../druid/client/CachingQueryRunnerTest.java | 33 ++++++++++++++++--- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/server/src/test/java/io/druid/client/CachingClusteredClientTest.java b/server/src/test/java/io/druid/client/CachingClusteredClientTest.java index 7e17d4ac65e..4220de989d3 100644 --- a/server/src/test/java/io/druid/client/CachingClusteredClientTest.java +++ b/server/src/test/java/io/druid/client/CachingClusteredClientTest.java @@ -1902,6 +1902,18 @@ public class CachingClusteredClientTest jsonMapper, new CacheConfig() { + @Override + public boolean isPopulateCache() + { + return true; + } + + @Override + public boolean isUseCache() + { + return true; + } + @Override public boolean isQueryCacheable(Query query) { diff --git a/server/src/test/java/io/druid/client/CachingQueryRunnerTest.java b/server/src/test/java/io/druid/client/CachingQueryRunnerTest.java index 4975e0b5f01..6252e9b7bcb 100644 --- a/server/src/test/java/io/druid/client/CachingQueryRunnerTest.java +++ b/server/src/test/java/io/druid/client/CachingQueryRunnerTest.java @@ -82,7 +82,7 @@ public class CachingQueryRunnerTest @Test public void testCloseAndPopulate() throws Exception { - Iterable> expectedRes = makeTopNResults(false,objects); + Iterable> expectedRes = makeTopNResults(false, objects); final TopNQueryBuilder builder = new TopNQueryBuilder() .dataSource("ds") .dimension("top_dim") @@ -130,7 +130,19 @@ public class CachingQueryRunnerTest } }, new CacheConfig() + { + @Override + public boolean isPopulateCache() + { + return true; + } + @Override + public boolean isUseCache() + { + return true; + } + } ); TopNQuery query = builder.build(); @@ -141,7 +153,7 @@ public class CachingQueryRunnerTest cacheStrategy.computeCacheKey(query) ); - HashMap context = new HashMap(); + HashMap context = new HashMap(); Sequence res = runner.run(query, context); // base sequence is not closed yet Assert.assertFalse("sequence must not be closed", closable.isClosed()); @@ -220,9 +232,22 @@ public class CachingQueryRunnerTest } }, new CacheConfig() + { + @Override + public boolean isPopulateCache() + { + return true; + } + + @Override + public boolean isUseCache() + { + return true; + } + } ); - HashMap context = new HashMap(); + HashMap context = new HashMap(); List results = Sequences.toList(runner.run(query, context), new ArrayList()); Assert.assertEquals(expectedResults, results); } @@ -252,7 +277,7 @@ public class CachingQueryRunnerTest "rows", rows, "imps", imps, "impers", imps - ) + ) ); } else { values.add(