use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testHierarchySetUp.
@Test
public void testHierarchySetUp() {
DEFGHILTopology topology = new DEFGHILTopology();
BroadcastDomain domain = new BroadcastDomain();
domain.addBridge(new Bridge(topology.nodeDId));
domain.addBridge(new Bridge(topology.nodeEId));
domain.addBridge(new Bridge(topology.nodeFId));
domain.addBridge(new Bridge(topology.nodeGId));
domain.addBridge(new Bridge(topology.nodeHId));
domain.addBridge(new Bridge(topology.nodeIId));
domain.addBridge(new Bridge(topology.nodeLId));
domain.setBridgeElements(topology.elemlist);
NodeDiscoveryBridgeTopology ndbt = new NodeDiscoveryBridgeTopology(linkd, new Node(topology.nodeDId, null, null, null, location));
ndbt.setDomain(domain);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeFId), topology.bftF);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeGId), topology.bftG);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeHId), topology.bftH);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeIId), topology.bftI);
ndbt.addUpdatedBFT(domain.getBridge(topology.nodeLId), topology.bftL);
ndbt.calculate();
topology.check(ndbt.getDomain().getTopology());
domain.hierarchySetUp(domain.getBridge(topology.nodeGId));
assertEquals(topology.nodeGId, ndbt.getDomain().getRootBridgeId());
assertEquals(true, ndbt.getDomain().getBridge(topology.nodeGId).isRootBridge());
assertEquals(null, ndbt.getDomain().getBridge(topology.nodeGId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeDId).isRootBridge());
assertEquals(topology.portDD, ndbt.getDomain().getBridge(topology.nodeDId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeEId).isRootBridge());
assertEquals(topology.portEE, ndbt.getDomain().getBridge(topology.nodeEId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeFId).isRootBridge());
assertEquals(topology.portFF, ndbt.getDomain().getBridge(topology.nodeFId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeHId).isRootBridge());
assertEquals(topology.portHH, ndbt.getDomain().getBridge(topology.nodeHId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeIId).isRootBridge());
assertEquals(topology.portII, ndbt.getDomain().getBridge(topology.nodeIId).getRootPort());
assertEquals(false, ndbt.getDomain().getBridge(topology.nodeLId).isRootBridge());
assertEquals(topology.portLL, ndbt.getDomain().getBridge(topology.nodeLId).getRootPort());
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyBCAED.
@Test
public void testFiveSwitchTopologyBCAED() {
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 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 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();
topology.check(domain);
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyBEDCADBAEC.
@Test
public void testFiveSwitchTopologyBEDCADBAEC() {
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);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
topology.check(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
topology.check(domain);
ndbtA.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
ndbtA.calculate();
topology.check(domain);
ndbtE.addUpdatedBFT(domain.getBridge(topology.nodeEId), topology.bftE);
ndbtE.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 testFiveSwitchTopologyBCADEBD.
@Test
public void testFiveSwitchTopologyBCADEBD() {
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 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 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 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();
topology.check(domain);
ndbtB.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
ndbtB.calculate();
topology.check(domain);
ndbtD.addUpdatedBFT(domain.getBridge(topology.nodeDId), topology.bftD);
ndbtD.calculate();
topology.check(domain);
}
use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.
the class BroadcastDomainTest method testFiveSwitchTopologyBEDCA.
@Test
public void testFiveSwitchTopologyBEDCA() {
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);
}
Aggregations