Search in sources :

Example 1 with SLAEmailEventListener

use of org.apache.oozie.sla.listener.SLAEmailEventListener in project oozie by apache.

the class TestSLAEmailEventListener method setUp.

@Before
@Override
protected void setUp() throws Exception {
    super.setUp();
    services = new Services();
    conf = services.getConf();
    conf.set(EmailActionExecutor.EMAIL_SMTP_HOST, "localhost");
    conf.set(EmailActionExecutor.EMAIL_SMTP_PORT, String.valueOf(SMTP_TEST_PORT));
    conf.set(EmailActionExecutor.EMAIL_SMTP_AUTH, "false");
    conf.set(EmailActionExecutor.EMAIL_SMTP_USER, "");
    conf.set(EmailActionExecutor.EMAIL_SMTP_PASS, "");
    conf.set(EmailActionExecutor.EMAIL_SMTP_FROM, "oozie@localhost");
    conf.set(SLAEmailEventListener.BLACKLIST_CACHE_TIMEOUT, "1");
    conf.set(SLAEmailEventListener.BLACKLIST_FAIL_COUNT, "2");
    conf.set(SLAService.CONF_ALERT_EVENTS, SLAEvent.EventStatus.START_MISS.name() + "," + SLAEvent.EventStatus.END_MISS + "," + SLAEvent.EventStatus.DURATION_MISS);
    greenMail = new GreenMail(new ServerSetup(SMTP_TEST_PORT, null, "smtp"));
    greenMail.start();
    services.init();
    slaEmailListener = new SLAEmailEventListener();
    slaEmailListener.init(conf);
}
Also used : Services(org.apache.oozie.service.Services) GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) SLAEmailEventListener(org.apache.oozie.sla.listener.SLAEmailEventListener) Before(org.junit.Before)

Aggregations

GreenMail (com.icegreen.greenmail.util.GreenMail)1 ServerSetup (com.icegreen.greenmail.util.ServerSetup)1 Services (org.apache.oozie.service.Services)1 SLAEmailEventListener (org.apache.oozie.sla.listener.SLAEmailEventListener)1 Before (org.junit.Before)1