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%2Fnaming%2FTestingNamingThreadPoolFactoryModule.java;h=47613bfb1b1458df8871c1fdb84dab777319ff8b;hp=f22da34d76f3e5ff39f603f69e672f51eda568f2;hb=9c9d6e69da3aff2d0576d8c15ea0fa0692595b6d;hpb=5ded121bd1776ae7ab394e6d11d45319e017d7cc diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java index f22da34d76..47613bfb1b 100644 --- a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java @@ -1,66 +1,66 @@ -/* - * 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.naming; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -import java.io.Closeable; -import java.io.IOException; - -import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; -import org.opendaylight.controller.config.api.ModuleIdentifier; -import org.opendaylight.controller.config.spi.Module; -import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory; -import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; -import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; - -public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface, - NamingThreadFactoryModuleMXBean { - - private final NamingThreadPoolFactory fact; - - public TestingNamingThreadPoolFactoryModule() throws IOException { - fact = mock(NamingThreadPoolFactory.class); - Thread thread = mock(Thread.class); - doNothing().when(thread).start(); - doReturn(thread).when(fact).newThread(any(Runnable.class)); - doNothing().when(fact).close(); - } - - public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) { - fact = (NamingThreadPoolFactory) old.getInstance(); - } - - @Override - public ModuleIdentifier getIdentifier() { - return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock"); - } - - @Override - public String getNamePrefix() { - return null; - } - - @Override - public void setNamePrefix(String arg) { - throw new UnsupportedOperationException(); - } - - @Override - public void validate() { - } - - @Override - public Closeable getInstance() { - return fact; - } - -} +/* + * 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.naming; + +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import java.io.Closeable; +import java.io.IOException; + +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.NamingThreadPoolFactory; +import org.opendaylight.controller.config.yang.threadpool.ThreadFactoryServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFactoryModuleMXBean; + +public class TestingNamingThreadPoolFactoryModule implements Module, ThreadFactoryServiceInterface, + NamingThreadFactoryModuleMXBean { + + private final NamingThreadPoolFactory fact; + + public TestingNamingThreadPoolFactoryModule() throws IOException { + fact = mock(NamingThreadPoolFactory.class); + Thread thread = mock(Thread.class); + doNothing().when(thread).start(); + doReturn(thread).when(fact).newThread(any(Runnable.class)); + doNothing().when(fact).close(); + } + + public TestingNamingThreadPoolFactoryModule(DynamicMBeanWithInstance old) { + fact = (NamingThreadPoolFactory) old.getInstance(); + } + + @Override + public ModuleIdentifier getIdentifier() { + return new ModuleIdentifier(TestingNamingThreadPoolFactoryModule.class.getCanonicalName(), "mock"); + } + + @Override + public String getNamePrefix() { + return null; + } + + @Override + public void setNamePrefix(String arg) { + throw new UnsupportedOperationException(); + } + + @Override + public void validate() { + } + + @Override + public Closeable getInstance() { + return fact; + } + +}