Resolve Bug:745 - remove windows line endings from config and netconf.
[controller.git] / opendaylight / config / threadpool-config-impl / src / test / java / org / opendaylight / controller / config / threadpool / fixed / TestingFixedThreadPoolModule.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.threadpool.fixed;
9
10 import static org.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.doReturn;
12 import static org.mockito.Mockito.mock;
13
14 import java.util.concurrent.ExecutorService;
15
16 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
17 import org.opendaylight.controller.config.api.ModuleIdentifier;
18 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
19 import org.opendaylight.controller.config.spi.Module;
20 import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;
21 import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface;
22
23 public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module {
24
25     public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
26         super(old, id);
27     }
28
29     @Override
30     protected AutoCloseable prepareMockedInstance() throws Exception {
31         FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class);
32         doNothing().when(pool).close();
33         doReturn(mock(ExecutorService.class)).when(pool).getExecutor();
34         return pool;
35     }
36
37 }