public static void setOutput(Job job, OutputJobInfo outputJobInfo) throws IOException {
    setOutput(job.getConfiguration(), job.getCredentials(), outputJobInfo);
  }
@Test
  public void testSetOutput() throws Exception {
    Configuration conf = new Configuration();
    Job job = Job.getInstance(conf, "test outputformat");

    Map<String, String> partitionValues = new HashMap<String, String>();
    partitionValues.put("colname", "p1");
    //null server url means local mode
    OutputJobInfo info = OutputJobInfo.create(dbName, tblName, partitionValues);

    HCatOutputFormat.setOutput(job, info);
    OutputJobInfo jobInfo = HCatOutputFormat.getJobInfo(job.getConfiguration());

    assertNotNull(jobInfo.getTableInfo());
    assertEquals(1, jobInfo.getPartitionValues().size());
    assertEquals("p1", jobInfo.getPartitionValues().get("colname"));
    assertEquals(1, jobInfo.getTableInfo().getDataColumns().getFields().size());
    assertEquals("data_column", jobInfo.getTableInfo().getDataColumns().getFields().get(0).getName());

    publishTest(job);
  }