use of org.apache.hadoop.mapreduce.v2.app.MockAppContext in project hadoop by apache.
the class TestHSWebApp method testConfView.
@Test
public void testConfView() {
LOG.info("HsConfPage");
WebAppTests.testPage(HsConfPage.class, AppContext.class, new MockAppContext(0, 1, 1, 1));
}
use of org.apache.hadoop.mapreduce.v2.app.MockAppContext in project hadoop by apache.
the class TestHSWebApp method testLogsViewBadStartEnd.
@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");
}
use of org.apache.hadoop.mapreduce.v2.app.MockAppContext in project hadoop by apache.
the class TestHSWebApp method testAboutView.
@Test
public void testAboutView() {
LOG.info("HsAboutPage");
WebAppTests.testPage(HsAboutPage.class, AppContext.class, new MockAppContext(0, 1, 1, 1));
}
use of org.apache.hadoop.mapreduce.v2.app.MockAppContext in project hadoop by apache.
the class TestHSWebApp method testAttemptsView.
@Test
public void testAttemptsView() {
LOG.info("HsAttemptsPage");
AppContext appContext = new MockAppContext(0, 1, 1, 1);
Map<String, String> params = TestAMWebApp.getTaskParams(appContext);
WebAppTests.testPage(HsAttemptsPage.class, AppContext.class, appContext, params);
}
use of org.apache.hadoop.mapreduce.v2.app.MockAppContext in project hadoop by apache.
the class TestHSWebApp method testLogsView2.
@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);
}
Aggregations