Modified BGP and FPM route sources to push to new route service.

Also created an adapter to adapt the new interface to the old one for
backwards compatibilty with existing FIB components.

Change-Id: If8eb2220d9e4e69af135a8f9469ffda567ed4448
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java b/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
index fd6718d..7769f6f 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
+++ b/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
@@ -33,8 +33,7 @@
 import org.onlab.junit.TestUtils.TestUtilsException;
 import org.onlab.packet.Ip4Address;
 import org.onlab.packet.Ip4Prefix;
-import org.onosproject.routing.RouteListener;
-import org.onosproject.routing.RouteUpdate;
+import org.onosproject.incubator.net.routing.RouteAdminService;
 import org.osgi.service.component.ComponentContext;
 
 import java.net.InetAddress;
@@ -48,6 +47,7 @@
 import java.util.concurrent.TimeUnit;
 
 import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.hamcrest.Matchers.hasSize;
@@ -85,6 +85,8 @@
     // Timeout waiting for a message to be received
     private static final int MESSAGE_TIMEOUT_MS = 5000; // 5s
 
+    private RouteAdminService routeService;
+
     // The BGP Session Manager to test
     private BgpSessionManager bgpSessionManager;
 
@@ -102,19 +104,6 @@
     // The socket that the remote peers should connect to
     private InetSocketAddress connectToSocket;
 
-    private final DummyRouteListener dummyRouteListener =
-        new DummyRouteListener();
-
-    /**
-     * Dummy implementation for the RouteListener interface.
-     */
-    private class DummyRouteListener implements RouteListener {
-        @Override
-        public void update(Collection<RouteUpdate> routeUpdate) {
-            // Nothing to do
-        }
-    }
-
     /**
      * A class to capture the state for a BGP peer.
      */
@@ -238,13 +227,11 @@
     }
 
     @SuppressWarnings("unchecked")
-    private Dictionary
-            getDictionaryMock(ComponentContext componentContext) {
+    private void getDictionaryMock(ComponentContext componentContext) {
         Dictionary dictionary = createMock(Dictionary.class);
         expect(dictionary.get("bgpPort")).andReturn("0");
         replay(dictionary);
         expect(componentContext.getProperties()).andReturn(dictionary);
-        return dictionary;
     }
 
     @Before
@@ -262,12 +249,16 @@
         // connections.
         //
         bgpSessionManager = new BgpSessionManager();
+
+        routeService = createNiceMock(RouteAdminService.class);
+        replay(routeService);
+        bgpSessionManager.routeService = routeService;
+
         // NOTE: We use port 0 to bind on any available port
         ComponentContext componentContext = createMock(ComponentContext.class);
-        Dictionary dictionary = getDictionaryMock(componentContext);
+        getDictionaryMock(componentContext);
         replay(componentContext);
         bgpSessionManager.activate(componentContext);
-        bgpSessionManager.start(dummyRouteListener);
 
         // Get the port number the BGP Session Manager is listening on
         Channel serverChannel = TestUtils.getField(bgpSessionManager,
@@ -547,6 +538,7 @@
         withdrawnRoutes.add(Ip4Prefix.valueOf("70.0.0.0/16"));
         withdrawnRoutes.add(Ip4Prefix.valueOf("80.0.0.0/24"));
         withdrawnRoutes.add(Ip4Prefix.valueOf("90.0.0.0/32"));
+
         // Write the routes
         message = peer1.peerChannelHandler.prepareBgpUpdate(
                         NEXT_HOP1_ROUTER,