Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,37 +328,37 @@ public void testTaskAttemptIdXML() throws Exception {
public void testTaskAttemptIdBogus() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("bogusid",
"TaskAttemptId string : bogusid is not properly formed");
"java.lang.Exception: TaskAttemptId string : bogusid is not properly formed");
}

@Test
public void testTaskAttemptIdNonExist() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric(
"attempt_0_12345_m_000000_0",
"Error getting info on task attempt id attempt_0_12345_m_000000_0");
"java.lang.Exception: Error getting info on task attempt id attempt_0_12345_m_000000_0");
}

@Test
public void testTaskAttemptIdInvalid() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("attempt_0_12345_d_000000_0",
"Bad TaskType identifier. " +
"java.lang.Exception: Bad TaskType identifier. " +
"TaskAttemptId string : attempt_0_12345_d_000000_0 is not properly formed.");
}

@Test
public void testTaskAttemptIdInvalid2() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("attempt_12345_m_000000_0",
"TaskAttemptId string : attempt_12345_m_000000_0 is not properly formed");
"java.lang.Exception: TaskAttemptId string : attempt_12345_m_000000_0 is not properly formed");
}

@Test
public void testTaskAttemptIdInvalid3() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("attempt_0_12345_m_000000",
"TaskAttemptId string : attempt_0_12345_m_000000 is not properly formed");
"java.lang.Exception: TaskAttemptId string : attempt_0_12345_m_000000 is not properly formed");
}

private void testTaskAttemptIdErrorGeneric(String attid, String error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void testJobIdNonExist() throws Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"job, job_0_1234, is not found", message);
"java.lang.Exception: job, job_0_1234, is not found", message);
WebServicesTestUtils.checkStringMatch("exception type",
"NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down Expand Up @@ -356,7 +356,7 @@ public void testJobIdInvalidXML() throws JSONException, Exception {

private void verifyJobIdInvalid(String message, String type, String classname) {
WebServicesTestUtils.checkStringMatch("exception message",
"JobId string : job_foo is not properly formed",
"java.lang.Exception: JobId string : job_foo is not properly formed",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"NotFoundException", type);
Expand Down Expand Up @@ -385,7 +385,7 @@ public void testJobIdInvalidBogus() throws JSONException, Exception {
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch(
"exception message",
"JobId string : bogusfoo is not properly formed",
"java.lang.Exception: JobId string : bogusfoo is not properly formed",
message);
WebServicesTestUtils.checkStringMatch("exception type", "NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void testTasksQueryInvalid() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"tasktype must be either m or r", message);
"java.lang.Exception: tasktype must be either m or r", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down Expand Up @@ -365,7 +365,7 @@ public void testTaskIdBogus() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : " +
"java.lang.Exception: TaskId string : " +
"bogustaskid is not properly formed"
+ "\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,11 lastmatch=]", message);
Expand Down Expand Up @@ -401,7 +401,7 @@ public void testTaskIdNonExist() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"task not found with id task_0_0000_m_000000", message);
"java.lang.Exception: task not found with id task_0_0000_m_000000", message);
WebServicesTestUtils.checkStringMatch("exception type", "NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
"org.apache.hadoop.yarn.webapp.NotFoundException", classname);
Expand Down Expand Up @@ -432,7 +432,7 @@ public void testTaskIdInvalid() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : "
"java.lang.Exception: TaskId string : "
+ "task_0_0000_d_000000 is not properly formed"
+ "\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,20 lastmatch=]", message);
Expand Down Expand Up @@ -467,7 +467,7 @@ public void testTaskIdInvalid2() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : "
"java.lang.Exception: TaskId string : "
+ "task_0_m_000000 is not properly formed"
+ "\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,15 lastmatch=]", message);
Expand Down Expand Up @@ -501,7 +501,7 @@ public void testTaskIdInvalid3() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : "
"java.lang.Exception: TaskId string : "
+ "task_0_0000_m is not properly formed"
+ "\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,13 lastmatch=]", message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,33 +339,33 @@ public void testTaskAttemptIdXML() throws JSONException, Exception {
public void testTaskAttemptIdBogus() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("bogusid",
"TaskAttemptId string : bogusid is not properly formed");
"java.lang.Exception: TaskAttemptId string : bogusid is not properly formed");
}

