Search in sources :

Example 1 with AckReader

use of org.opennms.netmgt.ackd.AckReader in project opennms by OpenNMS.

the class JavaMailAckReaderIT method findAndProcessAcks.

@Ignore
@Test
public void findAndProcessAcks() throws InterruptedException {
    AckReader reader = new DefaultAckReader();
    ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
    reader.setAckProcessor(m_processor);
    Future<?> f = executor.schedule(m_processor, 5, TimeUnit.SECONDS);
    m_processor.setJmConfigDao(m_jmDao);
    m_processor.setAckdConfigDao(createAckdConfigDao());
    //Thread.sleep(20000);
    while (!f.isDone()) {
        Thread.sleep(10);
    }
    Assert.assertTrue(f.isDone());
}
Also used : AckReader(org.opennms.netmgt.ackd.AckReader) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 AckReader (org.opennms.netmgt.ackd.AckReader)1