Class TestableDataBroker

  • All Implemented Interfaces:
    org.opendaylight.mdsal.binding.api.BindingService, org.opendaylight.mdsal.binding.api.DataBroker, org.opendaylight.mdsal.binding.api.DataTreeChangeService, org.opendaylight.mdsal.binding.api.TransactionFactory

    public abstract class TestableDataBroker
    extends java.lang.Object
    implements org.opendaylight.mdsal.binding.api.DataBroker
    DataBroker useful in tests of utilities.
    Author:
    Michael Vorburger.ch
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void asyncFireDataTreeChangeListener()
      Run fireDataTreeChangeListener() in an asynchronous background thread.
      void fireDataTreeChangeListener()  
      static TestableDataBroker newInstance()  
      <T extends org.opendaylight.yangtools.yang.binding.DataObject,​L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>>
      org.opendaylight.yangtools.concepts.ListenerRegistration<L>
      registerDataTreeChangeListener​(org.opendaylight.mdsal.binding.api.DataTreeIdentifier<T> id, L newListener)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.opendaylight.mdsal.binding.api.DataBroker

        createMergingTransactionChain, createTransactionChain
      • Methods inherited from interface org.opendaylight.mdsal.binding.api.TransactionFactory

        newReadOnlyTransaction, newReadWriteTransaction, newWriteOnlyTransaction
    • Constructor Detail

      • TestableDataBroker

        public TestableDataBroker()
    • Method Detail

      • registerDataTreeChangeListener

        public <T extends org.opendaylight.yangtools.yang.binding.DataObject,​L extends org.opendaylight.mdsal.binding.api.DataTreeChangeListener<T>> org.opendaylight.yangtools.concepts.ListenerRegistration<L> registerDataTreeChangeListener​(org.opendaylight.mdsal.binding.api.DataTreeIdentifier<T> id,
                                                                                                                                                                                                                                                      L newListener)
        Specified by:
        registerDataTreeChangeListener in interface org.opendaylight.mdsal.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.