@Override
  protected int getDefaultPort() {
    return (Integer) PropertyKey.MASTER_RPC_PORT.getDefaultValue();
  }
@Test
  public void defaultPortTest() throws Exception {
    // this test ensures that that default port for Alluxio Hadoop file system is the same
    // whether in Hadoop 1.x or Hadoop 2.x
    int defaultRpcPort = (int) PropertyKey.MASTER_RPC_PORT.getDefaultValue();

    Configuration conf = new Configuration();
    conf.set("fs.AbstractFileSystem.alluxio.impl", "alluxio.hadoop.AlluxioFileSystem");
    conf.set("fs.alluxio.impl", "alluxio.hadoop.FileSystem");
    URI uri = new URI("alluxio:///test");
    org.apache.hadoop.fs.AbstractFileSystem system = org.apache.hadoop.fs.AbstractFileSystem
        .createFileSystem(uri, conf);
    assertTrue(system instanceof AlluxioFileSystem);
    assertEquals(defaultRpcPort, system.getUriDefaultPort());

    org.apache.hadoop.fs.FileSystem system2 = org.apache.hadoop.fs.FileSystem.get(uri, conf);
    assertTrue(system2 instanceof FileSystem);
    // casting is required as org.apache.hadoop.fs.FileSystem#getDefaultPort is protected
    assertEquals(defaultRpcPort, ((FileSystem) system2).getDefaultPort());
  }