diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-01-05 12:25:19 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-01-05 12:25:19 +0000 |
commit | 2d4680b800d12308fde55235c51c11a7421006a0 (patch) | |
tree | d341ee7ea557d4e1d5914c0323dafcf5c89a830c /clustercontroller-apps/src/test/java | |
parent | d13d3171cd3faceb129642d26b2dc5466438514e (diff) |
use LoggingRequestHandler.Context in constructors
* this implicitly wires in a Metric, allowing handler invocations
to be measured in the ThreadedRequestHandler superclass.
Diffstat (limited to 'clustercontroller-apps/src/test/java')
2 files changed, 2 insertions, 8 deletions
diff --git a/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2HandlerTest.java b/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2HandlerTest.java index 524aba1398b..dbc7834a601 100644 --- a/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2HandlerTest.java +++ b/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2HandlerTest.java @@ -2,7 +2,6 @@ package com.yahoo.vespa.clustercontroller.apps.clustercontroller; import com.yahoo.cloud.config.ClusterInfoConfig; -import com.yahoo.container.logging.AccessLog; import com.yahoo.vespa.clustercontroller.core.restapiv2.ClusterControllerStateRestAPI; import junit.framework.TestCase; @@ -15,13 +14,11 @@ import java.util.concurrent.TimeUnit; public class StateRestApiV2HandlerTest extends TestCase { public void testNoMatchingSockets() { - ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 100, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(1000)); ClusterController controller = new ClusterController(); ClusterInfoConfig config = new ClusterInfoConfig( new ClusterInfoConfig.Builder().clusterId("cluster-id").nodeCount(1)); ClusterInfoConfig.Builder clusterConfig = new ClusterInfoConfig.Builder(); - new StateRestApiV2Handler(executor, controller, config, AccessLog.voidAccessLog()); - executor.shutdown(); + new StateRestApiV2Handler(controller, config, StateRestApiV2Handler.testOnlyContext()); } public void testMappingOfIndexToClusterControllers() { diff --git a/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandlerTest.java b/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandlerTest.java index 66cb477e793..49e0a637368 100644 --- a/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandlerTest.java +++ b/clustercontroller-apps/src/test/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandlerTest.java @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.apps.clustercontroller; -import com.yahoo.container.logging.AccessLog; import junit.framework.TestCase; import java.util.concurrent.ArrayBlockingQueue; @@ -12,9 +11,7 @@ public class StatusHandlerTest extends TestCase { public void testSimple() { ClusterController controller = new ClusterController(); - ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 100, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(1000)); - StatusHandler handler = new StatusHandler(controller, executor, AccessLog.voidAccessLog()); - executor.shutdown(); + StatusHandler handler = new StatusHandler(controller, StatusHandler.testOnlyContext()); } } |