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