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


Java WebAppTests.flushOutput方法代码示例

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


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

示例1: testNodesBlockRenderForLostNodes

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testNodesBlockRenderForLostNodes() {
  NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
  nodesBlock.set("node.state", "lost");
  nodesBlock.render();
  PrintWriter writer = injector.getInstance(PrintWriter.class);
  WebAppTests.flushOutput(injector);

  Mockito.verify(writer,
      Mockito.times(numberOfActualTableHeaders + numberOfThInMetricsTable))
      .print("<th");
  Mockito.verify(
      writer,
      Mockito.times(numberOfRacks * numberOfLostNodesPerRack
          * numberOfActualTableHeaders + numberOfThInMetricsTable)).print(
      "<td");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestNodesPage.java

示例2: testView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testView() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
        mockApplicationHistoryClientService(5, 1, 1));
  AHSView ahsViewInstance = injector.getInstance(AHSView.class);

  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE,
    YarnApplicationState.FAILED.toString());
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);

  ahsViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
    YarnApplicationState.FAILED.toString(), YarnApplicationState.KILLED));
  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestAHSWebApp.java

示例3: testAppAttemptPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testAppAttemptPage() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
        mockApplicationHistoryClientService(1, 1, 5));
  AppAttemptPage appAttemptPageInstance =
      injector.getInstance(AppAttemptPage.class);

  appAttemptPageInstance.render();
  WebAppTests.flushOutput(injector);

  appAttemptPageInstance.set(YarnWebParams.APPLICATION_ATTEMPT_ID,
    ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1)
      .toString());
  appAttemptPageInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestAHSWebApp.java

示例4: testContainerPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testContainerPage() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
        mockApplicationHistoryClientService(1, 1, 1));
  ContainerPage containerPageInstance =
      injector.getInstance(ContainerPage.class);

  containerPageInstance.render();
  WebAppTests.flushOutput(injector);

  containerPageInstance.set(
    YarnWebParams.CONTAINER_ID,
    ContainerId
      .newContainerId(
        ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1),
        1).toString());
  containerPageInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestAHSWebApp.java

示例5: testView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testView() {
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      mockRMContext(15, 1, 2, 8*GiB),
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        ResourceManager mockRm = mockRm(3, 1, 2, 8*GiB);
        binder.bind(ResourceManager.class).toInstance(mockRm);
        binder.bind(ApplicationBaseProtocol.class)
            .toInstance(mockRm.getClientRMService());
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });
  RmView rmViewInstance = injector.getInstance(RmView.class);
  rmViewInstance.set(YarnWebParams.APP_STATE,
      YarnApplicationState.RUNNING.toString());
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);

  rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      YarnApplicationState.ACCEPTED.toString(),
      YarnApplicationState.RUNNING.toString()));
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:TestRMWebApp.java

示例6: testNodesPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testNodesPage() {
  // 10 nodes. Two of each type.
  final RMContext rmContext = mockRMContext(3, 2, 12, 8*GiB);
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      rmContext,
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        binder.bind(ResourceManager.class).toInstance(mockRm(rmContext));
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });

  // All nodes
  NodesPage instance = injector.getInstance(NodesPage.class);
  instance.render();
  WebAppTests.flushOutput(injector);

  // Unhealthy nodes
  instance.moreParams().put(YarnWebParams.NODE_STATE,
    NodeState.UNHEALTHY.toString());
  instance.render();
  WebAppTests.flushOutput(injector);

  // Lost nodes
  instance.moreParams().put(YarnWebParams.NODE_STATE,
    NodeState.LOST.toString());
  instance.render();
  WebAppTests.flushOutput(injector);

}
 
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:TestRMWebApp.java

示例7: testFairSchedulerWebAppPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testFairSchedulerWebAppPage() {
  List<RMAppState> appStates = Arrays.asList(RMAppState.NEW,
      RMAppState.NEW_SAVING, RMAppState.SUBMITTED);
  final RMContext rmContext = mockRMContext(appStates);
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      rmContext,
      new Module() {
        @Override
        public void configure(Binder binder) {
          try {
            ResourceManager mockRmWithFairScheduler =
                mockRm(rmContext);
            binder.bind(ResourceManager.class).toInstance
                (mockRmWithFairScheduler);
            binder.bind(ApplicationBaseProtocol.class).toInstance(
              mockRmWithFairScheduler.getClientRMService());
          } catch (IOException e) {
            throw new IllegalStateException(e);
          }
        }
      });
  FairSchedulerPage fsViewInstance = injector.getInstance(FairSchedulerPage
      .class);
  fsViewInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestRMWebAppFairScheduler.java

