Bug 8163: Use MT DTCL executor in AbstractConcurrentDataBrokerTest
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / md / sal / binding / test / ConcurrentDataBrokerTestCustomizer.java
1 /*
2  * Copyright (c) 2017 Red Hat, 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.md.sal.binding.test;
9
10 import com.google.common.util.concurrent.ListeningExecutorService;
11 import com.google.common.util.concurrent.MoreExecutors;
12 import java.util.concurrent.Executors;
13
14 /**
15  * ConcurrentDataBrokerTestCustomizer.
16  *
17  * <p>See {@link AbstractConcurrentDataBrokerTest} and
18  * <a href="https://bugs.opendaylight.org/show_bug.cgi?id=7538">bug 7538</a> for more details & background.
19  *
20  * @author Michael Vorburger
21  */
22 public class ConcurrentDataBrokerTestCustomizer extends AbstractDataBrokerTestCustomizer {
23
24     @Override
25     public ListeningExecutorService getCommitCoordinatorExecutor() {
26         return MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
27     }
28
29     public void useMTDataTreeChangeListenerExecutor() {
30         setDataTreeChangeListenerExecutor(MoreExecutors.listeningDecorator(Executors.newCachedThreadPool()));
31     }
32 }