X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fthreadpool-config-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fthreadpool%2Ffixed%2FTestingFixedThreadPoolModule.java;h=bd57fe98f6efa976f43aef4140af64429db763b8;hp=00be5d8118983832c0b72543dbded3ac61f1435d;hb=3f130bc99b874e917fe397c4835f22229f60842a;hpb=d542617f3486541cf9937009fb6aa1e3f2c9f0e2 diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java index 00be5d8118..bd57fe98f6 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java @@ -1,30 +1,35 @@ -package org.opendaylight.controller.config.threadpool.fixed; - -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -import java.util.concurrent.ExecutorService; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper; -import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface; - -public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module { - - public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { - super(old, id); - } - - @Override - protected AutoCloseable prepareMockedInstance() throws Exception { - FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class); - doNothing().when(pool).close(); - doReturn(mock(ExecutorService.class)).when(pool).getExecutor(); - return pool; - } - -} +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.config.threadpool.fixed; + +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import java.util.concurrent.ExecutorService; +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper; +import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface; + +public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module { + + public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { + super(old, id); + } + + @Override + protected AutoCloseable prepareMockedInstance() throws Exception { + FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class); + doNothing().when(pool).close(); + doReturn(mock(ExecutorService.class)).when(pool).getExecutor(); + return pool; + } +}