private void executeQuery(String query) throws Exception {
    try {
      CommandProcessorResponse result =  driver.run(query);
      assertNotNull("driver.run() was expected to return result for query: " + query, result);
    } catch (CommandProcessorException e) {
      throw new RuntimeException("Execution of (" + query + ") failed with exit status: " +
          e.getResponseCode() + ", " + e.getMessage() + ", query: " + query);
    }
  }
Tests DDL with remote metastore service and second namenode (HIVE-6374)
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestDDLWithRemoteMetastoreSecondNamenode.java