use of org.mortbay.jetty.servlet.Context in project tests by datanucleus.
the class BasicTest method setUp.
protected void setUp() throws Exception {
LOG.info("********** " + toString() + " [setUp] **********");
super.setUp();
server = new Server(PORT);
Context root = new Context(server, "/", Context.SESSIONS);
ServletHolder holder = new ServletHolder(new RestServlet());
// TODO Set this based on which datastore in use
holder.setInitParameter("persistence-context", "h2-backend");
root.addServlet(holder, "/dn/*");
server.start();
}
use of org.mortbay.jetty.servlet.Context in project tests by datanucleus.
the class JSONTestCase method setUp.
protected void setUp() throws Exception {
super.setUp();
if (storeMgr.getStoreManagerKey().equals("json")) {
if (server == null) {
server = new Server(21212);
Context root = new Context(server, "/", Context.SESSIONS);
Map params = new HashMap();
params.put("com.sun.jersey.config.property.packages", "org.datanucleus.tests.rest");
root.setInitParams(params);
ServletHolder holder = new ServletHolder(ServletContainer.class);
holder.setInitParameters(params);
root.addServlet(holder, "/*");
server.start();
holder.start();
while (!holder.isStarted()) {
Thread.sleep(2000);
}
}
}
}
use of org.mortbay.jetty.servlet.Context in project onebusaway-application-modules by camsys.
the class DynamicFederatedServiceCollectionImplTest method addServiceServlet.
private SimpleFederatedServiceImpl addServiceServlet(Server server, String agencyId, CoordinateBounds bounds) {
Map<String, List<CoordinateBounds>> agenciesA = new HashMap<String, List<CoordinateBounds>>();
agenciesA.put(agencyId, Arrays.asList(bounds));
SimpleFederatedServiceImpl serviceA = new SimpleFederatedServiceImpl(agenciesA, agencyId);
HessianServlet servletA = new HessianServlet();
servletA.setHome(serviceA);
servletA.setHomeAPI(SimpleFederatedService.class);
Context contextA = new Context(server, "/service-" + agencyId, Context.SESSIONS);
contextA.addServlet(new ServletHolder(servletA), "/*");
return serviceA;
}
use of org.mortbay.jetty.servlet.Context in project ghostdriver by detro.
the class CallbackHttpServer method start.
public void start() throws Exception {
server = new Server(0);
Context context = new Context(server, "/");
addServlets(context);
server.start();
}
Aggregations