RelationManager { public void deleteTable(String tableName) throws StorageException { tableName = tableName.toLowerCase(); if (isSystemCatalog(tableName)) { throw new StorageException("Deleting a system catalog table is prohibited."); } if (! checkTableExistence(tableName)) { return; } DataWriter dataWriter = getTableDataWriter(tableName); dataWriter.open(); dataWriter.clearData(); dataWriter.close(); StorageUtils.deleteDirectory(getTableDirectory(tableName)); Query catalogTableNameQuery = new TermQuery(new Term(CatalogConstants.TABLE_NAME, tableName)); DataWriter tableCatalogWriter = new DataWriter(CatalogConstants.TABLE_CATALOG_DATASTORE, LuceneAnalyzerConstants.getStandardAnalyzer()); tableCatalogWriter.open(); tableCatalogWriter.deleteTuple(catalogTableNameQuery); tableCatalogWriter.close(); DataWriter schemaCatalogWriter = new DataWriter(CatalogConstants.SCHEMA_CATALOG_DATASTORE, LuceneAnalyzerConstants.getStandardAnalyzer()); schemaCatalogWriter.open(); schemaCatalogWriter.deleteTuple(catalogTableNameQuery); schemaCatalogWriter.close(); } private  RelationManager(); static RelationManager getInstance(); boolean checkTableExistence(String tableName); void createTable(String tableName, Path indexDirectory, Schema schema, String luceneAnalyzerString); void deleteTable(String tableName); Tuple getTupleByID(String tableName, IDField idField); DataWriter getTableDataWriter(String tableName); DataReader getTableDataReader(String tableName, Query tupleQuery); DataStore getTableDataStore(String tableName); String getTableDirectory(String tableName); Schema getTableSchema(String tableName); String getTableAnalyzerString(String tableName); Analyzer getTableAnalyzer(String tableName); List<TableMetadata> getMetaData();  }
@Test(expected = StorageException.class) public void test11() throws Exception { relationManager.deleteTable(CatalogConstants.TABLE_CATALOG); }
@Test(expected = StorageException.class) public void test12() throws Exception { relationManager.deleteTable(CatalogConstants.SCHEMA_CATALOG); }