public static void main(String argv[]) {
    int exitCode = -1;
    ProgramDriver pgd = new ProgramDriver();
    try {
      pgd.addClass("typedatacheck", TypeDataCheck.class,
        "A map/reduce program that checks the type of each field and" +
          " outputs the entire table (to test hcat).");
      pgd.addClass("sumnumbers", SumNumbers.class,
        "A map/reduce program that performs a group by on the first column and a " +
          "SUM operation on the other columns of the \"numbers\" table.");
      pgd.addClass("storenumbers", StoreNumbers.class, "A map/reduce program that " +
        "reads from the \"numbers\" table and adds 10 to each fields and writes " +
        "to the \"numbers_partitioned\" table into the datestamp=20100101 " +
        "partition OR the \"numbers_empty_initially\" table based on a " +
        "cmdline arg");
      pgd.addClass("storecomplex", StoreComplex.class, "A map/reduce program that " +
        "reads from the \"complex\" table and stores as-is into the " +
        "\"complex_empty_initially\" table.");
      pgd.addClass("storedemo", StoreDemo.class, "demo prog.");
      pgd.driver(argv);

      // Success
      exitCode = 0;
    } catch (Throwable e) {
      e.printStackTrace();
    }

    System.exit(exitCode);
  }
A description of an example program based on its class and a 
human-readable description.
hcatalog/src/test/e2e/hcatalog/udfs/java/org/apache/hive/hcatalog/utils/HCatTestDriver.java