EmailReader.PARAM_WAIT, 5, EmailReader.PARAM_SERVER, greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com", EmailReader.PARAM_PASS, "password",
greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com",
greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com",
@Test public void testPopNoMessages() throws Exception { BaleenCollectionReader bcr = getCollectionReader( EmailReader.PARAM_PROTOCOL, "pop3", EmailReader.PARAM_WAIT, 5, EmailReader.PARAM_SERVER, greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com", EmailReader.PARAM_PASS, "password"); bcr.initialize(); assertFalse(bcr.doHasNext()); bcr.close(); }
greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com",
greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com",
@Test public void testPopWait() throws Exception { BaleenCollectionReader bcr = getCollectionReader( EmailReader.PARAM_PROTOCOL, "pop3", EmailReader.PARAM_WAIT, 5, EmailReader.PARAM_SERVER, greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com", EmailReader.PARAM_PASS, "password", EmailReader.PARAM_PROCESS, "content"); bcr.initialize(); assertFalse(bcr.doHasNext()); GreenMailUtil.sendTextEmailTest( "to@localhost.com", "from@localhost.com", GreenMailUtil.random(), GreenMailUtil.random()); assertFalse(bcr.doHasNext()); // Should be a 5 second delay before it returns true Thread.sleep(5000); assertTrue(bcr.doHasNext()); bcr.close(); }
EmailReader.PARAM_WAIT, 5, EmailReader.PARAM_SERVER, greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com", EmailReader.PARAM_PASS, "password",
@Test public void testPopLongWait() throws Exception { String subject = GreenMailUtil.random(); String body = GreenMailUtil.random(); String subject2 = GreenMailUtil.random(); String body2 = GreenMailUtil.random(); GreenMailUtil.sendTextEmailTest("to@localhost.com", "from@localhost.com", subject, body); GreenMailUtil.sendTextEmailTest("to@localhost.com", "from@localhost.com", subject2, body2); BaleenCollectionReader bcr = getCollectionReader( EmailReader.PARAM_PROTOCOL, "pop3", EmailReader.PARAM_WAIT, 15, EmailReader.PARAM_SERVER, greenMail.getPop3().getBindTo(), EmailReader.PARAM_PORT, greenMail.getPop3().getPort(), EmailReader.PARAM_USER, "to@localhost.com", EmailReader.PARAM_PASS, "password", EmailReader.PARAM_PROCESS, "content"); bcr.initialize(); assertTrue(bcr.doHasNext()); bcr.getNext(jCas); jCas.reset(); Thread.sleep(20000); assertTrue(bcr.doHasNext()); bcr.getNext(jCas); jCas.reset(); assertFalse(bcr.doHasNext()); bcr.close(); }