Cleanup eclipse warnings
[bgpcep.git] / bgp / rib-impl / src / test / java / org / opendaylight / protocol / bgp / rib / impl / AbstractAddPathTest.java
index 81a44ebfebb2858b0ef2570396049c5674ab2e87..7ed7e8191114e0313ff7b0d251c7178da886e27f 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.protocol.bgp.rib.impl;
 
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doReturn;
-import static org.opendaylight.protocol.util.CheckUtil.readData;
+import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
 import static org.opendaylight.protocol.util.CheckUtil.waitFutureSuccess;
 
 import com.google.common.base.Optional;
@@ -32,7 +32,10 @@ import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
+import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
+import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
+import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
@@ -102,15 +105,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
 import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.yangtools.sal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.yangtools.sal.binding.generator.util.JavassistUtils;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.Notification;
 import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-class AbstractAddPathTest extends AbstractDataBrokerTest {
+class AbstractAddPathTest extends AbstractConcurrentDataBrokerTest {
     private static final int RETRY_TIMER = 10;
     static final String RIB_ID = "127.0.0.1";
     static final BgpId BGP_ID = new BgpId(RIB_ID);
@@ -231,7 +231,7 @@ class AbstractAddPathTest extends AbstractDataBrokerTest {
 
     private void checkLocRib(final int expectedRoutesOnDS) throws Exception {
         Thread.sleep(100);
-        readData(getDataBroker(), BGP_IID, bgpRib -> {
+        readDataOperational(getDataBroker(), BGP_IID, bgpRib -> {
             final Ipv4RoutesCase routes = ((Ipv4RoutesCase) bgpRib.getRib().get(0).getLocRib().getTables().get(0)
                 .getRoutes());
             final List<Ipv4Route> routeList = routes.getIpv4Routes().getIpv4Route();
@@ -241,7 +241,7 @@ class AbstractAddPathTest extends AbstractDataBrokerTest {
     }
 
     void checkPeersPresentOnDataStore(final int numberOfPeers) throws Exception {
-        readData(getDataBroker(), BGP_IID, bgpRib -> {
+        readDataOperational(getDataBroker(), BGP_IID, bgpRib -> {
             Assert.assertEquals(numberOfPeers, bgpRib.getRib().get(0).getPeer().size());
             return bgpRib;
         });
@@ -249,8 +249,8 @@ class AbstractAddPathTest extends AbstractDataBrokerTest {
 
     BGPSessionImpl createPeerSession(final Ipv4Address peer, final BgpParameters bgpParameters,
         final SimpleSessionListener sessionListener) throws InterruptedException {
-        StrictBGPPeerRegistry clientRegistry = new StrictBGPPeerRegistry();
-        BGPDispatcherImpl clientDispatcher = new BGPDispatcherImpl(this.context.getMessageRegistry(), this.boss,
+        final StrictBGPPeerRegistry clientRegistry = new StrictBGPPeerRegistry();
+        final BGPDispatcherImpl clientDispatcher = new BGPDispatcherImpl(this.context.getMessageRegistry(), this.boss,
             this.worker, clientRegistry);
         clientRegistry.addPeer(new IpAddress(new Ipv4Address(RIB_ID)), sessionListener,
             new BGPSessionPreferences(AS_NUMBER, HOLDTIMER, new BgpId(peer),
@@ -260,7 +260,7 @@ class AbstractAddPathTest extends AbstractDataBrokerTest {
     }
 
     protected static BGPPeer configurePeer(final Ipv4Address peerAddress, final RIBImpl ribImpl,
-        final BgpParameters bgpParameters, final PeerRole peerRole, BGPPeerRegistry bgpPeerRegistry) {
+        final BgpParameters bgpParameters, final PeerRole peerRole, final BGPPeerRegistry bgpPeerRegistry) {
         final IpAddress ipAddress = new IpAddress(peerAddress);
 
         final BGPPeer bgpPeer = new BGPPeer(peerAddress.getValue(), ribImpl, peerRole, null,
@@ -278,6 +278,7 @@ class AbstractAddPathTest extends AbstractDataBrokerTest {
             new InetSocketAddress(RIB_ID, PORT), RETRY_TIMER, true);
         Thread.sleep(200);
         waitFutureSuccess(future);
+        Thread.sleep(100);
         return future.getNow();
     }