use of org.mortbay.jetty.webapp.WebAppContext in project hudson-2.x by hudson.
the class HudsonTestCase method createWebServer.
/**
* Prepares a webapp hosting environment to get {@link ServletContext} implementation
* that we need for testing.
*/
protected ServletContext createWebServer() throws Exception {
server = new Server();
WebAppContext context = new WebAppContext(WarExploder.getExplodedDir().getPath(), contextPath);
context.setClassLoader(getClass().getClassLoader());
context.setConfigurations(new Configuration[] { new WebXmlConfiguration(), new NoListenerConfiguration() });
server.setHandler(context);
context.setMimeTypes(MIME_TYPES);
SocketConnector connector = new SocketConnector();
server.addConnector(connector);
server.addUserRealm(configureUserRealm());
server.start();
localPort = connector.getLocalPort();
return context.getServletContext();
}
use of org.mortbay.jetty.webapp.WebAppContext in project guice by google.
the class Main method main.
public static void main(String[] args) throws Exception {
Server server = new Server();
Connector connector = new SelectChannelConnector();
connector.setPort(8080);
server.setConnectors(new Connector[] { connector });
WebAppContext webapp = new WebAppContext("./root", "/example");
server.addHandler(webapp);
server.start();
server.join();
}
use of org.mortbay.jetty.webapp.WebAppContext in project nhin-d by DirectProject.
the class ConfigServiceRunner method startConfigService.
public static synchronized void startConfigService() throws Exception {
if (server == null) {
/*
* Setup the configuration service server
*/
server = new Server();
SocketConnector connector = new SocketConnector();
HTTPPort = AvailablePortFinder.getNextAvailable(8081);
connector.setPort(HTTPPort);
// certificate service
WebAppContext context = new WebAppContext("src/main/webapp", "/config-service");
server.setSendServerVersion(false);
server.addConnector(connector);
server.addHandler(context);
server.start();
serviceURL = "http://localhost:" + HTTPPort + "/";
}
}
use of org.mortbay.jetty.webapp.WebAppContext in project nhin-d by DirectProject.
the class TxsServiceRunner method startTxsService.
public static synchronized void startTxsService() throws Exception {
if (server == null) {
/*
* Setup the configuration service server
*/
server = new Server();
SocketConnector connector = new SocketConnector();
HTTPPort = AvailablePortFinder.getNextAvailable(1024);
connector.setPort(HTTPPort);
WebAppContext context = new WebAppContext("src/test/resources/webapp", "/");
server.setSendServerVersion(false);
server.addConnector(connector);
server.addHandler(context);
server.start();
txsServiceURL = "http://localhost:" + HTTPPort + "/";
}
}
use of org.mortbay.jetty.webapp.WebAppContext in project nhin-d by DirectProject.
the class ConfigServiceRunner method startConfigService.
public static synchronized void startConfigService() throws Exception {
if (server == null) {
/*
* Setup the configuration service server
*/
server = new Server();
SocketConnector connector = new SocketConnector();
HTTPPort = AvailablePortFinder.getNextAvailable(1024);
connector.setPort(HTTPPort);
WebAppContext context = new WebAppContext("src/test/resources/webapp", "/");
server.setSendServerVersion(false);
server.addConnector(connector);
server.addHandler(context);
server.start();
configServiceURL = "http://localhost:" + HTTPPort + "/ConfigurationService";
restAPIBaseURL = "http://localhost:" + HTTPPort + "/api";
}
}
Aggregations