DataBrokerTestModule: use AbstractDataBrokerTest without inheritance
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / test / AbstractConcurrentDataBrokerTest.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.mdsal.binding.dom.adapter.test;
9
10 /**
11  * Abstract base for DataBroker tests.
12  *
13  * <p>Uses single thread executor for the Serialized DOM DataBroker (instead of the direct executor used by the
14  * AbstractDataBrokerTest) in order to allow tests to use the DataBroker concurrently from several threads.
15  *
16  * @author Michael Vorburger
17  */
18 public abstract class AbstractConcurrentDataBrokerTest extends AbstractBaseDataBrokerTest {
19     private final boolean useMTDataTreeChangeListenerExecutor;
20
21     protected AbstractConcurrentDataBrokerTest() {
22         this(false);
23     }
24
25     protected AbstractConcurrentDataBrokerTest(final boolean useMTDataTreeChangeListenerExecutor) {
26         this.useMTDataTreeChangeListenerExecutor = useMTDataTreeChangeListenerExecutor;
27     }
28
29     @Override
30     protected AbstractDataBrokerTestCustomizer createDataBrokerTestCustomizer() {
31         return new ConcurrentDataBrokerTestCustomizer(useMTDataTreeChangeListenerExecutor);
32     }
33 }