use of org.apache.hadoop.yarn.exceptions.YarnException in project hadoop by apache.
the class TestReservationInputValidator method testListReservationsNormal.
@Test
public void testListReservationsNormal() {
ReservationListRequest request = new ReservationListRequestPBImpl();
request.setQueue(ReservationSystemTestUtil.reservationQ);
request.setEndTime(1000);
request.setStartTime(0);
when(rSystem.getPlan(ReservationSystemTestUtil.reservationQ)).thenReturn(this.plan);
Plan plan = null;
try {
plan = rrValidator.validateReservationListRequest(rSystem, request);
} catch (YarnException e) {
Assert.fail(e.getMessage());
}
Assert.assertNotNull(plan);
}
use of org.apache.hadoop.yarn.exceptions.YarnException in project hadoop by apache.
the class TestReservationInputValidator method testSubmitReservationInvalidRecurrenceExpression.
@Test
public void testSubmitReservationInvalidRecurrenceExpression() {
ReservationSubmissionRequest request = createSimpleReservationSubmissionRequest(1, 1, 1, 5, 3, "123abc");
plan = null;
try {
plan = rrValidator.validateReservationSubmissionRequest(rSystem, request, ReservationSystemTestUtil.getNewReservationId());
Assert.fail();
} catch (YarnException e) {
Assert.assertNull(plan);
String message = e.getMessage();
Assert.assertTrue(message.startsWith("Invalid period "));
LOG.info(message);
}
}
use of org.apache.hadoop.yarn.exceptions.YarnException in project hadoop by apache.
the class TestReservationInputValidator method testUpdateReservationNoDefinition.
@Test
public void testUpdateReservationNoDefinition() {
ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
Plan plan = null;
try {
plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
Assert.fail();
} catch (YarnException e) {
Assert.assertNull(plan);
String message = e.getMessage();
Assert.assertTrue(message.startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
LOG.info(message);
}
}
use of org.apache.hadoop.yarn.exceptions.YarnException in project hadoop by apache.
the class TestReservationInputValidator method testSubmitReservationEmptyRR.
@Test
public void testSubmitReservationEmptyRR() {
ReservationSubmissionRequest request = createSimpleReservationSubmissionRequest(1, 0, 1, 5, 3);
Plan plan = null;
try {
plan = rrValidator.validateReservationSubmissionRequest(rSystem, request, ReservationSystemTestUtil.getNewReservationId());
Assert.fail();
} catch (YarnException e) {
Assert.assertNull(plan);
String message = e.getMessage();
Assert.assertTrue(message.startsWith("No resources have been specified to reserve"));
LOG.info(message);
}
}
use of org.apache.hadoop.yarn.exceptions.YarnException in project hadoop by apache.
the class TestReservationInputValidator method testSubmitReservationInvalidRR.
@Test
public void testSubmitReservationInvalidRR() {
ReservationSubmissionRequest request = createSimpleReservationSubmissionRequest(0, 0, 1, 5, 3);
Plan plan = null;
try {
plan = rrValidator.validateReservationSubmissionRequest(rSystem, request, ReservationSystemTestUtil.getNewReservationId());
Assert.fail();
} catch (YarnException e) {
Assert.assertNull(plan);
String message = e.getMessage();
Assert.assertTrue(message.startsWith("No resources have been specified to reserve"));
LOG.info(message);
}
}
Aggregations