- private ProviderSession createMockContext() {
-
- @SuppressWarnings("deprecation")
- final ClassToInstanceMap<BrokerService> domBrokerServices = ImmutableClassToInstanceMap
- .<BrokerService> builder()
- //
- .put(org.opendaylight.controller.sal.core.api.data.DataProviderService.class, biDataLegacyBroker) //
- .put(RpcProvisionRegistry.class, biBrokerImpl.getRouter()) //
- .put(DOMMountPointService.class, biMountImpl)
- .build();
-
- return new ProviderSession() {
-
- @Override
- public Future<RpcResult<CompositeNode>> rpc(final QName rpc, final CompositeNode input) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public <T extends BrokerService> T getService(final Class<T> service) {
- return domBrokerServices.getInstance(service);
- }
-
- @Override
- public boolean isClosed() {
- return false;
- }
-
- @Override
- public Set<QName> getSupportedRpcs() {
- return null;
- }
-
- @Override
- public void close() {
- }
-
- @Override
- public ListenerRegistration<RpcRegistrationListener> addRpcRegistrationListener(
- final RpcRegistrationListener listener) {
- return null;
- }
-
- @Override
- public RpcRegistration addRpcImplementation(final QName rpcType, final RpcImplementation implementation)
- throws IllegalArgumentException {
- return null;
- }
-
- @Override
- public RoutedRpcRegistration addRoutedRpcImplementation(final QName rpcType, final RpcImplementation implementation) {
- return null;
- }
-
- @Override
- public RoutedRpcRegistration addMountedRpcImplementation(final QName rpcType, final RpcImplementation implementation) {
- return null;
- }
- };
- }
-