use of org.apache.oozie.service.Services in project oozie by apache.
the class TestSLACalculatorMemory method setUp.
@Override
@Before
protected void setUp() throws Exception {
super.setUp();
services = new Services();
Configuration conf = services.get(ConfigurationService.class).getConf();
conf.set(Services.CONF_SERVICE_EXT_CLASSES, "org.apache.oozie.service.EventHandlerService," + "org.apache.oozie.sla.service.SLAService," + "org.apache.oozie.service.InstrumentationService");
conf.setInt(SLAService.CONF_SLA_CHECK_INTERVAL, 600);
services.init();
jpaService = services.get(JPAService.class);
instrumentation = services.get(InstrumentationService.class).get();
}
use of org.apache.oozie.service.Services 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);
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class TestLiteWorkflowApp method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
new Services().init();
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class XTestCase method setupServicesForHCatalog.
protected Services setupServicesForHCatalog() throws ServiceException {
Services services = new Services();
setupServicesForHCataLogImpl(services);
return services;
}
use of org.apache.oozie.service.Services in project oozie by apache.
the class XTestCase method cleanUpDBTables.
/**
* Cleans up all database tables. Tests won't typically need to call this directly because {@link #setUp()} will automatically
* call it before each test.
*
* @throws Exception
*/
protected final void cleanUpDBTables() throws Exception {
// the Services; so just cleanup the database
if (Services.get() != null) {
cleanUpDBTablesInternal();
} else {
// we don't want to interfere
try {
Services services = new Services();
services.getConf().set(Services.CONF_SERVICE_CLASSES, MINIMAL_SERVICES_FOR_DB_CLEANUP);
services.init();
cleanUpDBTablesInternal();
} finally {
if (Services.get() != null) {
Services.get().destroy();
}
}
}
}
Aggregations