@Override
    public void postAnalyze(HiveSemanticAnalyzerHookContext context,
        List<Task<?>> rootTasks) throws SemanticException {
      LogHelper console = SessionState.getConsole();

      if (console == null) {
        return;
      }

      // This is simply to verify that the hooks were in fact run
      console.printError("Running RunSecond for Post Analysis Hook");

      Assert.assertTrue("Post Analysis Hooks did not run in the order specified.",
                        staticAnalysisPostHookFirstRan);
    }
VerifyHooksRunInOrder.

Has to subclasses RunFirst and RunSecond which can be run as either pre or post hooks.
Verifies that RunFirst is executed before RunSecond as the same type of hook.  I.e. if they are
run as both Pre and Post hooks, RunSecond checks that RunFirst was run as a Pre or Post hook
respectively.

When running this, be sure to specify RunFirst before RunSecond in the configuration variable.
itests/util/src/main/java/org/apache/hadoop/hive/ql/hooks/VerifyHooksRunInOrder.java