Search in sources :

Example 6 with EmbeddedServletContainer

use of org.apache.oozie.test.EmbeddedServletContainer in project oozie by apache.

the class TestWorkflowNotificationXCommand method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    setSystemProperty(NotificationXCommand.NOTIFICATION_URL_CONNECTION_TIMEOUT_KEY, "50");
    Services services = new Services();
    services.init();
    container = new EmbeddedServletContainer("blah");
    container.addServletEndpoint("/hang/*", HangServlet.class);
    callbackServlet = new CallbackServlet();
    container.addServletEndpoint("/callback/*", callbackServlet);
    container.start();
}
Also used : Services(org.apache.oozie.service.Services) EmbeddedServletContainer(org.apache.oozie.test.EmbeddedServletContainer)

Example 7 with EmbeddedServletContainer

use of org.apache.oozie.test.EmbeddedServletContainer in project oozie by apache.

the class TestLauncherAMCallbackNotifier method setupEmbeddedContainer.

private Configuration setupEmbeddedContainer(Class<? extends Servlet> servletClass, String servletEndPoint, String servletUrl, Map<String, String> params) throws Exception {
    container = new EmbeddedServletContainer("test");
    if (servletEndPoint != null) {
        if (params != null) {
            container.addServletEndpoint(servletEndPoint, servletClass, params);
        } else {
            container.addServletEndpoint(servletEndPoint, servletClass);
        }
    }
    container.start();
    Configuration conf = new Configuration(false);
    conf.set(LauncherAMCallbackNotifier.OOZIE_LAUNCHER_CALLBACK_RETRY_ATTEMPTS, "0");
    conf.set(LauncherAMCallbackNotifier.OOZIE_LAUNCHER_CALLBACK_MAX_ATTEMPTS, "1");
    conf.set(LauncherAMCallbackNotifier.OOZIE_LAUNCHER_CALLBACK_URL, container.getServletURL(servletUrl));
    conf.set(LauncherAMCallbackNotifier.OOZIE_LAUNCHER_CALLBACK_RETRY_INTERVAL, "5000");
    return conf;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) EmbeddedServletContainer(org.apache.oozie.test.EmbeddedServletContainer)

Example 8 with EmbeddedServletContainer

use of org.apache.oozie.test.EmbeddedServletContainer in project oozie by apache.

the class TestDagEngine method setUp.

protected void setUp() throws Exception {
    super.setUp();
    CallbackServlet.reset();
    container = new EmbeddedServletContainer("oozie");
    container.addServletEndpoint("/callback", CallbackServlet.class);
    container.start();
    setSystemProperty(SchemaService.WF_CONF_EXT_SCHEMAS, "wf-ext-schema.xsd");
    services = new Services();
    services.init();
    services.get(ActionService.class).registerAndInitExecutor(ForTestingActionExecutor.class);
}
Also used : Services(org.apache.oozie.service.Services) EmbeddedServletContainer(org.apache.oozie.test.EmbeddedServletContainer) ActionService(org.apache.oozie.service.ActionService)

Example 9 with EmbeddedServletContainer

use of org.apache.oozie.test.EmbeddedServletContainer in project oozie by apache.

the class TestCoordActionNotificationXCommand method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    setSystemProperty(NotificationXCommand.NOTIFICATION_URL_CONNECTION_TIMEOUT_KEY, "50");
    Services services = new Services();
    services.init();
    container = new EmbeddedServletContainer("blah");
    container.addServletEndpoint("/hang/*", HangServlet.class);
    container.start();
}
Also used : Services(org.apache.oozie.service.Services) EmbeddedServletContainer(org.apache.oozie.test.EmbeddedServletContainer)

Example 10 with EmbeddedServletContainer

use of org.apache.oozie.test.EmbeddedServletContainer in project oozie by apache.

the class TestHAShareLibService method setUp.

protected void setUp() throws Exception {
    super.setUp();
    container = new EmbeddedServletContainer("oozie");
    container.addServletEndpoint("/v2/admin/*", V2AdminServlet.class);
    container.addServletEndpoint("/other-oozie-server/*", DummyV2AdminServlet.class);
    container.addFilter("*", HostnameFilter.class);
    container.start();
    Services.get().setService(ShareLibService.class);
    Services.get().getConf().setBoolean(AuthorizationService.CONF_SECURITY_ENABLED, false);
    Services.get().setService(ZKJobsConcurrencyService.class);
    Path launcherlibPath = Services.get().get(WorkflowAppService.class).getSystemLibPath();
    HadoopAccessorService has = Services.get().get(HadoopAccessorService.class);
    URI uri = launcherlibPath.toUri();
    fs = FileSystem.get(has.createConfiguration(uri.getAuthority()));
    Date time = new Date(System.currentTimeMillis());
    Path basePath = new Path(Services.get().getConf().get(WorkflowAppService.SYSTEM_LIB_PATH));
    Path libpath = new Path(basePath, ShareLibService.SHARE_LIB_PREFIX + ShareLibService.dateFormat.format(time));
    fs.mkdirs(libpath);
    Path pigPath = new Path(libpath.toString() + Path.SEPARATOR + "pig");
    Path pigPath1 = new Path(libpath.toString() + Path.SEPARATOR + "pig_9");
    Path pigPath2 = new Path(libpath.toString() + Path.SEPARATOR + "pig_10");
    fs.mkdirs(pigPath);
    fs.mkdirs(pigPath1);
    fs.mkdirs(pigPath2);
    fs.create(new Path(libpath.toString() + Path.SEPARATOR + "pig_10" + Path.SEPARATOR + "pig-10.jar")).close();
}
Also used : Path(org.apache.hadoop.fs.Path) EmbeddedServletContainer(org.apache.oozie.test.EmbeddedServletContainer) URI(java.net.URI) Date(java.util.Date)

Aggregations

EmbeddedServletContainer (org.apache.oozie.test.EmbeddedServletContainer)13 Services (org.apache.oozie.service.Services)8 File (java.io.File)3 FileOutputStream (java.io.FileOutputStream)3 FileWriter (java.io.FileWriter)3 InputStream (java.io.InputStream)3 Properties (java.util.Properties)3 XLogFilter (org.apache.oozie.util.XLogFilter)3 Date (java.util.Date)2 URI (java.net.URI)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Configuration (org.apache.hadoop.conf.Configuration)1 Path (org.apache.hadoop.fs.Path)1 ActionService (org.apache.oozie.service.ActionService)1