@Test
public void testTaskAttemptIdNonExist() throws JSONException, Exception {
testTaskAttemptIdErrorGeneric("attempt_0_1234_m_000000_0",
"Error getting info on task attempt id attempt_0_1234_m_000000_0");
"java.lang.Exception: Error getting info on task attempt id attempt_0_1234_m_000000_0");
}

@Test
public void testTaskAttemptIdInvalid() throws JSONException, Exception {
testTaskAttemptIdErrorGeneric("attempt_0_1234_d_000000_0",
"Bad TaskType identifier. TaskAttemptId string : "
"java.lang.Exception: Bad TaskType identifier. TaskAttemptId string : "
+ "attempt_0_1234_d_000000_0 is not properly formed.");
}

@Test
public void testTaskAttemptIdInvalid2() throws JSONException, Exception {
testTaskAttemptIdErrorGeneric("attempt_1234_m_000000_0",
"TaskAttemptId string : attempt_1234_m_000000_0 is not properly formed");
"java.lang.Exception: TaskAttemptId string : attempt_1234_m_000000_0 is not properly formed");
}

@Test
public void testTaskAttemptIdInvalid3() throws JSONException, Exception {

testTaskAttemptIdErrorGeneric("attempt_0_1234_m_000000",
"TaskAttemptId string : attempt_0_1234_m_000000 is not properly formed");
"java.lang.Exception: TaskAttemptId string : attempt_0_1234_m_000000 is not properly formed");
}