示例8: testNodesBlockRender

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testNodesBlockRender() throws Exception {
  injector.getInstance(NodesBlock.class).render();
  PrintWriter writer = injector.getInstance(PrintWriter.class);
  WebAppTests.flushOutput(injector);

  Mockito.verify(writer,
      Mockito.times(numberOfActualTableHeaders + numberOfThInMetricsTable))
      .print("<th");
  Mockito.verify(
      writer,
      Mockito.times(numberOfRacks * numberOfNodesPerRack
          * numberOfActualTableHeaders + numberOfThInMetricsTable)).print(
      "<td");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestNodesPage.java

示例9: testNodesBlockRenderForNodeLabelFilterWithNonEmptyLabel

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testNodesBlockRenderForNodeLabelFilterWithNonEmptyLabel() {
  NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
  nodesBlock.set("node.label", "x");
  nodesBlock.render();
  PrintWriter writer = injector.getInstance(PrintWriter.class);
  WebAppTests.flushOutput(injector);

  Mockito.verify(
      writer,
      Mockito.times(numberOfRacks
          * numberOfActualTableHeaders + numberOfThInMetricsTable)).print(
      "<td");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestNodesPage.java

示例10: testNodesBlockRenderForNodeLabelFilterWithEmptyLabel

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testNodesBlockRenderForNodeLabelFilterWithEmptyLabel() {
  NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
  nodesBlock.set("node.label", "");
  nodesBlock.render();
  PrintWriter writer = injector.getInstance(PrintWriter.class);
  WebAppTests.flushOutput(injector);

  Mockito.verify(
      writer,
      Mockito.times(numberOfRacks * (numberOfNodesPerRack - 1)
          * numberOfActualTableHeaders + numberOfThInMetricsTable)).print(
      "<td");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestNodesPage.java

示例11: testNodesBlockRenderForNodeLabelFilterWithAnyLabel

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testNodesBlockRenderForNodeLabelFilterWithAnyLabel() {
  NodesBlock nodesBlock = injector.getInstance(NodesBlock.class);
  nodesBlock.set("node.label", "*");
  nodesBlock.render();
  PrintWriter writer = injector.getInstance(PrintWriter.class);
  WebAppTests.flushOutput(injector);

  Mockito.verify(
      writer,
      Mockito.times(numberOfRacks * numberOfNodesPerRack
          * numberOfActualTableHeaders + numberOfThInMetricsTable)).print(
      "<td");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestNodesPage.java

示例12: testAppPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testAppPage() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
        mockApplicationHistoryClientService(1, 5, 1));
  AppPage appPageInstance = injector.getInstance(AppPage.class);

  appPageInstance.render();
  WebAppTests.flushOutput(injector);

  appPageInstance.set(YarnWebParams.APPLICATION_ID, ApplicationId
    .newInstance(0, 1).toString());
  appPageInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestAHSWebApp.java

示例13: testView

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test public void testView() {
  Injector injector = WebAppTests.createMockInjector(RMContext.class,
      mockRMContext(15, 1, 2, 8*GiB),
      new Module() {
    @Override
    public void configure(Binder binder) {
      try {
        ResourceManager mockRm = mockRm(3, 1, 2, 8*GiB);
        binder.bind(ResourceManager.class).toInstance(mockRm);
        binder.bind(ApplicationBaseProtocol.class)
            .toInstance(mockRm.getClientRMService());
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  });
  RmView rmViewInstance = injector.getInstance(RmView.class);
  rmViewInstance.set(YarnWebParams.APP_STATE,
      YarnApplicationState.RUNNING.toString());
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);

  rmViewInstance.set(YarnWebParams.APP_STATE, StringHelper.cjoin(
      YarnApplicationState.ACCEPTED.toString(),
      YarnApplicationState.RUNNING.toString()));
  rmViewInstance.render();
  WebAppTests.flushOutput(injector);
  Map<String, String> moreParams =
      rmViewInstance.context().requestContext().moreParams();
  String appsTableColumnsMeta = moreParams.get("ui.dataTables.apps.init");
  Assert.assertTrue(appsTableColumnsMeta.indexOf("natural") != -1);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:33,代码来源:TestRMWebApp.java

示例14: testAPPViewNaturalSortType

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testAPPViewNaturalSortType() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
          mockApplicationHistoryClientService(5, 1, 1));
  AHSView ahsViewInstance = injector.getInstance(AHSView.class);

  ahsViewInstance.render();
  WebAppTests.flushOutput(injector);
  Map<String, String> moreParams =
      ahsViewInstance.context().requestContext().moreParams();
  String appTableColumnsMeta = moreParams.get("ui.dataTables.apps.init");
  Assert.assertTrue(appTableColumnsMeta.indexOf("natural") != -1);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:15,代码来源:TestAHSWebApp.java

示例15: testAboutPage

import org.apache.hadoop.yarn.webapp.test.WebAppTests; //导入方法依赖的package包/类
@Test
public void testAboutPage() throws Exception {
  Injector injector =
      WebAppTests.createMockInjector(ApplicationBaseProtocol.class,
          mockApplicationHistoryClientService(0, 0, 0));
  AboutPage aboutPageInstance = injector.getInstance(AboutPage.class);

  aboutPageInstance.render();
  WebAppTests.flushOutput(injector);

  aboutPageInstance.render();
  WebAppTests.flushOutput(injector);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:14,代码来源:TestAHSWebApp.java


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