Search in sources :

Example 1 with JniPinger

use of org.opennms.netmgt.icmp.jni.JniPinger in project opennms by OpenNMS.

the class IcmpDetectorTest method testDetectorFailJni.

@Test(timeout = 20000)
@IfProfileValue(name = "runPingTests", value = "true")
public void testDetectorFailJni() throws Exception {
    getPingerFactory().setInstance(0, true, new JniPinger());
    m_icmpDetector = m_detectorFactory.createDetector();
    assertFalse("ICMP was incorrectly identified on " + InetAddressUtils.UNPINGABLE_ADDRESS.getHostAddress(), m_icmpDetector.isServiceDetected(InetAddressUtils.UNPINGABLE_ADDRESS));
}
Also used : JniPinger(org.opennms.netmgt.icmp.jni.JniPinger) Test(org.junit.Test) IfProfileValue(org.springframework.test.annotation.IfProfileValue)

Example 2 with JniPinger

use of org.opennms.netmgt.icmp.jni.JniPinger in project opennms by OpenNMS.

the class IcmpDetectorTest method testDetectorSuccessJni.

@Test(timeout = 20000)
@IfProfileValue(name = "runPingTests", value = "true")
public void testDetectorSuccessJni() throws Exception {
    getPingerFactory().setInstance(0, true, new JniPinger());
    m_icmpDetector = m_detectorFactory.createDetector();
    assertTrue("ICMP could not be detected on localhost", m_icmpDetector.isServiceDetected(InetAddress.getLocalHost()));
}
Also used : JniPinger(org.opennms.netmgt.icmp.jni.JniPinger) Test(org.junit.Test) IfProfileValue(org.springframework.test.annotation.IfProfileValue)

Example 3 with JniPinger

use of org.opennms.netmgt.icmp.jni.JniPinger in project opennms by OpenNMS.

the class Jni6Pinger method initialize4.

@Override
public synchronized void initialize4() throws Exception {
    if (m_jniPinger != null)
        return;
    try {
        m_jniPinger = new JniPinger();
        m_jniPinger.initialize4();
    } catch (final Exception e) {
        m_v4Error = e;
        throw e;
    }
}
Also used : JniPinger(org.opennms.netmgt.icmp.jni.JniPinger) IOException(java.io.IOException)

Example 4 with JniPinger

use of org.opennms.netmgt.icmp.jni.JniPinger in project opennms by OpenNMS.

the class IcmpDetectorTest method testDetectorSuccessJniDscp.

@Test(timeout = 20000)
@IfProfileValue(name = "runPingTests", value = "true")
public void testDetectorSuccessJniDscp() throws Exception {
    getPingerFactory().setInstance(0x24, true, new JniPinger());
    m_icmpDetector = m_detectorFactory.createDetector();
    assertTrue("ICMP could not be detected on localhost", m_icmpDetector.isServiceDetected(InetAddress.getLocalHost()));
}
Also used : JniPinger(org.opennms.netmgt.icmp.jni.JniPinger) Test(org.junit.Test) IfProfileValue(org.springframework.test.annotation.IfProfileValue)

Aggregations

JniPinger (org.opennms.netmgt.icmp.jni.JniPinger)4 Test (org.junit.Test)3 IfProfileValue (org.springframework.test.annotation.IfProfileValue)3 IOException (java.io.IOException)1