Search in sources :

Example 41 with Services

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();
}
Also used : Services(org.apache.oozie.service.Services) Configuration(org.apache.hadoop.conf.Configuration) ConfigurationService(org.apache.oozie.service.ConfigurationService) JPAService(org.apache.oozie.service.JPAService) Before(org.junit.Before)

Example 42 with Services

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

Example 43 with Services

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();
}
Also used : Services(org.apache.oozie.service.Services)

Example 44 with Services

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;
}
Also used : Services(org.apache.oozie.service.Services)

Example 45 with 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();
            }
        }
    }
}
Also used : Services(org.apache.oozie.service.Services)

Aggregations

Services (org.apache.oozie.service.Services)247 JPAService (org.apache.oozie.service.JPAService)32 Configuration (org.apache.hadoop.conf.Configuration)21 Date (java.util.Date)17 CoordinatorJobBean (org.apache.oozie.CoordinatorJobBean)16 File (java.io.File)14 Before (org.junit.Before)14 XConfiguration (org.apache.oozie.util.XConfiguration)11 Path (org.apache.hadoop.fs.Path)10 ActionExecutorException (org.apache.oozie.action.ActionExecutorException)10 CoordinatorActionBean (org.apache.oozie.CoordinatorActionBean)8 EmbeddedServletContainer (org.apache.oozie.test.EmbeddedServletContainer)8 FileOutputStream (java.io.FileOutputStream)7 InputStream (java.io.InputStream)7 HashMap (java.util.HashMap)7 IOException (java.io.IOException)6 Properties (java.util.Properties)6 ActionService (org.apache.oozie.service.ActionService)6 StringWriter (java.io.StringWriter)5 WorkflowActionBean (org.apache.oozie.WorkflowActionBean)5