hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/ozShell/TestOzoneShell.java
@BeforeClass
  public static void init() throws Exception {
    conf = new OzoneConfiguration();

    String path = GenericTestUtils.getTempPath(
        TestOzoneShell.class.getSimpleName());
    baseDir = new File(path);
    baseDir.mkdirs();

    path += conf.getTrimmed(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT,
        OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT_DEFAULT);

    conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path);
    conf.setQuietMode(false);
    shell = new Shell();
    shell.setConf(conf);

    cluster = MiniOzoneCluster.newBuilder(conf).build();
    cluster.waitForClusterToBeReady();
    final int port = cluster.getHddsDatanodes().get(0).getDatanodeDetails()
        .getOzoneRestPort();
    url = String.format("http://localhost:%d", port);
    client = new OzoneRestClient(String.format("http://localhost:%d", port));
    client.setUserAuth(OzoneConsts.OZONE_SIMPLE_HDFS_USER);
  }
/**
   * Create a MiniDFSCluster for testing with using distributed Ozone
   * handler type.
   *
   * @throws Exception
   */
Create a MiniDFSCluster for testing with using distributed Ozone
handler type.

@throws Exception
Create a MiniDFSCluster for testing with using distributed Ozone handler type . @throws Exception
@BeforeClass
  public static void init() throws Exception {
    conf = new OzoneConfiguration();
    String path = GenericTestUtils.getTempPath(
        TestOzoneShell.class.getSimpleName());
    baseDir = new File(path);
    baseDir.mkdirs();
    path += conf.getTrimmed(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT,
        OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT_DEFAULT);
    conf.set(OzoneConfigKeys.OZONE_LOCALSTORAGE_ROOT, path);
    conf.setQuietMode(false);
    shell = new Shell();
    shell.setConf(conf);
    cluster = MiniOzoneCluster.newBuilder(conf).build();
    cluster.waitForClusterToBeReady();
    final int port = cluster.getHddsDatanodes().get(0).getDatanodeDetails()
        .getOzoneRestPort();
    url = String.format("http://localhost:%d", port);
    client = new OzoneRestClient(String.format("http://localhost:%d", port));
    client.setUserAuth(OzoneConsts.OZONE_SIMPLE_HDFS_USER);
  }
@ BeforeClass public static void init ( ) throws Exception { conf = new OzoneConfiguration ( ) ; String path = GenericTestUtils . getTempPath ( TestOzoneShell . class . getSimpleName ( ) ) ; baseDir = new File ( path ) ; baseDir . mkdirs ( ) ; path += conf . getTrimmed ( OzoneConfigKeys . OZONE_LOCALSTORAGE_ROOT , OzoneConfigKeys . OZONE_LOCALSTORAGE_ROOT_DEFAULT ) ; conf . set ( OzoneConfigKeys . OZONE_LOCALSTORAGE_ROOT , path ) ; conf . setQuietMode ( false ) ; shell = new Shell ( ) ; shell . setConf ( conf ) ; cluster = MiniOzoneCluster . newBuilder ( conf ) . build ( ) ; cluster . waitForClusterToBeReady ( ) ; final int port = cluster . getHddsDatanodes ( ) . get ( 0 ) . getDatanodeDetails ( ) . getOzoneRestPort ( ) ; url = String . format ( "http://localhost:%d" , port ) ; client = new OzoneRestClient ( String . format ( "http://localhost:%d" , port ) ) ; client . setUserAuth ( OzoneConsts . OZONE_SIMPLE_HDFS_USER ) ; }
Create a MiniDFSCluster for testing with using distributed Ozone
 handler type.
Create a MiniDFSCluster for testing with using distributed Ozone handler type .