Search in sources :

Example 31 with BroadcastDomain

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

Example 32 with BroadcastDomain

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

Example 33 with BroadcastDomain

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

Example 34 with BroadcastDomain

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

Example 35 with BroadcastDomain

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);
}
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