Support multithreading DataBrokerTestCustomizer (AbstractDataBrokerTest)
[controller.git] / 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.