use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyEDCAB.
@Test
public void testFiveSwitchTopologyEDCAB() {
FiveSwitchTopology topology = new FiveSwitchTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeAId));
domain.addBridge(new Bridge(topology.nodeBId));
domain.addBridge(new Bridge(topology.nodeCId));
domain.addBridge(new Bridge(topology.nodeDId));
domain.addBridge(new Bridge(topology.nodeEId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbtE = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeEId, null, null, null, location));
ndbtE.setDomain(domain);
ndbtE.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbtE.calculate();
NodeDiscoveryBridgeTopology ndbtD = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeDId, null, null, null, location));
ndbtD.setDomain(domain);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
NodeDiscoveryBridgeTopology ndbtC = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeCId, null, null, null, location));
ndbtC.setDomain(domain);
ndbtC.addUpdatedBFT(domain.getBridge(topology.nodeCId), topology.bftC);
ndbtC.calculate();
NodeDiscoveryBridgeTopology ndbtA = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeAId, null, null, null, location));
ndbtA.setDomain(domain);
ndbtA.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbtA.calculate();
NodeDiscoveryBridgeTopology ndbtB = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeBId, null, null, null, location));
ndbtB.setDomain(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
Bridge bridgeB = domain.getBridge(topology.nodeBId);
domain.hierarchySetUp(bridgeB);
topology.check(domain);
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyBEDCABEDAC.
@Test
public void testFiveSwitchTopologyBEDCABEDAC() {
FiveSwitchTopology topology = new FiveSwitchTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeAId));
domain.addBridge(new Bridge(topology.nodeBId));
domain.addBridge(new Bridge(topology.nodeCId));
domain.addBridge(new Bridge(topology.nodeDId));
domain.addBridge(new Bridge(topology.nodeEId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbtB = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeBId, null, null, null, location));
ndbtB.setDomain(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
NodeDiscoveryBridgeTopology ndbtE = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeEId, null, null, null, location));
ndbtE.setDomain(domain);
ndbtE.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbtE.calculate();
NodeDiscoveryBridgeTopology ndbtD = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeDId, null, null, null, location));
ndbtD.setDomain(domain);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
NodeDiscoveryBridgeTopology ndbtC = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeCId, null, null, null, location));
ndbtC.setDomain(domain);
ndbtC.addUpdatedBFT(domain.getBridge(topology.nodeCId), topology.bftC);
ndbtC.calculate();
NodeDiscoveryBridgeTopology ndbtA = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeAId, null, null, null, location));
ndbtA.setDomain(domain);
ndbtA.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbtA.calculate();
topology.check(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
topology.check(domain);
ndbtE.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbtE.calculate();
topology.check(domain);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
topology.check(domain);
ndbtA.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbtA.calculate();
topology.check(domain);
ndbtC.addUpdatedBFT(domain.getBridge(topology.nodeCId), topology.bftC);
ndbtC.calculate();
topology.check(domain);
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testCThenAB.
@Test
public void testCThenAB() {
ABCTopology topology = new ABCTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeCId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbt = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeAId, null, null, null, location));
ndbt.setDomain(domain);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeCId), topology.bftC);
ndbt.calculate();
domain.addBridge(new Bridge(topology.nodeAId));
domain.addBridge(new Bridge(topology.nodeBId));
domain.setBridgeElements(topology.elemlist);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbt.calculate();
domain.hierarchySetUp(domain.getBridge(topology.nodeAId));
topology.check(ndbt.getDomain());
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testTwoBridgeTwoCalculationReverse.
@Test
public void testTwoBridgeTwoCalculationReverse() {
TwoNodeTopology topology = new TwoNodeTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeAId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbt = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeAId, null, null, null, location));
ndbt.setDomain(domain);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbt.calculate();
List<SharedSegment> shsegs = ndbt.getDomain().getTopology();
assertEquals(3, shsegs.size());
domain.addBridge(new Bridge(topology.nodeBId));
domain.setBridgeElements(topology.elemlist);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbt.calculate();
topology.check2nodeTopology(ndbt.getDomain(), false);
assertEquals(topology.nodeAId, domain.getRootBridgeId());
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyEDCBA.
@Test
public void testFiveSwitchTopologyEDCBA() {
FiveSwitchTopology topology = new FiveSwitchTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeAId));
domain.addBridge(new Bridge(topology.nodeBId));
domain.addBridge(new Bridge(topology.nodeCId));
domain.addBridge(new Bridge(topology.nodeDId));
domain.addBridge(new Bridge(topology.nodeEId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbtE = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeEId, null, null, null, location));
ndbtE.setDomain(domain);
ndbtE.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbtE.calculate();
NodeDiscoveryBridgeTopology ndbtD = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeDId, null, null, null, location));
ndbtD.setDomain(domain);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
NodeDiscoveryBridgeTopology ndbtC = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeCId, null, null, null, location));
ndbtC.setDomain(domain);
ndbtC.addUpdatedBFT(domain.getBridge(topology.nodeCId), topology.bftC);
ndbtC.calculate();
NodeDiscoveryBridgeTopology ndbtB = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeBId, null, null, null, location));
ndbtB.setDomain(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
NodeDiscoveryBridgeTopology ndbtA = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeAId, null, null, null, location));
ndbtA.setDomain(domain);
ndbtA.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbtA.calculate();
Bridge bridgeB = domain.getBridge(topology.nodeBId);
domain.hierarchySetUp(bridgeB);
topology.check(domain);
}
Aggregations