X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FTestDCLExecutorService.java;fp=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FTestDCLExecutorService.java;h=0000000000000000000000000000000000000000;hb=2611e6a728e586ea34dd891f30a473bf54d6cbd8;hp=cbeff79d129a84ecd60cb3faf4acea2bff6922f7;hpb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;p=controller.git diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/TestDCLExecutorService.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/TestDCLExecutorService.java deleted file mode 100644 index cbeff79d12..0000000000 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/TestDCLExecutorService.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014 Brocade Communications 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.md.sal.dom.store.impl; - -import com.google.common.util.concurrent.ForwardingExecutorService; -import com.google.common.util.concurrent.MoreExecutors; -import java.util.concurrent.ExecutorService; - -/** - * A forwarding Executor used by unit tests for DataChangeListener notifications. - * - * @author Thomas Pantelis - */ -public class TestDCLExecutorService extends ForwardingExecutorService { - - // Start with a same thread executor to avoid timing issues during test setup. - private volatile ExecutorService currentExecutor = MoreExecutors.newDirectExecutorService(); - - // The real executor to use when test setup is complete. - private final ExecutorService postSetupExecutor; - - - public TestDCLExecutorService(final ExecutorService postSetupExecutor) { - this.postSetupExecutor = postSetupExecutor; - } - - @Override - protected ExecutorService delegate() { - return currentExecutor; - } - - public void afterTestSetup() { - // Test setup complete - switch to the real executor. - currentExecutor = postSetupExecutor; - } -}