Package org.apache.hadoop.yarn.webapp

Examples of org.apache.hadoop.yarn.webapp.WebApp


      app.stop();
    }
  }

  @Test public void testCustomRoutes() throws Exception {
    WebApp app = WebApps.$for("test", this).start(new WebApp() {
      @Override public void setup() {
        route("/:foo", FooController.class);
        route("/bar/foo", FooController.class, "bar");
        route("/foo/:foo", DefaultController.class);
        route("/foo/bar/:foo", DefaultController.class, "index");
      }
    });
    String baseUrl = baseUrl(app);
    try {
      assertEquals("foo", getContent(baseUrl).trim());
      assertEquals("foo", getContent(baseUrl +"test").trim());
      assertEquals("foo1", getContent(baseUrl +"test/1").trim());
      assertEquals("bar", getContent(baseUrl +"test/bar/foo").trim());
      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();
    }
  }
View Full Code Here


    this.conf.set(CommonConfigurationKeys.HADOOP_SECURITY_GROUP_MAPPING,
        NullGroupsProvider.class.getName());
    this.conf.setBoolean(MRConfig.MR_ACLS_ENABLED, true);
    Groups.getUserToGroupsMappingService(conf);
    this.ctx = new MockContext(this.conf);
    WebApp webApp = mock(HsWebApp.class);
    when(webApp.name()).thenReturn("hsmockwebapp");
    this.hsWebServices = new HsWebServices(ctx, conf, webApp);
    this.hsWebServices.setResponse(mock(HttpServletResponse.class));

    Job job = this.ctx.getAllJobs().values().iterator().next();
    this.jobIdStr = job.getID().toString();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.webapp.WebApp

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.