X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Ftest%2FDataBrokerTestModule.java;h=990d75a91708ce8d9b0c2c7e701eeca5ba1a79b1;hp=c71049e444041e53a131f9877637f88a82a97bba;hb=47f9449f977820bc605bafa23e81ee2efe6d9f37;hpb=1e50fbad8d8605b73d5b2be8f5ae30b437b33780;ds=inline diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java index c71049e444..990d75a917 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java @@ -9,19 +9,29 @@ package org.opendaylight.controller.md.sal.binding.test; import org.opendaylight.controller.md.sal.binding.api.DataBroker; -// @Module public class DataBrokerTestModule { + public static DataBroker dataBroker() { + return new DataBrokerTestModule(false).getDataBroker(); + } + + private final boolean useMTDataTreeChangeListenerExecutor; + + public DataBrokerTestModule(boolean useMTDataTreeChangeListenerExecutor) { + this.useMTDataTreeChangeListenerExecutor = useMTDataTreeChangeListenerExecutor; + } + // Suppress IllegalCatch because of AbstractDataBrokerTest (change later) @SuppressWarnings({ "checkstyle:IllegalCatch", "checkstyle:IllegalThrows" }) - public static /* @Provides @Singleton */ DataBroker dataBroker() throws RuntimeException { + public DataBroker getDataBroker() throws RuntimeException { try { // This is a little bit "upside down" - in the future, // we should probably put what is in AbstractDataBrokerTest // 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(); + ConstantSchemaAbstractDataBrokerTest dataBrokerTest + = new ConstantSchemaAbstractDataBrokerTest(useMTDataTreeChangeListenerExecutor); dataBrokerTest.setup(); return dataBrokerTest.getDataBroker(); } catch (Exception e) {