From: Michael Vorburger Date: Thu, 18 Jan 2018 02:15:23 +0000 (+0100) Subject: DataBrokerTestModule getBindingToNormalizedNodeCodec() & Co. X-Git-Tag: v4.0.15~8 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F90083%2F1;p=mdsal.git DataBrokerTestModule getBindingToNormalizedNodeCodec() & Co. need these exposed for a new standalone component style test I'm on JIRA: MDSAL-556 Change-Id: I5efd3a6e507d46d035067a561aaca7c2f80f51e6 Signed-off-by: Michael Vorburger Signed-off-by: Robert Varga (cherry picked from commit 8a6e5f0946f5ed60f7554c51e7621e2ac3e41edd) --- diff --git a/binding/mdsal-binding-test-utils/src/main/java/org/opendaylight/mdsal/binding/testutils/DataBrokerTestModule.java b/binding/mdsal-binding-test-utils/src/main/java/org/opendaylight/mdsal/binding/testutils/DataBrokerTestModule.java index 938195b218..234a4cdcb3 100644 --- a/binding/mdsal-binding-test-utils/src/main/java/org/opendaylight/mdsal/binding/testutils/DataBrokerTestModule.java +++ b/binding/mdsal-binding-test-utils/src/main/java/org/opendaylight/mdsal/binding/testutils/DataBrokerTestModule.java @@ -7,12 +7,21 @@ */ package org.opendaylight.mdsal.binding.testutils; +import com.google.common.annotations.Beta; import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec; import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; +import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter; +import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; +@Beta public class DataBrokerTestModule { private final boolean useMTDataTreeChangeListenerExecutor; + private AbstractConcurrentDataBrokerTest dataBrokerTest; + public DataBrokerTestModule(final boolean useMTDataTreeChangeListenerExecutor) { this.useMTDataTreeChangeListenerExecutor = useMTDataTreeChangeListenerExecutor; } @@ -30,12 +39,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. - AbstractConcurrentDataBrokerTest dataBrokerTest = - new AbstractConcurrentDataBrokerTest(useMTDataTreeChangeListenerExecutor) { }; + dataBrokerTest = new AbstractConcurrentDataBrokerTest(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 DOMSchemaService getSchemaService() { + return dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService(); + } + + public SchemaContextProvider getSchemaContextProvider() { + return dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService()::getGlobalContext; + } }