use of org.mortbay.jetty.Server in project nhin-d by DirectProject.
the class RoutingResolverImplTest method startService.
private void startService() throws Exception {
/*
* Setup the configuration service server
*/
server = new Server();
SocketConnector connector = new SocketConnector();
HTTPPort = AvailablePortFinder.getNextAvailable(1024);
connector.setPort(HTTPPort);
WebAppContext context = new WebAppContext();
context.setContextPath("/config");
context.setServer(server);
context.setWar("war/config-service.war");
server.setSendServerVersion(false);
server.addConnector(connector);
server.addHandler(context);
server.start();
configServiceURL = "http://localhost:" + HTTPPort + "/config/ConfigurationService";
proxy = new ConfigurationServiceProxy(configServiceURL);
cleanConfig();
}
use of org.mortbay.jetty.Server in project nhin-d by DirectProject.
the class ServiceRunner method startServices.
public static synchronized void startServices() 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.Server in project nhin-d by DirectProject.
the class MonitorServiceRunner method startMonitorService.
public static synchronized void startMonitorService() throws Exception {
if (server == null) {
/*
* Setup the configuration service server
*/
server = new Server();
SocketConnector connector = new SocketConnector();
HTTPPort = AvailablePortFinder.getNextAvailable(8090);
connector.setPort(HTTPPort);
// certificate service
WebAppContext context = new WebAppContext("src/test/resources/webapp-liverun", "/");
server.setSendServerVersion(false);
server.addConnector(connector);
server.addHandler(context);
server.start();
serviceURL = "http://localhost:" + HTTPPort + "/";
}
}
use of org.mortbay.jetty.Server in project roboguice by roboguice.
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.Server in project jackrabbit by apache.
the class LitmusTest method testLitmus.
public void testLitmus() throws Exception {
File dir = new File("target", "litmus");
String litmus = System.getProperty("litmus", "litmus");
if (Boolean.getBoolean("jackrabbit.test.integration") && isLitmusAvailable(litmus)) {
final Repository repository = JcrUtils.getRepository("jcr-jackrabbit://" + Text.escapePath(dir.getCanonicalPath()));
// for the TransientRepository
Session session = repository.login();
try {
SocketConnector connector = new SocketConnector();
connector.setHost("localhost");
connector.setPort(Integer.getInteger("litmus.port", 0));
Server server = new Server();
server.addConnector(connector);
ServletHolder holder = new ServletHolder(new SimpleWebdavServlet() {
@Override
public Repository getRepository() {
return repository;
}
});
holder.setInitParameter("resource-config", "/config.xml");
Context context = new Context(server, "/");
context.setResourceBase("src/test/resources");
context.addServlet(holder, "/*");
server.addHandler(context);
server.start();
try {
int port = connector.getLocalPort();
String url = "http://localhost:" + port + "/default";
ProcessBuilder builder = new ProcessBuilder(litmus, url, "admin", "admin");
builder.directory(dir);
builder.redirectErrorStream();
assertLitmus(builder, "basic", 0);
assertLitmus(builder, "http", 0);
assertLitmus(builder, "props", 0);
// FIXME: JCR-2637: WebDAV shallow copy test failure
assertLitmus(builder, "copymove", 1);
// FIXME: JCR-2638: Litmus locks test failures
assertLitmus(builder, "locks", 1);
} finally {
server.stop();
}
} finally {
session.logout();
}
}
}
Aggregations