Support multithreading DataBrokerTestCustomizer (AbstractDataBrokerTest) 07/51307/5
authorMichael Vorburger <vorburger@redhat.com>
Wed, 1 Feb 2017 16:03:16 +0000 (17:03 +0100)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 3 Feb 2017 19:29:56 +0000 (19:29 +0000)
https://bugs.opendaylight.org/show_bug.cgi?id=7538 has full background

Bug: 7538
Change-Id: Ic3f2169e18928e3010e45bddb43186cc53d897f4
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestCustomizer.java

index 23600a3..8d34cbd 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.md.sal.binding.test;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.Executors;
 import javassist.ClassPool;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
@@ -83,9 +84,8 @@ public class DataBrokerTestCustomizer {
         return new BindingDOMNotificationPublishServiceAdapter(bindingToNormalized, domNotificationRouter);
     }
 
-
     public ListeningExecutorService getCommitCoordinatorExecutor() {
-        return MoreExecutors.newDirectExecutorService();
+        return MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
     }
 
     public DataBroker createDataBroker() {
@@ -101,7 +101,7 @@ public class DataBrokerTestCustomizer {
     }
 
     private DOMDataBroker getDOMDataBroker() {
-        if(domDataBroker == null) {
+        if (domDataBroker == null) {
             domDataBroker = createDOMDataBroker();
         }
         return domDataBroker;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.