|
@@ -83,16 +83,11 @@ public class TestPlacementManager {
|
|
|
|
|
|
ApplicationSubmissionContext asc = Records.newRecord(
|
|
ApplicationSubmissionContext asc = Records.newRecord(
|
|
ApplicationSubmissionContext.class);
|
|
ApplicationSubmissionContext.class);
|
|
|
|
+ asc.setQueue(YarnConfiguration.DEFAULT_QUEUE_NAME);
|
|
asc.setApplicationName(APP_NAME);
|
|
asc.setApplicationName(APP_NAME);
|
|
|
|
|
|
- boolean caughtException = false;
|
|
|
|
- try{
|
|
|
|
- pm.placeApplication(asc, USER2);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- caughtException = true;
|
|
|
|
- }
|
|
|
|
- Assert.assertTrue(caughtException);
|
|
|
|
-
|
|
|
|
|
|
+ Assert.assertNull("Placement should be null",
|
|
|
|
+ pm.placeApplication(asc, USER2));
|
|
QueueMappingEntity queueMappingEntity = new QueueMappingEntity(APP_NAME,
|
|
QueueMappingEntity queueMappingEntity = new QueueMappingEntity(APP_NAME,
|
|
USER1, PARENT_QUEUE);
|
|
USER1, PARENT_QUEUE);
|
|
|
|
|
|
@@ -100,12 +95,13 @@ public class TestPlacementManager {
|
|
Arrays.asList(queueMappingEntity));
|
|
Arrays.asList(queueMappingEntity));
|
|
queuePlacementRules.add(anRule);
|
|
queuePlacementRules.add(anRule);
|
|
pm.updateRules(queuePlacementRules);
|
|
pm.updateRules(queuePlacementRules);
|
|
- try{
|
|
|
|
- pm.placeApplication(asc, USER2);
|
|
|
|
|
|
+ try {
|
|
|
|
+ ApplicationPlacementContext pc = pm.placeApplication(asc, USER2);
|
|
|
|
+ Assert.assertNotNull(pc);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- caughtException = false;
|
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ Assert.fail("Exception not expected");
|
|
}
|
|
}
|
|
- Assert.assertFalse(caughtException);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|