|
@@ -63,14 +63,11 @@ public class TestJobHistoryServer {
|
|
private static RecordFactory recordFactory = RecordFactoryProvider
|
|
private static RecordFactory recordFactory = RecordFactoryProvider
|
|
.getRecordFactory(null);
|
|
.getRecordFactory(null);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
JobHistoryServer historyServer=null;
|
|
JobHistoryServer historyServer=null;
|
|
|
|
+
|
|
// simple test init/start/stop JobHistoryServer. Status should change.
|
|
// simple test init/start/stop JobHistoryServer. Status should change.
|
|
-
|
|
|
|
@Test (timeout= 50000 )
|
|
@Test (timeout= 50000 )
|
|
public void testStartStopServer() throws Exception {
|
|
public void testStartStopServer() throws Exception {
|
|
-
|
|
|
|
historyServer = new JobHistoryServer();
|
|
historyServer = new JobHistoryServer();
|
|
Configuration config = new Configuration();
|
|
Configuration config = new Configuration();
|
|
historyServer.init(config);
|
|
historyServer.init(config);
|
|
@@ -86,15 +83,9 @@ public class TestJobHistoryServer {
|
|
historyServer.stop();
|
|
historyServer.stop();
|
|
assertEquals(STATE.STOPPED, historyServer.getServiceState());
|
|
assertEquals(STATE.STOPPED, historyServer.getServiceState());
|
|
assertNotNull(historyService.getClientHandler().getConnectAddress());
|
|
assertNotNull(historyService.getClientHandler().getConnectAddress());
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
//Test reports of JobHistoryServer. History server should get log files from MRApp and read them
|
|
//Test reports of JobHistoryServer. History server should get log files from MRApp and read them
|
|
-
|
|
|
|
@Test (timeout= 50000 )
|
|
@Test (timeout= 50000 )
|
|
public void testReports() throws Exception {
|
|
public void testReports() throws Exception {
|
|
Configuration config = new Configuration();
|
|
Configuration config = new Configuration();
|
|
@@ -128,7 +119,6 @@ public class TestJobHistoryServer {
|
|
assertEquals(1, jobs.size());
|
|
assertEquals(1, jobs.size());
|
|
assertEquals("job_0_0000",jobs.keySet().iterator().next().toString());
|
|
assertEquals("job_0_0000",jobs.keySet().iterator().next().toString());
|
|
|
|
|
|
-
|
|
|
|
Task task = job.getTasks().values().iterator().next();
|
|
Task task = job.getTasks().values().iterator().next();
|
|
TaskAttempt attempt = task.getAttempts().values().iterator().next();
|
|
TaskAttempt attempt = task.getAttempts().values().iterator().next();
|
|
|
|
|
|
@@ -188,14 +178,14 @@ public class TestJobHistoryServer {
|
|
assertEquals("", diagnosticResponse.getDiagnostics(0));
|
|
assertEquals("", diagnosticResponse.getDiagnostics(0));
|
|
|
|
|
|
}
|
|
}
|
|
- // test main method
|
|
|
|
|
|
+
|
|
|
|
+ // test launch method
|
|
@Test (timeout =60000)
|
|
@Test (timeout =60000)
|
|
- public void testMainMethod() throws Exception {
|
|
|
|
|
|
+ public void testLaunch() throws Exception {
|
|
|
|
|
|
ExitUtil.disableSystemExit();
|
|
ExitUtil.disableSystemExit();
|
|
try {
|
|
try {
|
|
- JobHistoryServer.main(new String[0]);
|
|
|
|
-
|
|
|
|
|
|
+ historyServer = JobHistoryServer.launchJobHistoryServer(new String[0]);
|
|
} catch (ExitUtil.ExitException e) {
|
|
} catch (ExitUtil.ExitException e) {
|
|
assertEquals(0,e.status);
|
|
assertEquals(0,e.status);
|
|
ExitUtil.resetFirstExitException();
|
|
ExitUtil.resetFirstExitException();
|