|
@@ -19,7 +19,7 @@
|
|
|
package org.apache.hadoop.yarn.server.resourcemanager;
|
|
|
|
|
|
import static org.mockito.Matchers.anyBoolean;
|
|
|
-import static org.mockito.Matchers.anyString;
|
|
|
+import static org.mockito.Matchers.eq;
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
import static org.mockito.Mockito.when;
|
|
|
|
|
@@ -176,6 +176,10 @@ public class TestClientRMService {
|
|
|
List<ApplicationReport> applications = queueInfo.getQueueInfo()
|
|
|
.getApplications();
|
|
|
Assert.assertEquals(2, applications.size());
|
|
|
+ request.setQueueName("nonexistentqueue");
|
|
|
+ request.setIncludeApplications(true);
|
|
|
+ // should not throw exception on nonexistent queue
|
|
|
+ queueInfo = rmService.getQueueInfo(request);
|
|
|
}
|
|
|
|
|
|
private static final UserGroupInformation owner =
|
|
@@ -334,8 +338,10 @@ public class TestClientRMService {
|
|
|
when(rmContext.getDispatcher()).thenReturn(dispatcher);
|
|
|
QueueInfo queInfo = recordFactory.newRecordInstance(QueueInfo.class);
|
|
|
queInfo.setQueueName("testqueue");
|
|
|
- when(yarnScheduler.getQueueInfo(anyString(), anyBoolean(), anyBoolean()))
|
|
|
+ when(yarnScheduler.getQueueInfo(eq("testqueue"), anyBoolean(), anyBoolean()))
|
|
|
.thenReturn(queInfo);
|
|
|
+ when(yarnScheduler.getQueueInfo(eq("nonexistentqueue"), anyBoolean(), anyBoolean()))
|
|
|
+ .thenThrow(new IOException("queue does not exist"));
|
|
|
ConcurrentHashMap<ApplicationId, RMApp> apps = getRMApps(rmContext,
|
|
|
yarnScheduler);
|
|
|
when(rmContext.getRMApps()).thenReturn(apps);
|