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);
}
Aggregations