@Test(timeout = 300000)
public void testWithFederatedCluster() throws Exception{

  final Configuration conf = new HdfsConfiguration();
  initConf(conf);
  final MiniDFSCluster cluster = new MiniDFSCluster
      .Builder(conf)
      .storageTypes(new StorageType[]{StorageType.DISK,
          StorageType.ARCHIVE})
      .nnTopology(MiniDFSNNTopology.simpleFederatedTopology(2))
      .numDataNodes(4).build();
  DFSTestUtil.setFederatedConfiguration(cluster, conf);
  try {
    cluster.waitActive();
    final String file = "/test/file";
    Path dir = new Path ("/test");
    final DistributedFileSystem dfs1 = cluster.getFileSystem(0);
    final DistributedFileSystem dfs2 = cluster.getFileSystem(1);
    URI nn1 = dfs1.getUri();
    URI nn2 = dfs2.getUri();
    setupStoragePoliciesAndPaths(dfs1, dfs2, dir, file);
    //Changing storage policies
    dfs1.setStoragePolicy(dir, "COLD");
    dfs2.setStoragePolicy(dir, "HOT");
    int rc = ToolRunner.run(conf, new Mover.Cli(),
        new String[] {"-p", nn1 + dir.toString(), nn2 + dir.toString()});
    Assert.assertEquals("Movement to DISK should be successful", 0, rc);
    waitForLocatedBlockWithArchiveStorageType(dfs1, file, 3);
    waitForLocatedBlockWithDiskStorageType(dfs2, file, 3);
  } finally {
    cluster.shutdown();
  }
}