Package org.apache.hadoop.yarn.webapp

Examples of org.apache.hadoop.yarn.webapp.WebApp.stop()


    
    assertEquals(2, pathSpecs.length);
    for(int i = 0; i < expectedPaths.length; i++) {
      assertTrue(ArrayUtils.contains(pathSpecs, expectedPaths[i]));
    }
    app.stop();
  }

  @Test public void testServePathsNoName() {
    WebApp app = WebApps.$for("", this).start();
    assertEquals("/", app.getRedirectPath());
View Full Code Here


    
    assertEquals(1, pathSpecs.length);
    for(int i = 0; i < expectedPaths.length; i++) {
      assertTrue(ArrayUtils.contains(pathSpecs, expectedPaths[i]));
    }
    app.stop();
  }

  @Test public void testDefaultRoutes() throws Exception {
    WebApp app = WebApps.$for("test", this).start();
    String baseUrl = baseUrl(app);
View Full Code Here

      assertEquals("bar", getContent(baseUrl +"test/foo/bar").trim());
      assertEquals("default", getContent(baseUrl +"test").trim());
      assertEquals("default", getContent(baseUrl +"test/").trim());
      assertEquals("default", getContent(baseUrl).trim());
    } finally {
      app.stop();
    }
  }

  @Test public void testCustomRoutes() throws Exception {
    WebApp app = WebApps.$for("test", this).start(new WebApp() {
View Full Code Here

      assertEquals("default", getContent(baseUrl +"test/foo/bar").trim());
      assertEquals("default1", getContent(baseUrl +"test/foo/1").trim());
      assertEquals("default2", getContent(baseUrl +"test/foo/bar/2").trim());
      assertEquals(404, getResponseCode(baseUrl +"test/goo"));
    } finally {
      app.stop();
    }
  }

  static String baseUrl(WebApp app) {
    return "http://localhost:"+ app.port() +"/";
View Full Code Here

  String echo(String s) { return s; }

  @Test public void testCreate() {
    WebApp app = WebApps.$for(this).start();
    app.stop();
  }

  @Test public void testCreateWithPort() {
    // see if the ephemeral port is updated
    WebApp app = WebApps.$for(this).at(0).start();
View Full Code Here

  @Test public void testCreateWithPort() {
    // see if the ephemeral port is updated
    WebApp app = WebApps.$for(this).at(0).start();
    int port = app.getListenerAddress().getPort();
    assertTrue(port > 0);
    app.stop();
    // try to reuse the port
    app = WebApps.$for(this).at(port).start();
    assertEquals(port, app.getListenerAddress().getPort());
    app.stop();
  }
View Full Code Here

    assertTrue(port > 0);
    app.stop();
    // try to reuse the port
    app = WebApps.$for(this).at(port).start();
    assertEquals(port, app.getListenerAddress().getPort());
    app.stop();
  }

  @Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class)
  public void testCreateWithBindAddressNonZeroPort() {
    WebApp app = WebApps.$for(this).at("0.0.0.0:50000").start();
View Full Code Here

    assertEquals(50000, port);
    // start another WebApp with same NonZero port
    WebApp app2 = WebApps.$for(this).at("0.0.0.0:50000").start();
    // An exception occurs (findPort disabled)
    app.stop();
    app2.stop();
  }

  @Test(expected=org.apache.hadoop.yarn.webapp.WebAppException.class)
  public void testCreateWithNonZeroPort() {
    WebApp app = WebApps.$for(this).at(50000).start();
View Full Code Here

    assertEquals(50000, port);
    // start another WebApp with same NonZero port
    WebApp app2 = WebApps.$for(this).at(50000).start();
    // An exception occurs (findPort disabled)
    app.stop();
    app2.stop();
  }

  @Test public void testServePaths() {
    WebApp app = WebApps.$for("test", this).start();
    assertEquals("/test", app.getRedirectPath());
View Full Code Here

  String echo(String s) { return s; }

  @Test public void testCreate() {
    WebApp app = WebApps.$for(this).start();
    app.stop();
  }

  @Test public void testCreateWithPort() {
    // see if the ephemeral port is updated
    WebApp app = WebApps.$for(this).at(0).start();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.