httpServer.start(); LOG.info("Web app " + webApp.name() + " started at " + httpServer.getConnectorAddress(0).getPort());
httpServer.start(); LOG.info("Web app " + webApp.name() + " started at " + httpServer.getConnectorAddress(0).getPort());
BlockScanner.Servlet.class); DataNodeUGIProvider.init(conf); this.infoServer.start(); final InetSocketAddress jettyAddr = infoServer.getConnectorAddress(0);
httpServer.addInternalServlet("getJournal", "/getJournal", GetJournalEditServlet.class, true); httpServer.start();
httpServer.setAttribute(JspHelper.CURRENT_CONF, conf); setupServlets(httpServer, conf); httpServer.start();
@Before public void setUp() throws Exception { new File(System.getProperty("build.webapps", "build/webapps") + "/test" ).mkdirs(); server = new HttpServer2.Builder().setName("test") .addEndpoint(URI.create("http://localhost:0")) .setFindPort(true).build(); server.addServlet("delay", "/delay", DelayServlet.class); server.addServlet("jobend", "/jobend", JobEndServlet.class); server.addServlet("fail", "/fail", FailServlet.class); server.start(); int port = server.getConnectorAddress(0).getPort(); baseUrl = new URL("http://localhost:" + port + "/"); JobEndServlet.calledTimes = 0; JobEndServlet.requestUri = null; DelayServlet.calledTimes = 0; FailServlet.calledTimes = 0; }
public void start() throws IOException { httpServer.start(); }
infoServer.addInternalServlet("imagetransfer", ImageServlet.PATH_SPEC, ImageServlet.class, true); infoServer.start();
public WebApp start(WebApp webapp) { WebApp webApp = build(webapp); HttpServer2 httpServer = webApp.httpServer(); try { httpServer.start(); LOG.info("Web app " + name + " started at " + httpServer.getConnectorAddress(0).getPort()); } catch (IOException e) { throw new WebAppException("Error starting http server", e); } return webApp; }
public WebApp start(WebApp webapp) { WebApp webApp = build(webapp); HttpServer2 httpServer = webApp.httpServer(); try { httpServer.start(); LOG.info("Web app " + name + " started at " + httpServer.getConnectorAddress(0).getPort()); } catch (IOException e) { throw new WebAppException("Error starting http server", e); } return webApp; }
/** * Create and start a server with the test webapp * * @return the newly started server * * @throws IOException on any failure * @throws AssertionError if a condition was not met */ public static HttpServer2 createAndStartTestServer() throws IOException { HttpServer2 server = createTestServer(); server.start(); return server; }
/** * Create and start a server with the test webapp * * @return the newly started server * * @throws IOException on any failure * @throws AssertionError if a condition was not met */ public static HttpServer2 createAndStartTestServer() throws IOException { HttpServer2 server = createTestServer(); server.start(); return server; }
public void start() throws IOException { httpServer.start(); DefaultMetricsSystem.initialize(processName); final JvmMetrics jm = JvmMetrics.initSingleton(processName, sessionId); jm.setPauseMonitor(pauseMonitor); pauseMonitor.start(); }
@Test public void testServletFilterWhenInitThrowsException() throws Exception { Configuration conf = new Configuration(); // start a http server with CountingFilter conf.set(HttpServer2.FILTER_INITIALIZER_PROPERTY, ErrorFilter.Initializer.class.getName()); HttpServer2 http = createTestServer(conf); try { http.start(); fail("expecting exception"); } catch (IOException e) { assertTrue(e.getMessage().contains( "Problem in starting http server. Server handlers failed")); } }
@BeforeClass public static void setup() throws Exception { server = createTestServer(); server.start(); baseUrl = getServerURL(server); }
@BeforeClass public static void setup() throws Exception { server = createTestServer(); server.start(); baseUrl = getServerURL(server); }
@BeforeClass public static void setup() throws Exception { Configuration conf = new Configuration(); conf.setInt(HttpServer2.HTTP_MAX_THREADS, 10); server = createTestServer(conf); server.addServlet("echo", "/echo", EchoServlet.class); server.addServlet("echomap", "/echomap", EchoMapServlet.class); server.addServlet("htmlcontent", "/htmlcontent", HtmlContentServlet.class); server.addServlet("longheader", "/longheader", LongHeaderServlet.class); server.addJerseyResourcePackage( JerseyResource.class.getPackage().getName(), "/jersey/*"); server.start(); baseUrl = getServerURL(server); LOG.info("HTTP server started: "+ baseUrl); }
@BeforeClass public static void setup() throws Exception { Configuration conf = new Configuration(); conf.setInt(HttpServer2.HTTP_MAX_THREADS, 10); server = createTestServer(conf); server.addServlet("echo", "/echo", EchoServlet.class); server.addServlet("echomap", "/echomap", EchoMapServlet.class); server.addServlet("htmlcontent", "/htmlcontent", HtmlContentServlet.class); server.addServlet("longheader", "/longheader", LongHeaderServlet.class); server.addJerseyResourcePackage( JerseyResource.class.getPackage().getName(), "/jersey/*"); server.start(); baseUrl = getServerURL(server); LOG.info("HTTP server started: "+ baseUrl); }
/** * Test that the server is alive once started * * @throws Throwable on failure */ @Test public void testStartedServerIsAlive() throws Throwable { HttpServer2 server = null; server = createTestServer(); assertNotLive(server); server.start(); assertAlive(server); stop(server); }
/** * Test that the server is alive once started * * @throws Throwable on failure */ @Test public void testStartedServerIsAlive() throws Throwable { HttpServer2 server = null; server = createTestServer(); assertNotLive(server); server.start(); assertAlive(server); stop(server); }