MAPREDUCE-4569. Fixed TestHsWebServicesJobsQuery to pass on JDK7 by not depending on test order. Contributed by Thomas Graves.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1379146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6f6e170325
commit
65e447cd8b
@ -553,6 +553,9 @@ Release 0.23.3 - UNRELEASED
|
||||
MAPREDUCE-4375. Show Configuration Tracability in MR UI (bobby
|
||||
via tgraves)
|
||||
|
||||
MAPREDUCE-4569. Fixed TestHsWebServicesJobsQuery to pass on JDK7 by not
|
||||
depending on test order. (Thomas Graves via vinodkv)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
MAPREDUCE-3850. Avoid redundant calls for tokens in TokenCache (Daryn
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
@ -217,9 +218,23 @@ public TestHsWebServicesJobsQuery() {
|
||||
@Test
|
||||
public void testJobsQueryStateNone() throws JSONException, Exception {
|
||||
WebResource r = resource();
|
||||
|
||||
ArrayList<JobState> JOB_STATES =
|
||||
new ArrayList<JobState>(Arrays.asList(JobState.values()));
|
||||
|
||||
// find a state that isn't in use
|
||||
Map<JobId, Job> jobsMap = appContext.getAllJobs();
|
||||
for (Map.Entry<JobId, Job> entry : jobsMap.entrySet()) {
|
||||
JOB_STATES.remove(entry.getValue().getState());
|
||||
}
|
||||
|
||||
assertTrue("No unused job states", JOB_STATES.size() > 0);
|
||||
JobState notInUse = JOB_STATES.get(0);
|
||||
|
||||
ClientResponse response = r.path("ws").path("v1").path("history")
|
||||
.path("mapreduce").path("jobs").queryParam("state", JobState.KILL_WAIT.toString())
|
||||
.path("mapreduce").path("jobs").queryParam("state", notInUse.toString())
|
||||
.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
|
||||
|
||||
assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
|
||||
JSONObject json = response.getEntity(JSONObject.class);
|
||||
assertEquals("incorrect number of elements", 1, json.length());
|
||||
|
Loading…
Reference in New Issue
Block a user