@Test
  public void testGetCommandCompletor() {
    Completer[] completors = CliDriver.getCommandCompleter();
    assertEquals(2, completors.length);
    assertTrue(completors[0] instanceof ArgumentCompleter);
    assertTrue(completors[1] instanceof Completer);

    List<CharSequence> testList = Arrays.asList(")");
    completors[1].complete("fdsdfsdf", 0, testList);
    assertEquals(")", testList.get(0));
    testList=new ArrayList<CharSequence>();
    completors[1].complete("len", 0, testList);
    assertTrue(testList.get(0).toString().endsWith("length("));

    testList=new ArrayList<CharSequence>();
    completors[0].complete("set f", 0, testList);
    assertEquals("set", testList.get(0));

  }
Do the actual testing against a mocked CliDriver based on what type of schema

@param mockSchema
         Schema to throw against test
@return Output that would have been sent to the user
@throws CommandProcessorException
@throws CommandNeedRetryException
          won't actually be thrown
cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java