当前位置: 首页>>代码示例>>Java>>正文


Java WebAppTests.testPage方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.webapp.test.WebAppTests.testPage方法的典型用法代码示例。如果您正苦于以下问题:Java WebAppTests.testPage方法的具体用法?Java WebAppTests.testPage怎么用?Java WebAppTests.testPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.webapp.test.WebAppTests的用法示例。


在下文中一共展示了WebAppTests.testPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testLogsView2

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testLogsView2() throws IOException {
  LOG.info("HsLogsPage with data");
  MockAppContext ctx = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = new HashMap<String, String>();

  params.put(CONTAINER_ID, MRApp.newContainerId(1, 1, 333, 1)
      .toString());
  params.put(NM_NODENAME, 
      NodeId.newInstance(MockJobs.NM_HOST, MockJobs.NM_PORT).toString());
  params.put(ENTITY_STRING, "container_10_0001_01_000001");
  params.put(APP_OWNER, "owner");

  Injector injector =
      WebAppTests.testPage(AggregatedLogsPage.class, AppContext.class, ctx,
          params);
  PrintWriter spyPw = WebAppTests.getPrintWriter(injector);
  verify(spyPw).write(
      "Aggregation is not enabled. Try the nodemanager at "
          + MockJobs.NM_HOST + ":" + MockJobs.NM_PORT);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestHSWebApp.java

示例2: testLogsViewBadStartEnd

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testLogsViewBadStartEnd() throws IOException {
  LOG.info("HsLogsPage with bad start/end params");
  MockAppContext ctx = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = new HashMap<String, String>();

  params.put("start", "foo");
  params.put("end", "bar");
  params.put(CONTAINER_ID, MRApp.newContainerId(1, 1, 333, 1)
      .toString());
  params.put(NM_NODENAME,
      NodeId.newInstance(MockJobs.NM_HOST, MockJobs.NM_PORT).toString());
  params.put(ENTITY_STRING, "container_10_0001_01_000001");
  params.put(APP_OWNER, "owner");

  Injector injector =
      WebAppTests.testPage(AggregatedLogsPage.class, AppContext.class, ctx,
          params);
  PrintWriter spyPw = WebAppTests.getPrintWriter(injector);
  verify(spyPw).write("Invalid log start value: foo");
  verify(spyPw).write("Invalid log end value: bar");
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:TestHSWebApp.java

示例3: testJobCounterView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testJobCounterView() {
  LOG.info("JobCounterView");
  AppContext appContext = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = TestAMWebApp.getJobParams(appContext);
  WebAppTests.testPage(HsCountersPage.class, AppContext.class,
                       appContext, params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestHSWebApp.java

示例4: testTaskView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testTaskView() {
  AppContext appContext = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = getTaskParams(appContext);
  App app = new App(appContext);
  app.setJob(appContext.getAllJobs().values().iterator().next());
  app.setTask(app.getJob().getTasks().values().iterator().next());
  WebAppTests.testPage(TaskPage.class, App.class, app, params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestAMWebApp.java

示例5: testSingleCounterView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testSingleCounterView() {
  AppContext appContext = new MockAppContext(0, 1, 1, 1);
  Job job = appContext.getAllJobs().values().iterator().next();
  // add a failed task to the job without any counters
  Task failedTask = MockJobs.newTask(job.getID(), 2, 1, true);
  Map<TaskId,Task> tasks = job.getTasks();
  tasks.put(failedTask.getID(), failedTask);
  Map<String, String> params = getJobParams(appContext);
  params.put(AMParams.COUNTER_GROUP, 
      "org.apache.hadoop.mapreduce.FileSystemCounter");
  params.put(AMParams.COUNTER_NAME, "HDFS_WRITE_OPS");
  WebAppTests.testPage(SingleCounterPage.class, AppContext.class,
                       appContext, params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestAMWebApp.java

示例6: testJobCounterViewForKilledJob

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testJobCounterViewForKilledJob() {
  LOG.info("JobCounterViewForKilledJob");
  AppContext appContext = new MockAppContext(0, 1, 1, 1, true);
  Map<String, String> params = TestAMWebApp.getJobParams(appContext);
  WebAppTests.testPage(HsCountersPage.class, AppContext.class,
      appContext, params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestHSWebApp.java

示例7: testTasksView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testTasksView() {
  LOG.info("HsTasksPage");
  AppContext appContext = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = TestAMWebApp.getTaskParams(appContext);
  WebAppTests.testPage(HsTasksPage.class, AppContext.class, appContext,
      params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestHSWebApp.java

示例8: testTaskView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testTaskView() {
  LOG.info("HsTaskPage");
  AppContext appContext = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = TestAMWebApp.getTaskParams(appContext);
  WebAppTests
      .testPage(HsTaskPage.class, AppContext.class, appContext, params);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestHSWebApp.java

示例9: testLogsViewSingle

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testLogsViewSingle() throws IOException {
  LOG.info("HsLogsPage with params for single log and data limits");
  MockAppContext ctx = new MockAppContext(0, 1, 1, 1);
  Map<String, String> params = new HashMap<String, String>();

  final Configuration conf = new YarnConfiguration();
  conf.setBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, true);

  params.put("start", "-2048");
  params.put("end", "-1024");
  params.put(CONTAINER_LOG_TYPE, "syslog");
  params.put(CONTAINER_ID, MRApp.newContainerId(1, 1, 333, 1)
      .toString());
  params.put(NM_NODENAME,
      NodeId.newInstance(MockJobs.NM_HOST, MockJobs.NM_PORT).toString());
  params.put(ENTITY_STRING, "container_10_0001_01_000001");
  params.put(APP_OWNER, "owner");

  Injector injector =
      WebAppTests.testPage(AggregatedLogsPage.class, AppContext.class, ctx,
          params, new AbstractModule() {
        @Override
        protected void configure() {
          bind(Configuration.class).toInstance(conf);
        }
      });
  PrintWriter spyPw = WebAppTests.getPrintWriter(injector);
  verify(spyPw).write(
      "Logs not available for container_10_0001_01_000001."
          + " Aggregation may not be complete, "
          + "Check back later or try the nodemanager at "
          + MockJobs.NM_HOST + ":" + MockJobs.NM_PORT);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:TestHSWebApp.java

示例10: testUsual

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testUsual() {
  Injector injector = WebAppTests.testPage(TestView.class);
  PrintWriter out = injector.getInstance(PrintWriter.class);

  // Verify the HTML page has correct meta tags in the header
  verify(out).print(" http-equiv=\"X-UA-Compatible\"");
  verify(out).print(" content=\"IE=8\"");
  verify(out).print(" http-equiv=\"Content-type\"");
  verify(out).print(String.format(" content=\"%s\"", MimeType.HTML));

  verify(out).print("test");
  verify(out).print(" id=\"testid\"");
  verify(out).print("test note");
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:15,代码来源:TestHtmlPage.java

示例11: testLogsView1

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testLogsView1() throws IOException {
  LOG.info("HsLogsPage");
  Injector injector =
      WebAppTests.testPage(AggregatedLogsPage.class, AppContext.class,
          new MockAppContext(0, 1, 1, 1));
  PrintWriter spyPw = WebAppTests.getPrintWriter(injector);
  verify(spyPw).write("Cannot get container logs without a ContainerId");
  verify(spyPw).write("Cannot get container logs without a NodeId");
  verify(spyPw).write("Cannot get container logs without an app owner");
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:12,代码来源:TestHSWebApp.java

示例12: testSingleCounterView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testSingleCounterView() {
  LOG.info("HsSingleCounterPage");
  WebAppTests.testPage(HsSingleCounterPage.class, AppContext.class,
                       new MockAppContext(0, 1, 1, 1));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:TestHSWebApp.java

示例13: testShortPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test(expected=WebAppException.class) public void testShortPage() {
  WebAppTests.testPage(ShortPage.class);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:TestHtmlBlock.java

示例14: testConfView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testConfView() {
  LOG.info("HsConfPage");
  WebAppTests.testPage(HsConfPage.class, AppContext.class,
                       new MockAppContext(0, 1, 1, 1));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:TestHSWebApp.java

示例15: testShort

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test(expected=WebAppException.class) public void testShort() {
  WebAppTests.testPage(ShortView.class);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:TestHtmlPage.java


注:本文中的org.apache.hadoop.yarn.webapp.test.WebAppTests.testPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。