Search in sources :

Example 16 with BroadcastDomain

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());
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 17 with BroadcastDomain

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);
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 18 with BroadcastDomain

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);
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 19 with BroadcastDomain

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);
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 20 with BroadcastDomain

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);
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Aggregations

BroadcastDomain (org.opennms.netmgt.model.topology.BroadcastDomain)56 Test (org.junit.Test)48 Bridge (org.opennms.netmgt.model.topology.Bridge)45 BridgeMacLink (org.opennms.netmgt.model.BridgeMacLink)10 BridgeBridgeLink (org.opennms.netmgt.model.BridgeBridgeLink)8 SharedSegment (org.opennms.netmgt.model.topology.SharedSegment)8 OnmsNode (org.opennms.netmgt.model.OnmsNode)5 HashSet (java.util.HashSet)4 ArrayList (java.util.ArrayList)3 NetworkBuilder (org.opennms.netmgt.model.NetworkBuilder)3 Nms10205bNetworkBuilder (org.opennms.netmgt.nb.Nms10205bNetworkBuilder)3 Nms17216NetworkBuilder (org.opennms.netmgt.nb.Nms17216NetworkBuilder)3 List (java.util.List)2 Set (java.util.Set)2 OnmsMonitoringLocation (org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 CopyOnWriteArraySet (java.util.concurrent.CopyOnWriteArraySet)1 AbstractVertex (org.opennms.features.topology.api.topo.AbstractVertex)1 Vertex (org.opennms.features.topology.api.topo.Vertex)1