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;
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;
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);
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();
}
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;
});
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),
}
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,
new InetSocketAddress(RIB_ID, PORT), RETRY_TIMER, true);
Thread.sleep(200);
waitFutureSuccess(future);
+ Thread.sleep(100);
return future.getNow();
}