@Test(expected = UnsupportedOperationException.class) public void registerTreeChangeListenerTestWithException() throws Exception { final DOMDataTreeChangeListener domDataTreeChangeListener = mock(DOMDataTreeChangeListener.class); final ListenerRegistration<?> listenerRegistration = mock(ListenerRegistration.class); doReturn(listenerRegistration) .when(READABLE_WRITEABLE_DOM_DATA_TREE_SHARD).registerTreeChangeListener(any(), any()); final DOMDataTreeIdentifier domDataTreeIdentifier = new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()); final ChildShardContext childShardContext = new ChildShardContext(domDataTreeIdentifier, READABLE_WRITEABLE_DOM_DATA_TREE_SHARD); final Map<DOMDataTreeIdentifier, ChildShardContext> childShardContextMap = ImmutableMap.of(domDataTreeIdentifier, childShardContext); final AbstractDOMShardTreeChangePublisherTest abstractDOMShardTreeChangePublisherTest = new AbstractDOMShardTreeChangePublisherTest(childShardContextMap); abstractDOMShardTreeChangePublisherTest .registerTreeChangeListener(YANG_INSTANCE_IDENTIFIER, domDataTreeChangeListener); }
@Override public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) { takeLock(); try { return setupListenerContext(path, listener); } finally { releaseLock(); } }
AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher { @Override public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) { takeLock(); try { return setupListenerContext(path, listener); } finally { releaseLock(); } } }
AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher { @Override public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) { takeLock(); try { return setupListenerContext(path, listener); } finally { releaseLock(); } } protected  AbstractDOMShardTreeChangePublisher(final DataTree dataTree,
            final YangInstanceIdentifier shardPath, final Map<DOMDataTreeIdentifier, ChildShardContext> childShards); }
AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher { @Override public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) { takeLock(); try { return setupListenerContext(path, listener); } finally { releaseLock(); } } protected  AbstractDOMShardTreeChangePublisher(final DataTree dataTree,
            final YangInstanceIdentifier shardPath, final Map<DOMDataTreeIdentifier, ChildShardContext> childShards); @Override AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener); }
AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher { @Override public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) { takeLock(); try { return setupListenerContext(path, listener); } finally { releaseLock(); } } protected  AbstractDOMShardTreeChangePublisher(final DataTree dataTree,
            final YangInstanceIdentifier shardPath, final Map<DOMDataTreeIdentifier, ChildShardContext> childShards); @Override AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener);  }