X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDOMBrokerTest.java;h=be07a458b23a02ab6f6216d263792c24dd59d55a;hb=4d4d6663416b8aa05b17e6b3176c2d530bfa6cc4;hp=674d2ff44a24a959dd7a0ca7f3ecc6bcb5662f03;hpb=b5b204bafd8ee18692fc023cb2eae6e123369340;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerTest.java index 674d2ff44a..be07a458b2 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMBrokerTest.java @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2014, 2015 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.md.sal.dom.broker.impl; import static org.junit.Assert.assertEquals; @@ -48,7 +56,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class DOMBrokerTest { private SchemaContext schemaContext; - private DOMDataBrokerImpl domBroker; + private AbstractDOMDataBroker domBroker; private ListeningExecutorService executor; private ExecutorService futureExecutor; private CommitExecutorService commitExecutor; @@ -57,9 +65,9 @@ public class DOMBrokerTest { public void setupStore() { InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", - MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor()); + MoreExecutors.newDirectExecutorService()); InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", - MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor()); + MoreExecutors.newDirectExecutorService()); schemaContext = TestModel.createTestContext(); operStore.onGlobalContextUpdated(schemaContext); @@ -74,7 +82,7 @@ public class DOMBrokerTest { futureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool(1, 5, "FCB"); executor = new DeadlockDetectingListeningExecutorService(commitExecutor, TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER, futureExecutor); - domBroker = new DOMDataBrokerImpl(stores, executor); + domBroker = new SerializedDOMDataBroker(stores, executor); } @After @@ -308,18 +316,13 @@ public class DOMBrokerTest { AtomicReference submitTxAsync( final DOMDataWriteTransaction writeTx ) { final AtomicReference caughtEx = new AtomicReference<>(); - new Thread() { - @Override - public void run() { - - try { - writeTx.submit(); - } catch( Throwable e ) { - caughtEx.set( e ); - } + new Thread(() -> { + try { + writeTx.submit(); + } catch (Throwable e) { + caughtEx.set(e); } - - }.start(); + }).start(); return caughtEx; }