private void addPool(WMFullResourcePlan fullRp, String poolName, double allocFraction,
      int parallelism, String policy) {
    WMPool pool = new WMPool(fullRp.getPlan().getName(), poolName);
    pool.setAllocFraction(allocFraction);
    pool.setQueryParallelism(parallelism);
    if (policy != null) {
      pool.setSchedulingPolicy(policy);
    }
    fullRp.addToPools(pool);
  }
Test class for json resource plan formatter.
ql/src/test/org/apache/hadoop/hive/ql/metadata/formatting/TestJsonRPFormatter.java