DataBrokerTestModule getBindingToNormalizedNodeCodec() & Co. 66/67266/5
authorMichael Vorburger <vorburger@redhat.com>
Thu, 18 Jan 2018 02:15:23 +0000 (03:15 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 26 Jan 2018 23:10:00 +0000 (23:10 +0000)
need these exposed for a new standalone component style test  I'm on

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

index 990d75a91708ce8d9b0c2c7e701eeca5ba1a79b1..fd95a50145dbf91f92b863d6c6dc2f344c279913 100644 (file)
@@ -8,6 +8,11 @@
 package org.opendaylight.controller.md.sal.binding.test;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
 public class DataBrokerTestModule {
 
@@ -16,6 +21,7 @@ public class DataBrokerTestModule {
     }
 
     private final boolean useMTDataTreeChangeListenerExecutor;
+    private ConstantSchemaAbstractDataBrokerTest dataBrokerTest;
 
     public DataBrokerTestModule(boolean useMTDataTreeChangeListenerExecutor) {
         this.useMTDataTreeChangeListenerExecutor = useMTDataTreeChangeListenerExecutor;
@@ -30,12 +36,31 @@ public class DataBrokerTestModule {
             // into this DataBrokerTestModule, and make AbstractDataBrokerTest
             // use it, instead of the way around it currently is (the opposite);
             // this is just for historical reasons... and works for now.
-            ConstantSchemaAbstractDataBrokerTest dataBrokerTest
-                = new ConstantSchemaAbstractDataBrokerTest(useMTDataTreeChangeListenerExecutor);
+            dataBrokerTest = new ConstantSchemaAbstractDataBrokerTest(useMTDataTreeChangeListenerExecutor);
             dataBrokerTest.setup();
             return dataBrokerTest.getDataBroker();
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
+
+    public DOMDataBroker getDOMDataBroker() {
+        return dataBrokerTest.getDomBroker();
+    }
+
+    public BindingToNormalizedNodeCodec getBindingToNormalizedNodeCodec() {
+        return dataBrokerTest.getDataBrokerTestCustomizer().getBindingToNormalized();
+    }
+
+    public DOMNotificationRouter getDOMNotificationRouter() {
+        return dataBrokerTest.getDataBrokerTestCustomizer().getDomNotificationRouter();
+    }
+
+    public SchemaService getSchemaService() {
+        return dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService();
+    }
+
+    public SchemaContextProvider getSchemaContextProvider() {
+        return (SchemaContextProvider) dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService();
+    }
 }