private void testTaskAttemptIdErrorGeneric(String attid, String error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void testJobIdInvalidXML() throws JSONException, Exception {

private void verifyJobIdInvalid(String message, String type, String classname) {
WebServicesTestUtils.checkStringMatch("exception message",
"JobId string : job_foo is not properly formed", message);
"java.lang.Exception: JobId string : job_foo is not properly formed", message);
WebServicesTestUtils.checkStringMatch("exception type", "NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
"org.apache.hadoop.yarn.webapp.NotFoundException", classname);
Expand Down Expand Up @@ -455,7 +455,7 @@ public void testJobIdInvalidBogus() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"JobId string : bogusfoo is not properly formed", message);
"java.lang.Exception: JobId string : bogusfoo is not properly formed", message);
WebServicesTestUtils.checkStringMatch("exception type", "NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
"org.apache.hadoop.yarn.webapp.NotFoundException", classname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public void testJobsQueryLimitInvalid() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"limit value must be greater then 0", message);
"java.lang.Exception: limit value must be greater then 0", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down Expand Up @@ -371,7 +371,7 @@ public void testJobsQueryStartTimeBeginEndInvalid() throws JSONException,
WebServicesTestUtils
.checkStringMatch(
"exception message",
"startedTimeEnd must be greater than startTimeBegin",
"java.lang.Exception: startedTimeEnd must be greater than startTimeBegin",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -397,7 +397,7 @@ public void testJobsQueryStartTimeInvalidformat() throws JSONException, Exceptio
WebServicesTestUtils
.checkStringMatch(
"exception message",
"Invalid number format: For input string: \"efsd\"",
"java.lang.Exception: Invalid number format: For input string: \"efsd\"",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -424,7 +424,7 @@ public void testJobsQueryStartTimeEndInvalidformat() throws JSONException,
WebServicesTestUtils
.checkStringMatch(
"exception message",
"Invalid number format: For input string: \"efsd\"",
"java.lang.Exception: Invalid number format: For input string: \"efsd\"",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -450,7 +450,7 @@ public void testJobsQueryStartTimeNegative() throws JSONException, Exception {
String classname = exception.getString("javaClassName");
WebServicesTestUtils
.checkStringMatch("exception message",
"startedTimeBegin must be greater than 0",
"java.lang.Exception: startedTimeBegin must be greater than 0",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -476,7 +476,7 @@ public void testJobsQueryStartTimeEndNegative() throws JSONException,
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"startedTimeEnd must be greater than 0", message);
"java.lang.Exception: startedTimeEnd must be greater than 0", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand All @@ -501,7 +501,7 @@ public void testJobsQueryFinishTimeEndNegative() throws JSONException,
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"finishedTimeEnd must be greater than 0", message);
"java.lang.Exception: finishedTimeEnd must be greater than 0", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand All @@ -526,7 +526,7 @@ public void testJobsQueryFinishTimeBeginNegative() throws JSONException,
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"finishedTimeBegin must be greater than 0", message);
"java.lang.Exception: finishedTimeBegin must be greater than 0", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down Expand Up @@ -555,7 +555,7 @@ public void testJobsQueryFinishTimeBeginEndInvalid() throws JSONException,
WebServicesTestUtils
.checkStringMatch(
"exception message",
"finishedTimeEnd must be greater than finishedTimeBegin",
"java.lang.Exception: finishedTimeEnd must be greater than finishedTimeBegin",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -582,7 +582,7 @@ public void testJobsQueryFinishTimeInvalidformat() throws JSONException,
WebServicesTestUtils
.checkStringMatch(
"exception message",
"Invalid number format: For input string: \"efsd\"",
"java.lang.Exception: Invalid number format: For input string: \"efsd\"",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand All @@ -609,7 +609,7 @@ public void testJobsQueryFinishTimeEndInvalidformat() throws JSONException,
WebServicesTestUtils
.checkStringMatch(
"exception message",
"Invalid number format: For input string: \"efsd\"",
"java.lang.Exception: Invalid number format: For input string: \"efsd\"",
message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public void testTasksQueryInvalid() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"tasktype must be either m or r", message);
"java.lang.Exception: tasktype must be either m or r", message);
WebServicesTestUtils.checkStringMatch("exception type",
"BadRequestException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
Expand Down Expand Up @@ -377,7 +377,7 @@ public void testTaskIdBogus() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : " +
"java.lang.Exception: TaskId string : " +
"bogustaskid is not properly formed" +
"\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,11 lastmatch=]", message);
Expand Down Expand Up @@ -411,7 +411,7 @@ public void testTaskIdNonExist() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringMatch("exception message",
"task not found with id task_0_0000_m_000000", message);
"java.lang.Exception: task not found with id task_0_0000_m_000000", message);
WebServicesTestUtils.checkStringMatch("exception type", "NotFoundException", type);
WebServicesTestUtils.checkStringMatch("exception classname",
"org.apache.hadoop.yarn.webapp.NotFoundException", classname);
Expand Down Expand Up @@ -442,7 +442,7 @@ public void testTaskIdInvalid() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : " +
"java.lang.Exception: TaskId string : " +
"task_0_0000_d_000000 is not properly formed" +
"\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,20 lastmatch=]", message);
Expand Down Expand Up @@ -476,7 +476,7 @@ public void testTaskIdInvalid2() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : " +
"java.lang.Exception: TaskId string : " +
"task_0000_m_000000 is not properly formed" +
"\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,18 lastmatch=]", message);
Expand Down Expand Up @@ -510,7 +510,7 @@ public void testTaskIdInvalid3() throws JSONException, Exception {
String type = exception.getString("exception");
String classname = exception.getString("javaClassName");
WebServicesTestUtils.checkStringEqual("exception message",
"TaskId string : " +
"java.lang.Exception: TaskId string : " +
"task_0_0000_m is not properly formed" +
"\nReason: java.util.regex.Matcher[pattern=" +
TaskID.TASK_ID_REGEX + " region=0,13 lastmatch=]", message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public Response toResponse(Exception e) {
}

// let jaxb handle marshalling data out in the same format requested
String errorMessage = e.getMessage();
String errorMessage = e.toString();
Throwable cause = e.getCause();
if (cause != null) {
errorMessage = cause.getMessage();
errorMessage = cause.toString();
}
RemoteExceptionData exception = new RemoteExceptionData(e.getClass().getSimpleName(),
errorMessage, e.getClass().getName());
Expand Down
Loading