private List<AddPathBestPath> bestPath;
private List<AddPathBestPath> bestPathRemoved;
protected OffsetMap offsets = OffsetMap.EMPTY;
- protected Attributes[] values = EMPTY_ATTRIBUTES;
+ protected Route[] values = EMPTY_VALUES;
protected Long[] pathsId = EMPTY_PATHS_ID;
private long pathIdCounter = 0L;
private boolean oldNonAddPathBestPathTheSame;
}
}
- protected int addRoute(final RouteKey key, final Attributes attributes) {
+ @Override
+ public final Route createRoute(final RIBSupport ribSup, final String routeKey, final long pathId,
+ final AddPathBestPath path) {
+ final OffsetMap map = getOffsets();
+ final Route route = map.getValue(this.values, map.offsetOf(path.getRouteKey()));
+ return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
+ }
+
+ @Override
+ public final int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
+ final RouteKey key = new RouteKey(routerId, remotePathId);
int offset = this.offsets.offsetOf(key);
if (offset < 0) {
final OffsetMap newOffsets = this.offsets.with(key);
offset = newOffsets.offsetOf(key);
- final Attributes[] newAttributes = newOffsets.expand(this.offsets, this.values, offset);
+ final Route[] newRoute = newOffsets.expand(this.offsets, this.values, offset);
final Long[] newPathsId = newOffsets.expand(this.offsets, this.pathsId, offset);
- this.values = newAttributes;
+ this.values = newRoute;
this.offsets = newOffsets;
this.pathsId = newPathsId;
this.offsets.setValue(this.pathsId, offset, ++this.pathIdCounter);
}
- this.offsets.setValue(this.values, offset, attributes);
- LOG.trace("Added route from {} attributes {}", key.getRouteId(), attributes);
+ this.offsets.setValue(this.values, offset, route);
+ LOG.trace("Added route {} from {}", route, key.getRouteId());
return offset;
}
- /**
- * Remove route.
- *
- * @param key RouteKey of removed route
- * @param offset Offset of removed route
- * @return true if it was the last route
- */
- protected final boolean removeRoute(final RouteKey key, final int offset) {
+ @Override
+ public final boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
+ final RouteKey key = new RouteKey(routerId, remotePathId);
+ final int offset = getOffsets().offsetOf(key);
final long pathId = this.offsets.getValue(this.pathsId, offset);
- this.values = this.offsets.removeValue(this.values, offset, EMPTY_ATTRIBUTES);
+ this.values = this.offsets.removeValue(this.values, offset, EMPTY_VALUES);
this.pathsId = this.offsets.removeValue(this.pathsId, offset, EMPTY_PATHS_ID);
this.offsets = this.offsets.without(key);
if (this.removedPaths == null) {
}
@Override
- public void initializeBestPaths(final RouteEntryDependenciesContainer entryDependencies,
+ public void initializeBestPaths(final RouteEntryDependenciesContainer routeEntryDep,
final RouteEntryInfo entryInfo, final WriteTransaction tx) {
if (this.bestPath != null) {
final Peer toPeer = entryInfo.getToPeer();
- final TablesKey localTk = entryDependencies.getLocalTablesKey();
+ final TablesKey localTk = routeEntryDep.getLocalTablesKey();
final boolean destPeerSupAddPath = toPeer.supportsAddPathSupported(localTk);
for (final AddPathBestPath path : this.bestPath) {
if (!filterRoutes(path.getPeerId(), toPeer, localTk)) {
continue;
}
- writeRoutePath(entryInfo, destPeerSupAddPath, path, localTk, entryDependencies, tx);
+ final String routeKey = entryInfo.getRouteKey();
+ final RIBSupport ribSupport = routeEntryDep.getRibSupport();
+ final BGPRouteEntryExportParameters baseExp = new BGPRouteEntryExportParametersImpl(
+ this.peerTracker.getPeer(path.getPeerId()), toPeer);
+ final Optional<Attributes> effAttrib = routeEntryDep.getRoutingPolicies()
+ .applyExportPolicies(baseExp, path.getAttributes());
+ if (effAttrib.isPresent()) {
+ Identifier routeIdentifier = ribSupport.createRouteListKey(destPeerSupAddPath
+ ? path.getPathId() : NON_PATH_ID_VALUE, routeKey);
+ final Route route = createRoute(ribSupport, routeKey, destPeerSupAddPath
+ ? path.getPathId() : NON_PATH_ID_VALUE, path);
+ InstanceIdentifier ribOutIId
+ = ribSupport.createRouteIdentifier(toPeer.getRibOutIId(localTk), routeIdentifier);
+
+ LOG.debug("Write route {} to peer AdjRibsOut {}", route, toPeer.getPeerId());
+ tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId, route);
+ tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId.child(Attributes.class), effAttrib.get());
+ }
}
}
}
- @SuppressWarnings("unchecked")
- private void writeRoutePath(final RouteEntryInfo entryInfo,
- final boolean destPeerSupAddPath, final AddPathBestPath path,
- final TablesKey localTK, final RouteEntryDependenciesContainer routeEntryDep, final WriteTransaction tx) {
- final String routeKey = entryInfo.getRouteKey();
- final RIBSupport ribSupport = routeEntryDep.getRibSupport();
- final BGPRouteEntryExportParameters baseExp = new BGPRouteEntryExportParametersImpl(
- this.peerTracker.getPeer(path.getPeerId()), entryInfo.getToPeer());
- final Optional<Attributes> effAttrib = routeEntryDep.getRoutingPolicies()
- .applyExportPolicies(baseExp, path.getAttributes());
-
- Identifier routeIdentifier = ribSupport.createRouteListKey(destPeerSupAddPath
- ? path.getPathId() : NON_PATH_ID_VALUE, routeKey);
- final Peer toPeer = entryInfo.getToPeer();
- final Route route = createRoute(ribSupport, routeKey, destPeerSupAddPath
- ? path.getPathId() : NON_PATH_ID_VALUE, path);
- InstanceIdentifier ribOutIId = ribSupport.createRouteIdentifier(toPeer.getRibOutIId(localTK), routeIdentifier);
- if (effAttrib.isPresent() && route != null) {
- LOG.debug("Write route {} to peer AdjRibsOut {}", route, toPeer.getPeerId());
- tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId, route);
- tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId.child(Attributes.class), effAttrib.get());
- }
- }
-
private void addPathToDataStore(
final RouteEntryDependenciesContainer entryDep,
final AddPathBestPath path,
private void selectBest(final RouteKey key, final AddPathSelector selector) {
final int offset = this.offsets.offsetOf(key);
- final Attributes attributes = this.offsets.getValue(this.values, offset);
+ final Route route = this.offsets.getValue(this.values, offset);
final long pathId = this.offsets.getValue(this.pathsId, offset);
- LOG.trace("Processing router key {} attributes {}", key, attributes);
- selector.processPath(attributes, key, offset, pathId);
+ LOG.trace("Processing router key {} route {}", key, route);
+ selector.processPath(route.getAttributes(), key, offset, pathId);
}
/**
import static java.util.Objects.requireNonNull;
import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
-import org.opendaylight.protocol.bgp.mode.api.RouteEntry;
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
public class AllPathSelection implements PathSelectionMode {
}
@Override
- public RouteEntry createRouteEntry() {
- return new ComplexRouteEntry(this.peerTracker);
+ public org.opendaylight.protocol.bgp.mode.api.RouteEntry createRouteEntry() {
+ return new AllPathsRouteEntry(this.peerTracker);
}
@Override
import org.opendaylight.protocol.bgp.mode.impl.add.AddPathBestPath;
import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
-abstract class AbstractAllPathsRouteEntry extends AddPathAbstractRouteEntry {
- AbstractAllPathsRouteEntry(final BGPPeerTracker peerTracker) {
+final class AllPathsRouteEntry extends AddPathAbstractRouteEntry {
+ AllPathsRouteEntry(final BGPPeerTracker peerTracker) {
super(peerTracker);
}
@Override
- public final boolean selectBest(final long localAs) {
+ public boolean selectBest(final long localAs) {
final List<AddPathBestPath> newBestPathList = new ArrayList<>();
final List<RouteKey> keyList = this.offsets.getRouteKeysList();
/*we add the rest of path, regardless in what order they are, since this is all path case */
for (final RouteKey key : keyList) {
final int offset = this.offsets.offsetOf(key);
- final Attributes attributes = this.offsets.getValue(this.values, offset);
+ final Route route = this.offsets.getValue(this.values, offset);
requireNonNull(key.getRouteId(), "Router ID may not be null");
- if (attributes != null) {
- final BestPathState state = new BestPathStateImpl(attributes);
+ if (route != null) {
+ final BestPathState state = new BestPathStateImpl(route.getAttributes());
final AddPathBestPath bestPath = new AddPathBestPath(state, key, offset,
this.offsets.getValue(this.pathsId, offset));
newBestPathList.add(bestPath);
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.mode.impl.add.all.paths;
-
-import com.google.common.primitives.UnsignedInteger;
-import org.opendaylight.protocol.bgp.mode.impl.add.AddPathBestPath;
-import org.opendaylight.protocol.bgp.mode.impl.add.OffsetMap;
-import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
-import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
-import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
-
-final class ComplexRouteEntry extends AbstractAllPathsRouteEntry {
- private Route[] values = EMPTY_VALUES;
-
- ComplexRouteEntry(final BGPPeerTracker peerTracker) {
- super(peerTracker);
- }
-
- @Override
- public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
- final RouteKey key = new RouteKey(routerId, remotePathId);
- final OffsetMap map = getOffsets();
- final int offset = map.offsetOf(key);
- this.values = map.removeValue(this.values, offset, EMPTY_VALUES);
- return removeRoute(key, offset);
- }
-
- @Override
- public Route createRoute(final RIBSupport ribSup, final String routeKey, final long pathId,
- final AddPathBestPath path) {
- final OffsetMap map = getOffsets();
- final Route route = map.getValue(this.values, map.offsetOf(path.getRouteKey()));
- return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
- }
-
- @Override
- public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
- final OffsetMap oldMap = getOffsets();
- final int offset = addRoute(new RouteKey(routerId, remotePathId), route.getAttributes());
- final OffsetMap newMap = getOffsets();
-
- if (!newMap.equals(oldMap)) {
- this.values = newMap.expand(oldMap, this.values, offset);
- }
-
- newMap.setValue(this.values, offset, route);
- return offset;
- }
-}
@Override
public RouteEntry createRouteEntry() {
- return new ComplexRouteEntry(this.npaths, this.peerTracker);
+ return new NPathsRouteEntry(this.npaths, this.peerTracker);
}
}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.mode.impl.add.n.paths;
-
-import com.google.common.primitives.UnsignedInteger;
-import org.opendaylight.protocol.bgp.mode.impl.add.AddPathBestPath;
-import org.opendaylight.protocol.bgp.mode.impl.add.OffsetMap;
-import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
-import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
-import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
-
-final class ComplexRouteEntry extends AbstractNPathsRouteEntry {
- private Route[] values = EMPTY_VALUES;
-
- ComplexRouteEntry(final long npaths, final BGPPeerTracker peerTracker) {
- super(npaths, peerTracker);
- }
-
- @Override
- public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
- final RouteKey key = new RouteKey(routerId, remotePathId);
- final OffsetMap map = getOffsets();
- final int offset = map.offsetOf(key);
- this.values = map.removeValue(this.values, offset, EMPTY_VALUES);
- return removeRoute(key, offset);
- }
-
- @Override
- public Route createRoute(final RIBSupport ribSup, final String routeKey, final long pathId,
- final AddPathBestPath path) {
- final OffsetMap map = getOffsets();
- final Route route = map.getValue(this.values, map.offsetOf(path.getRouteKey()));
- return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
- }
-
- @Override
- public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
- final OffsetMap oldMap = getOffsets();
- final int offset = addRoute(new RouteKey(routerId, remotePathId), route.getAttributes());
- final OffsetMap newMap = getOffsets();
-
- if (!newMap.equals(oldMap)) {
- this.values = newMap.expand(oldMap, this.values, offset);
- }
-
- newMap.setValue(this.values, offset, route);
- return offset;
- }
-}
\ No newline at end of file
import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
-abstract class AbstractNPathsRouteEntry extends AddPathAbstractRouteEntry {
+final class NPathsRouteEntry extends AddPathAbstractRouteEntry {
private final long npaths;
- AbstractNPathsRouteEntry(final long npaths, final BGPPeerTracker peerTracker) {
+ NPathsRouteEntry(final long npaths, final BGPPeerTracker peerTracker) {
super(peerTracker);
this.npaths = npaths;
}
@Override
- public final boolean selectBest(final long localAs) {
+ public boolean selectBest(final long localAs) {
final List<AddPathBestPath> newBestPathList = new ArrayList<>();
final List<RouteKey> keyList = this.offsets.getRouteKeysList();
final long maxSearch = this.npaths < this.offsets.size()
import static java.util.Objects.requireNonNull;
import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
-import org.opendaylight.protocol.bgp.mode.api.RouteEntry;
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
final class BasePathSelection implements PathSelectionMode {
}
@Override
- public RouteEntry createRouteEntry() {
- return new ComplexRouteEntry(this.peerTracker);
+ public org.opendaylight.protocol.bgp.mode.api.RouteEntry createRouteEntry() {
+ return new BaseRouteEntry(this.peerTracker);
}
@Override
import org.slf4j.LoggerFactory;
@NotThreadSafe
-abstract class BaseAbstractRouteEntry extends AbstractRouteEntry<BaseBestPath> {
- private static final Logger LOG = LoggerFactory.getLogger(BaseAbstractRouteEntry.class);
+final class BaseRouteEntry extends AbstractRouteEntry<BaseBestPath> {
+ private static final Logger LOG = LoggerFactory.getLogger(BaseRouteEntry.class);
private OffsetMap offsets = OffsetMap.EMPTY;
- private Attributes[] values = EMPTY_ATTRIBUTES;
+ private Route[] values = EMPTY_VALUES;
private BaseBestPath bestPath;
private BaseBestPath removedBestPath;
- BaseAbstractRouteEntry(final BGPPeerTracker peerTracker) {
+ BaseRouteEntry(final BGPPeerTracker peerTracker) {
super(peerTracker);
}
- /**
- * Remove route.
- *
- * @param routerId router ID in unsigned integer
- * @param offset of removed route
- * @return true if its the last route
- */
- protected final boolean removeRoute(final UnsignedInteger routerId, final int offset) {
- this.values = this.offsets.removeValue(this.values, offset, EMPTY_ATTRIBUTES);
+ @Override
+ public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
+ final int offset = this.offsets.offsetOf(routerId);
+ this.values = this.offsets.removeValue(this.values, offset, EMPTY_VALUES);
this.offsets = this.offsets.without(routerId);
return this.offsets.isEmpty();
}
@Override
- public final boolean selectBest(final long localAs) {
+ public Route createRoute(final RIBSupport ribSup, String routeKey, final long pathId,
+ final BaseBestPath path) {
+ final Route route = this.offsets.getValue(this.values, this.offsets.offsetOf(path.getRouterId()));
+ return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
+ }
+
+ @Override
+ public boolean selectBest(final long localAs) {
/*
* FIXME: optimize flaps by making sure we consider stability of currently-selected route.
*/
// Select the best route.
for (int i = 0; i < this.offsets.size(); ++i) {
final UnsignedInteger routerId = this.offsets.getRouterKey(i);
- final Attributes attributes = this.offsets.getValue(this.values, i);
+ final Attributes attributes = this.offsets.getValue(this.values, i).getAttributes();
LOG.trace("Processing router id {} attributes {}", routerId, attributes);
selector.processPath(routerId, attributes);
}
@Override
public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
- final Attributes advertisedAttrs = route.getAttributes();
int offset = this.offsets.offsetOf(routerId);
if (offset < 0) {
final OffsetMap newOffsets = this.offsets.with(routerId);
this.offsets = newOffsets;
}
- this.offsets.setValue(this.values, offset, advertisedAttrs);
- LOG.trace("Added route from {} attributes {}", routerId, advertisedAttrs);
+ this.offsets.setValue(this.values, offset, route);
+ LOG.trace("Added route {} from {}", route, routerId);
return offset;
}
this.peerTracker.getPeer(this.bestPath.getPeerId()), toPeer);
final Optional<Attributes> effAttrib = entryDep.getRoutingPolicies()
.applyExportPolicies(routeEntry, this.bestPath.getAttributes());
- final Route route = createRoute(ribSupport, entryInfo.getRouteKey(), this.bestPath.getPathId(), this.bestPath);
- InstanceIdentifier ribOutIId = ribSupport.createRouteIdentifier(toPeer.getRibOutIId(localTK), routeIdentifier);
- if (effAttrib.isPresent() && route != null) {
+ if (effAttrib.isPresent()) {
+ final Route route = createRoute(ribSupport,
+ entryInfo.getRouteKey(), this.bestPath.getPathId(), this.bestPath);
+ InstanceIdentifier ribOutIId = ribSupport.createRouteIdentifier(toPeer.getRibOutIId(localTK),
+ routeIdentifier);
LOG.debug("Write route {} to peer AdjRibsOut {}", route, toPeer.getPeerId());
tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId, route);
tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId.child(Attributes.class), effAttrib.get());
entryDep, tx);
}
- final OffsetMap getOffsets() {
- return this.offsets;
- }
-
@VisibleForTesting
@SuppressWarnings("unchecked")
private void fillAdjRibsOut(
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.mode.impl.base;
-
-import com.google.common.primitives.UnsignedInteger;
-import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
-import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
-
-final class ComplexRouteEntry extends BaseAbstractRouteEntry {
- private Route[] values = EMPTY_VALUES;
-
- ComplexRouteEntry(final BGPPeerTracker peerTracker) {
- super(peerTracker);
- }
-
- @Override
- public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
- final OffsetMap oldMap = getOffsets();
- final int offset = super.addRoute(routerId, remotePathId, route);
- final OffsetMap newMap = getOffsets();
-
- if (!newMap.equals(oldMap)) {
- this.values = newMap.expand(oldMap, this.values, offset);
- }
-
- newMap.setValue(this.values, offset, route);
- return offset;
- }
-
- @Override
- public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
- final OffsetMap map = getOffsets();
- final int offset = map.offsetOf(routerId);
- this.values = map.removeValue(this.values, offset, EMPTY_VALUES);
- return removeRoute(routerId, offset);
- }
-
- @Override
- public Route createRoute(final RIBSupport ribSup, String routeKey, final long pathId,
- final BaseBestPath path) {
- final OffsetMap map = getOffsets();
- final Route route = map.getValue(this.values, map.offsetOf(path.getRouterId()));
- return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
- }
-}
import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
import org.opendaylight.protocol.bgp.rib.spi.Peer;
import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerRole;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
public abstract class AbstractRouteEntry<T extends BestPath> implements RouteEntry {
- protected static final Attributes[] EMPTY_ATTRIBUTES = new Attributes[0];
protected static final Route[] EMPTY_VALUES = new Route[0];
protected final BGPPeerTracker peerTracker;
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.mode.impl.add.all.paths;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
-import org.opendaylight.protocol.bgp.mode.impl.BGPPeerTrackerMock;
-
-public class PathSelectionModeFactoryTest extends BGPPeerTrackerMock {
- @Test
- public void testCreateBestPathSelectionStrategy() {
- final PathSelectionMode psm = new AllPathSelection(this.peerTracker);
- Assert.assertTrue(psm.createRouteEntry(true) instanceof ComplexRouteEntry);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.bgp.mode.impl.add.n.paths;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
-import org.opendaylight.protocol.bgp.mode.impl.BGPPeerTrackerMock;
-
-public class PathSelectionModeFactoryTest extends BGPPeerTrackerMock {
- @Test
- public void testCreateBestPathSelectionStrategy() {
- final PathSelectionMode psm = new AddPathBestNPathSelection(2L, this.peerTracker);
- Assert.assertTrue(psm.createRouteEntry(true) instanceof ComplexRouteEntry);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.protocol.bgp.mode.impl.base;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
-import org.opendaylight.protocol.bgp.mode.impl.BGPPeerTrackerMock;
-
-public class BasePathSelectionModeFactoryTest extends BGPPeerTrackerMock {
- @Test
- public void testCreateBestPathSelectionStrategy() {
- final PathSelectionMode psm = BasePathSelectionModeFactory.createBestPathSelectionStrategy(this.peerTracker);
- Assert.assertTrue(psm.createRouteEntry(true) instanceof ComplexRouteEntry);
- }
-}
\ No newline at end of file