@Test
public void testHomeSubclusterNotActive() throws YarnException {

  // We setup the home subcluster to a non-existing one
  initializePolicyContext(getPolicy(), mock(WeightedPolicyInfo.class),
      getActiveSubclusters(), "badsc");
  // Verify the request fails because the home subcluster is not available
  try {
    String[] hosts = new String[] {"host0", "host1", "host2", "host3"};
    List<ResourceRequest> resourceRequests = createResourceRequests(
        hosts, 2 * 1024, 2, 1, 3, null, false);
    HomeAMRMProxyPolicy federationPolicy = (HomeAMRMProxyPolicy)getPolicy();
    federationPolicy.splitResourceRequests(resourceRequests,
        new HashSet<SubClusterId>());
    fail("It should fail when the home subcluster is not active");
  } catch(FederationPolicyException e) {
    GenericTestUtils.assertExceptionContains("is not active", e);
  }
}