Class TestableDataBroker

  • All Implemented Interfaces:
    org.opendaylight.controller.md.sal.binding.api.BindingService, org.opendaylight.controller.md.sal.binding.api.DataBroker, org.opendaylight.controller.md.sal.binding.api.DataTreeChangeService, org.opendaylight.controller.md.sal.binding.api.TransactionFactory, org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,​org.opendaylight.yangtools.yang.binding.DataObject>, org.opendaylight.controller.md.sal.common.api.data.AsyncDataTransactionFactory<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,​org.opendaylight.yangtools.yang.binding.DataObject>, org.opendaylight.controller.md.sal.common.api.data.TransactionChainFactory<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,​org.opendaylight.yangtools.yang.binding.DataObject>, org.opendaylight.controller.sal.binding.api.BindingAwareService

    public abstract class TestableDataBroker
    extends java.lang.Object
    implements org.opendaylight.controller.md.sal.binding.api.DataBroker
    DataBroker useful in tests of utilities.
    Author:
    Michael Vorburger.ch
    • Constructor Detail

      • TestableDataBroker

        public TestableDataBroker()
    • Method Detail

      • registerDataTreeChangeListener

        public <T extends org.opendaylight.yangtools.yang.binding.DataObject,​L extends org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener<T>> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerDataTreeChangeListener​(org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier<T> id,
                                                                                                                                                                                                                                                                  L newListener)
        Specified by:
        registerDataTreeChangeListener in interface org.opendaylight.controller.md.sal.binding.api.DataTreeChangeService
      • fireDataTreeChangeListener

        public void fireDataTreeChangeListener()
      • asyncFireDataTreeChangeListener

        public void asyncFireDataTreeChangeListener()
        Run fireDataTreeChangeListener() in an asynchronous background thread. Exceptions thrown will be logged as errors; tests using this are therefore strongly encouraged to use the org.opendaylight.infrautils.testutils.LogCaptureRule so that tests fail if there were exceptions in the listener.