Search in sources :

Example 16 with IPAddressRange

use of org.opennms.core.network.IPAddressRange in project opennms by OpenNMS.

the class SnmpEventInfoTest method testPreceedsRange.

@Test
public void testPreceedsRange() {
    IPAddressRange r = new IPAddressRange("192.168.1.10", "192.168.1.20");
    assertTrue(r.comesBefore(new IPAddressRange("192.168.1.21", "192.168.1.30")));
    assertTrue(r.comesBefore(new IPAddressRange("192.168.1.21", "192.168.1.21")));
    assertFalse(r.comesBefore(new IPAddressRange("192.168.1.20", "192.168.1.30")));
    assertFalse(r.comesBefore(new IPAddressRange("192.168.1.7", "192.168.1.9")));
}
Also used : IPAddressRange(org.opennms.core.network.IPAddressRange) Test(org.junit.Test)

Aggregations

IPAddressRange (org.opennms.core.network.IPAddressRange)16 Test (org.junit.Test)13 IPAddress (org.opennms.core.network.IPAddress)2 IPAddressRangeSet (org.opennms.core.network.IPAddressRangeSet)2 Range (org.opennms.netmgt.config.snmp.Range)2 SnmpEventInfo (org.opennms.netmgt.config.SnmpEventInfo)1 EventHandler (org.opennms.netmgt.events.api.annotations.EventHandler)1 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1