Search in sources :

Example 1 with SeleniumMonitor

use of org.opennms.netmgt.poller.monitors.SeleniumMonitor in project opennms by OpenNMS.

the class SeleniumMonitorTest method testPollStatusNotNull.

// Requires Firefox to be installed to run
@Test
@JUnitHttpServer(port = 10342, webapps = @Webapp(context = "/opennms", path = "src/test/resources/testWar"))
public void testPollStatusNotNull() throws UnknownHostException {
    MonitoredService monSvc = new MockMonitoredService(1, "papajohns", InetAddressUtils.addr("213.187.33.164"), "PapaJohnsSite");
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("selenium-test", "SeleniumGroovyTest.groovy");
    params.put("base-url", "localhost");
    params.put("port", "10342");
    SeleniumMonitor ajaxPSM = new SeleniumMonitor();
    PollStatus pollStatus = ajaxPSM.poll(monSvc, params);
    assertNotNull("PollStatus must not be null", pollStatus);
    System.err.println("PollStatus message: " + pollStatus.getReason());
    assertEquals(PollStatus.available(), pollStatus);
}
Also used : PollStatus(org.opennms.netmgt.poller.PollStatus) MockMonitoredService(org.opennms.netmgt.poller.mock.MockMonitoredService) HashMap(java.util.HashMap) MonitoredService(org.opennms.netmgt.poller.MonitoredService) MockMonitoredService(org.opennms.netmgt.poller.mock.MockMonitoredService) SeleniumMonitor(org.opennms.netmgt.poller.monitors.SeleniumMonitor) Test(org.junit.Test) JUnitHttpServer(org.opennms.core.test.http.annotations.JUnitHttpServer)

Aggregations

HashMap (java.util.HashMap)1 Test (org.junit.Test)1 JUnitHttpServer (org.opennms.core.test.http.annotations.JUnitHttpServer)1 MonitoredService (org.opennms.netmgt.poller.MonitoredService)1 PollStatus (org.opennms.netmgt.poller.PollStatus)1 MockMonitoredService (org.opennms.netmgt.poller.mock.MockMonitoredService)1 SeleniumMonitor (org.opennms.netmgt.poller.monitors.SeleniumMonitor)1