use of org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter in project controller by opendaylight.
the class BindingDOMDataBrokerAdapterTest method testClusteredDataChangeListernerRegisteration.
@Test
public void testClusteredDataChangeListernerRegisteration() {
final BindingToNormalizedNodeCodec codec = new BindingToNormalizedNodeCodec(this.classLoadingStrategy, this.codecRegistry);
try (BindingDOMDataBrokerAdapter bindingDOMDataBrokerAdapter = new BindingDOMDataBrokerAdapter(this.dataBroker, codec)) {
Mockito.when(this.codecRegistry.toYangInstanceIdentifier(TOP_PATH)).thenReturn(this.yangInstanceIdentifier);
final ArgumentCaptor<ClusteredDOMDataChangeListener> clusteredDOMListener = ArgumentCaptor.forClass(ClusteredDOMDataChangeListener.class);
final ArgumentCaptor<LogicalDatastoreType> logicalDatastoreType = ArgumentCaptor.forClass(LogicalDatastoreType.class);
final ArgumentCaptor<AsyncDataBroker.DataChangeScope> dataChangeScope = ArgumentCaptor.forClass(AsyncDataBroker.DataChangeScope.class);
final ArgumentCaptor<YangInstanceIdentifier> yangIidCapture = ArgumentCaptor.forClass(YangInstanceIdentifier.class);
final TestListener listener = new TestListener();
bindingDOMDataBrokerAdapter.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, TOP_PATH, listener, AsyncDataBroker.DataChangeScope.BASE);
Mockito.verify(this.dataBroker).registerDataChangeListener(logicalDatastoreType.capture(), yangIidCapture.capture(), clusteredDOMListener.capture(), dataChangeScope.capture());
}
}
use of org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter in project controller by opendaylight.
the class BindingTestContext method startNewDataBroker.
public void startNewDataBroker() {
checkState(this.executor != null, "Executor needs to be set");
checkState(this.newDOMDataBroker != null, "DOM Data Broker must be set");
this.dataBroker = new BindingDOMDataBrokerAdapter(this.newDOMDataBroker, this.codec);
}
use of org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter in project controller by opendaylight.
the class BindingAsyncDataBrokerImplModule method createInstance.
@Override
public java.lang.AutoCloseable createInstance() {
final BindingToNormalizedNodeCodec mappingService = getBindingMappingServiceDependency();
final DOMDataBroker domDataBroker = getDomAsyncBrokerDependency();
return new BindingDOMDataBrokerAdapter(domDataBroker, mappingService);
}
Aggregations