Package org.apache.hadoop.hbase.http

Examples of org.apache.hadoop.hbase.http.HttpServer


   * Test that the server is alive once started
   *
   * @throws Throwable on failure
   */
  @Test public void testCreatedServerIsNotAlive() throws Throwable {
    HttpServer server = createTestServer();
    assertNotLive(server);
  }
View Full Code Here


    HttpServer server = createTestServer();
    assertNotLive(server);
  }

  @Test public void testStopUnstartedServer() throws Throwable {
    HttpServer server = createTestServer();
    stop(server);
  }
View Full Code Here

   *
   * @throws Throwable on failure
   */
  @Test
  public void testStartedServerIsAlive() throws Throwable {
    HttpServer server = null;
    server = createTestServer();
    assertNotLive(server);
    server.start();
    assertAlive(server);
    stop(server);
  }
View Full Code Here

    HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender();
    requestLogAppender.setName("httprequestlog");
    requestLogAppender.setFilename(System.getProperty("test.build.data", "/tmp/")
        + "jetty-name-yyyy_mm_dd.log");
    Logger.getLogger(HttpServer.class.getName() + ".test").addAppender(requestLogAppender);
    HttpServer server = null;
    server = createTestServer();
    assertNotLive(server);
    server.start();
    assertAlive(server);
    stop(server);
    Logger.getLogger(HttpServer.class.getName() + ".test").removeAppender(requestLogAppender);
  }
View Full Code Here

   * Test that the server is not alive once stopped
   *
   * @throws Throwable on failure
   */
  @Test public void testStoppedServerIsNotAlive() throws Throwable {
    HttpServer server = createAndStartTestServer();
    assertAlive(server);
    stop(server);
    assertNotLive(server);
  }
View Full Code Here

   * Test that the server is not alive once stopped
   *
   * @throws Throwable on failure
   */
  @Test public void testStoppingTwiceServerIsAllowed() throws Throwable {
    HttpServer server = createAndStartTestServer();
    assertAlive(server);
    stop(server);
    assertNotLive(server);
    stop(server);
    assertNotLive(server);
View Full Code Here

   * @throws Throwable
   *           on failure
   */
  @Test
  public void testWepAppContextAfterServerStop() throws Throwable {
    HttpServer server = null;
    String key = "test.attribute.key";
    String value = "test.attribute.value";
    server = createTestServer();
    assertNotLive(server);
    server.start();
    server.setAttribute(key, value);
    assertAlive(server);
    assertEquals(value, server.getAttribute(key));
    stop(server);
    assertNull("Server context should have cleared", server.getAttribute(key));
  }
View Full Code Here

    Configuration conf = new Configuration();
   
    //start a http server with CountingFilter
    conf.set(HttpServer.FILTER_INITIALIZERS_PROPERTY,
        RecordingFilter.Initializer.class.getName());
    HttpServer http = createTestServer(conf);
    http.start();

    final String fsckURL = "/fsck";
    final String stacksURL = "/stacks";
    final String ajspURL = "/a.jsp";
    final String listPathsURL = "/listPaths";
    final String dataURL = "/data";
    final String streamFile = "/streamFile";
    final String rootURL = "/";
    final String allURL = "/*";
    final String outURL = "/static/a.out";
    final String logURL = "/logs/a.log";

    final String[] urls = {fsckURL, stacksURL, ajspURL, listPathsURL,
        dataURL, streamFile, rootURL, allURL, outURL, logURL};

    //access the urls
    final String prefix = "http://"
        + NetUtils.getHostPortString(http.getConnectorAddress(0));
    try {
      for(int i = 0; i < urls.length; i++) {
        access(prefix + urls[i]);
      }
    } finally {
      http.stop();
    }

    LOG.info("RECORDS = " + RECORDS);
   
    //verify records
View Full Code Here

   *
   * @throws IOException on any failure
   * @throws AssertionError if a condition was not met
   */
  public static HttpServer createAndStartTestServer() throws IOException {
    HttpServer server = createTestServer();
    server.start();
    return server;
  }
View Full Code Here

   * Test that the test server is loadable on the classpath
   * @throws Throwable if something went wrong
   */
  @Test
  public void testValidServerResource() throws Throwable {
    HttpServer server = null;
    try {
      server = createServer("test");
    } finally {
      stop(server);
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.http.HttpServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.