- public void testRoutedRpcPathChangeEvents() throws InterruptedException, TimeoutException, ExecutionException {
- OpendaylightTestRoutedRpcService one = Mockito.mock(OpendaylightTestRoutedRpcService.class);
- OpendaylightTestRoutedRpcService two = Mockito.mock(OpendaylightTestRoutedRpcService.class);
- RoutedRpcRegistration<OpendaylightTestRoutedRpcService> regOne = rpcRegistry.addRoutedRpcImplementation(OpendaylightTestRoutedRpcService.class, one);
- RoutedRpcRegistration<OpendaylightTestRoutedRpcService> regTwo = rpcRegistry.addRoutedRpcImplementation(OpendaylightTestRoutedRpcService.class, two);
- assertNotNull(regOne);
- assertNotNull(regTwo);
-
- final TestListener addListener = new TestListener();
- rpcRegistry.registerRouteChangeListener(addListener);
- regOne.registerPath(TestContext.class, FOO_PATH);
-
- RouteChange<RpcContextIdentifier, InstanceIdentifier<?>> fooAddEvent = addListener.event.get(500, TimeUnit.MILLISECONDS);
- Set<InstanceIdentifier<?>> announce = fooAddEvent.getAnnouncements().get(ROUTING_CONTEXT);
- assertNotNull(announce);
- AssertCollections.assertContains(announce, FOO_PATH);
- AssertCollections.assertNotContains(announce, BAR_PATH);
-
-
-
- final TestListener removeListener = new TestListener();
- rpcRegistry.registerRouteChangeListener(removeListener);
-
- regOne.unregisterPath(TestContext.class, FOO_PATH);
-
- RouteChange<RpcContextIdentifier, InstanceIdentifier<?>> fooRemoveEvent = removeListener.event.get(500, TimeUnit.MILLISECONDS);
- Set<InstanceIdentifier<?>> removal = fooRemoveEvent.getRemovals().get(ROUTING_CONTEXT);
- assertNotNull(removal);
- AssertCollections.assertContains(removal, FOO_PATH);
- AssertCollections.assertNotContains(removal, BAR_PATH);
-
+ @Ignore
+ public void nonRoutedRegisteredAsRouted() {
+ final OpendaylightTestRpcServiceService one = Mockito.mock(OpendaylightTestRpcServiceService.class);
+ try {
+ final RoutedRpcRegistration<OpendaylightTestRpcServiceService> reg = rpcRegistry.addRoutedRpcImplementation(OpendaylightTestRpcServiceService.class, one);
+ reg.registerPath(null, BAR_PATH);
+ fail("RpcIsNotRoutedException should be thrown");
+ } catch (final RpcIsNotRoutedException e) {
+ assertNotNull(e.getMessage());
+ } catch (final Exception e) {
+ fail("RpcIsNotRoutedException should be thrown");
+ }