2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.threadpool.fixed;
10 import static org.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.doReturn;
12 import static org.mockito.Mockito.mock;
14 import java.util.concurrent.ExecutorService;
15 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
16 import org.opendaylight.controller.config.api.ModuleIdentifier;
17 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
18 import org.opendaylight.controller.config.spi.Module;
19 import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;
20 import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface;
22 public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module {
24 public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
29 protected AutoCloseable prepareMockedInstance() throws Exception {
30 FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class);
31 doNothing().when(pool).close();
32 doReturn(mock(ExecutorService.class)).when(pool).getExecutor();