use of org.opennms.netmgt.poller.PollStatus in project opennms by OpenNMS.
the class MailTransportMonitorTest method readOnlyTest.
/*
* requires a gmail account that has a message in the INBOX subject: READTEST
*/
@Test
@Ignore("requires real mail server")
public void readOnlyTest() throws Exception {
m_params.put("timeout", "3000");
m_params.put("retry", "1");
m_params.put("strict-timeouts", "true");
m_params.put("mail-transport-test", " <mail-transport-test >\n" + " <mail-test>\n" + " <readmail-test attempt-interval=\"2000\" mail-folder=\"INBOX\" subject-match=\"READTEST\" >\n" + " <readmail-host host=\"imap.gmail.com\" port=\"993\">\n" + " <readmail-protocol ssl-enable=\"true\" transport=\"imaps\" />\n" + " </readmail-host>\n" + " <user-auth user-name=\"username\" password=\"password\"/>\n" + " </readmail-test>\n" + " </mail-test>\n" + " </mail-transport-test>\n");
PollStatus status = m_monitor.poll(getMailService("127.0.0.1"), m_params);
assertEquals(PollStatus.SERVICE_AVAILABLE, status.getStatusCode());
}
use of org.opennms.netmgt.poller.PollStatus in project opennms by OpenNMS.
the class NetScalerGroupHealthMonitorTest method testAvailable.
@Test
public void testAvailable() throws Exception {
PollStatus status = monitor.poll(createMonitor(), createBasicParams());
Assert.assertTrue(status.isAvailable());
}
use of org.opennms.netmgt.poller.PollStatus in project opennms by OpenNMS.
the class HostResourceSWRunMonitorTest method testMaxServices.
@Test
public void testMaxServices() throws Exception {
Map<String, Object> parameters = createBasicParams();
parameters.put("max-services", "5");
PollStatus status = monitor.poll(createMonitor(), parameters);
Assert.assertTrue(status.isAvailable());
}
use of org.opennms.netmgt.poller.PollStatus in project opennms by OpenNMS.
the class HostResourceSWRunMonitorTest method testUnknownService.
@Test
public void testUnknownService() throws Exception {
Map<String, Object> parameters = createBasicParams();
parameters.put("service-name", "this service does not exist!");
PollStatus status = monitor.poll(createMonitor(), parameters);
Assert.assertFalse(status.isAvailable());
log(status.getReason());
}
use of org.opennms.netmgt.poller.PollStatus in project opennms by OpenNMS.
the class HostResourceSWRunMonitorTest method testMinServices.
@Test
public void testMinServices() throws Exception {
Map<String, Object> parameters = createBasicParams();
parameters.put("min-services", "2");
PollStatus status = monitor.poll(createMonitor(), parameters);
Assert.assertTrue(status.isAvailable());
}
Aggregations