@Test
  public void testErrorForMissingPartitionColumn() throws Exception {
    Table testTable = createPartitionedTestTable(dbName, tableName, 2, 0);
    // add 10 partitions on the filesystem
    createPartitionsDirectoriesOnFS(testTable, 10);
    //create a fake directory to throw exception
    StringBuilder sb = new StringBuilder(testTable.getDataLocation().toString());
    sb.append(Path.SEPARATOR);
    sb.append("dummyPart=error");
    createDirectory(sb.toString());
    //check result now
    Exception exception = null;
    try {
      checker.checkMetastore(catName, dbName, tableName, null, null);
    } catch (Exception e) {
      exception = e;
    }
    assertTrue("Expected MetastoreException", exception instanceof MetastoreException);
    createFile(sb.toString(), "dummyFile");
    exception = null;
    try {
      checker.checkMetastore(catName, dbName, tableName, null, null);
    } catch (Exception e) {
      exception = e;
    }
    assertTrue("Expected MetastoreException", exception instanceof MetastoreException);
  }
Test if checker throws HiveException when the there is a dummy directory present in the nested level
of sub-directories
@throws Exception ex
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreChecker.java