Search in sources :

Example 11 with BroadcastDomain

use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.

the class BroadcastDomainTest method testTwoBridgeTwoCalculation.

@Test
public void testTwoBridgeTwoCalculation() {
    TwoNodeTopology topology = new TwoNodeTopology();
    BroadcastDomain domain = new BroadcastDomain();
    domain.addBridge(new Bridge(topology.nodeBId));
    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.nodeBId), topology.bftB);
    ndbt.calculate();
    printBridgeTopology(ndbt.getDomain());
    List<SharedSegment> shsegs = ndbt.getDomain().getTopology();
    assertEquals(3, shsegs.size());
    domain.addBridge(new Bridge(topology.nodeAId));
    domain.setBridgeElements(topology.elemlist);
    ndbt.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
    ndbt.calculate();
    topology.check2nodeTopology(ndbt.getDomain(), true);
    assertEquals(topology.nodeBId, 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 12 with BroadcastDomain

use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.

the class BroadcastDomainTest method testDF.

@Test
public void testDF() {
    DEFGHILTopology topology = new DEFGHILTopology();
    BroadcastDomain domain = new BroadcastDomain();
    domain.addBridge(new Bridge(topology.nodeDId));
    domain.addBridge(new Bridge(topology.nodeFId));
    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.nodeFId), topology.bftF);
    ndbt.calculate();
    topology.checkDF(ndbt.getDomain());
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 13 with BroadcastDomain

use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.

the class BroadcastDomainTest method testCB.

@Test
public void testCB() {
    ABCTopology topology = new ABCTopology();
    BroadcastDomain domain = new BroadcastDomain();
    domain.addBridge(new Bridge(topology.nodeCId));
    domain.addBridge(new Bridge(topology.nodeBId));
    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.addUpdatedBFT(domain.getBridge(topology.nodeBId), topology.bftB);
    ndbt.calculate();
    topology.checkBC(ndbt.getDomain());
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 14 with BroadcastDomain

use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.

the class BroadcastDomainTest method testDEFG.

@Test
public void testDEFG() {
    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.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.calculate();
    topology.checkDEFG(ndbt.getDomain());
}
Also used : BroadcastDomain(org.opennms.netmgt.model.topology.BroadcastDomain) Bridge(org.opennms.netmgt.model.topology.Bridge) Test(org.junit.Test)

Example 15 with BroadcastDomain

use of org.opennms.netmgt.model.topology.BroadcastDomain in project opennms by OpenNMS.

the class BroadcastDomainTest method testBA.

@Test
public void testBA() {
    ABCTopology topology = new ABCTopology();
    BroadcastDomain domain = new BroadcastDomain();
    domain.addBridge(new Bridge(topology.nodeBId));
    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.nodeBId), topology.bftB);
    ndbt.addUpdatedBFT(domain.getBridge(topology.nodeAId), topology.bftA);
    ndbt.calculate();
    topology.checkAB(ndbt.getDomain());
}
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)46 Test (org.junit.Test)39 Bridge (org.opennms.netmgt.model.topology.Bridge)36 BridgeMacLink (org.opennms.netmgt.model.BridgeMacLink)9 SharedSegment (org.opennms.netmgt.model.topology.SharedSegment)7 BridgeBridgeLink (org.opennms.netmgt.model.BridgeBridgeLink)6 OnmsNode (org.opennms.netmgt.model.OnmsNode)4 HashSet (java.util.HashSet)3 NetworkBuilder (org.opennms.netmgt.model.NetworkBuilder)3 Nms10205bNetworkBuilder (org.opennms.netmgt.nb.Nms10205bNetworkBuilder)3 Nms17216NetworkBuilder (org.opennms.netmgt.nb.Nms17216NetworkBuilder)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 List (java.util.List)1 Set (java.util.Set)1 AbstractVertex (org.opennms.features.topology.api.topo.AbstractVertex)1 Vertex (org.opennms.features.topology.api.topo.Vertex)1 ReadyRunnable (org.opennms.netmgt.enlinkd.scheduler.ReadyRunnable)1 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)1 OnmsMonitoringLocation (org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)1