private void addTrigger(WMFullResourcePlan fullRp, String triggerName, String action,
      String expr, String poolName) {
    WMTrigger trigger = new WMTrigger(fullRp.getPlan().getName(), triggerName);
    trigger.setActionExpression(action);
    trigger.setTriggerExpression(expr);
    fullRp.addToTriggers(trigger);

    WMPoolTrigger pool2Trigger = new WMPoolTrigger(poolName, triggerName);
    fullRp.addToPoolTriggers(pool2Trigger);
  }
Test class for json resource plan formatter.
ql/src/test/org/apache/hadoop/hive/ql/metadata/formatting/TestJsonRPFormatter.java