Bug 8163: getDataTreeChangeListenerExecutor() & DataBrokerTestModule
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / test / java / org / opendaylight / controller / md / sal / binding / test / AbstractDataBrokerTestCustomizer.java
index 8d968b0..375a9f1 100644 (file)
@@ -40,7 +40,6 @@ public abstract class AbstractDataBrokerTestCustomizer {
     private final MockSchemaService schemaService;
     private ImmutableMap<LogicalDatastoreType, DOMStore> datastores;
     private final BindingToNormalizedNodeCodec bindingToNormalized;
-    private ListeningExecutorService dataTreeChangeListenerExecutor = MoreExecutors.newDirectExecutorService();
 
     public ImmutableMap<LogicalDatastoreType, DOMStore> createDatastores() {
         return ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
@@ -61,13 +60,13 @@ public abstract class AbstractDataBrokerTestCustomizer {
     }
 
     public DOMStore createConfigurationDatastore() {
-        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", dataTreeChangeListenerExecutor);
+        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", getDataTreeChangeListenerExecutor());
         this.schemaService.registerSchemaContextListener(store);
         return store;
     }
 
     public DOMStore createOperationalDatastore() {
-        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", dataTreeChangeListenerExecutor);
+        final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", getDataTreeChangeListenerExecutor());
         this.schemaService.registerSchemaContextListener(store);
         return store;
     }
@@ -86,6 +85,10 @@ public abstract class AbstractDataBrokerTestCustomizer {
 
     public abstract ListeningExecutorService getCommitCoordinatorExecutor();
 
+    public ListeningExecutorService getDataTreeChangeListenerExecutor() {
+        return MoreExecutors.newDirectExecutorService();
+    }
+
     public DataBroker createDataBroker() {
         return new BindingDOMDataBrokerAdapter(getDOMDataBroker(), this.bindingToNormalized);
     }
@@ -112,10 +115,6 @@ public abstract class AbstractDataBrokerTestCustomizer {
         return this.datastores;
     }
 
-    public void setDataTreeChangeListenerExecutor(ListeningExecutorService executor) {
-        this.dataTreeChangeListenerExecutor = executor;
-    }
-
     public void updateSchema(final SchemaContext ctx) {
         this.schemaService.changeSchema(ctx);
     }

©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.