From cd1e7cc65d1184628e942fb8714f6468ff43290c Mon Sep 17 00:00:00 2001 From: Himadri Singh Date: Thu, 19 Dec 2013 12:01:18 +0530 Subject: [PATCH] Updated test --- .../io/druid/server/StatusResourceTest.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/server/src/test/java/io/druid/server/StatusResourceTest.java b/server/src/test/java/io/druid/server/StatusResourceTest.java index 380afcdab9b..2079c36b74d 100644 --- a/server/src/test/java/io/druid/server/StatusResourceTest.java +++ b/server/src/test/java/io/druid/server/StatusResourceTest.java @@ -19,8 +19,6 @@ package io.druid.server; -import static io.druid.server.StatusResource.ModuleVersion; - import com.google.inject.Injector; import io.druid.initialization.DruidModule; import io.druid.initialization.Initialization; @@ -30,6 +28,9 @@ import org.junit.Test; import java.util.Collection; import java.util.List; +import java.util.Set; + +import static io.druid.server.StatusResource.ModuleVersion; /** */ @@ -49,7 +50,10 @@ public class StatusResourceTest List statusResourceModuleList; statusResourceModuleList = resource.doGet().getModules(); - Assert.assertEquals("No Modules should be loaded currently!", statusResourceModuleList.size(), 0); + Assert.assertEquals( + "No Modules should be loaded currently! " + statusResourceModuleList, + statusResourceModuleList.size(), 0 + ); Collection modules = loadTestModule(); statusResourceModuleList = resource.doGet().getModules(); @@ -65,8 +69,17 @@ public class StatusResourceTest contains = Boolean.TRUE; } } - Assert.assertTrue("Status resource should contains module " + moduleName, contains); + Assert.assertTrue("Status resource should contain module " + moduleName, contains); } + + /* + * StatusResource only uses Initialization.getLoadedModules + */ + for (int i = 0; i < 5; i++) { + Set loadedModules = Initialization.getLoadedModules(DruidModule.class); + Assert.assertEquals("Set from loaded module should be same!", loadedModules, modules); + } + } }