@BeforeClass
  public static void init(){
    // something changed scratch dir permissions, so test can't execute
    HiveConf hiveConf = new HiveConf();
    String scratchDir = hiveConf.get(HiveConf.ConfVars.SCRATCH_DIR.varname);
    File file = new File(scratchDir);
    if (file.exists()) {
      file.setWritable(true, false);
    }
  }
This method is used for verifying CMD to see whether the output contains the keywords provided.
beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java