RejectRouterPolicy extends AbstractRouterPolicy { @Override public SubClusterId getHomeSubcluster( ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) throws YarnException { validate(appSubmissionContext); throw new FederationPolicyException("The policy configured for this queue" + " (" + appSubmissionContext.getQueue() + ") reject all routing " + "requests by construction. Application " + appSubmissionContext.getApplicationId() + " cannot be routed to any RM."); }  @Override void reinitialize(
      FederationPolicyInitializationContext federationPolicyContext); @Override SubClusterId getHomeSubcluster(
      ApplicationSubmissionContext appSubmissionContext,
      List<SubClusterId> blackListSubClusters);  }
@Test(expected = FederationPolicyException.class) public void testNoClusterIsChosen() throws YarnException { ((FederationRouterPolicy) getPolicy()) .getHomeSubcluster(getApplicationSubmissionContext(), null); }
@Override @Test(expected = FederationPolicyException.class) public void testNullQueueRouting() throws YarnException { FederationRouterPolicy localPolicy = (FederationRouterPolicy) getPolicy(); ApplicationSubmissionContext applicationSubmissionContext = ApplicationSubmissionContext.newInstance(null, null, null, null, null, false, false, 0, Resources.none(), null, false, null, null); localPolicy.getHomeSubcluster(applicationSubmissionContext, null); }