}
@Test
public void testDeleteResourceId() throws Exception {
insertKeys(getHive());
Directory d = getDirectory();
for (String key : getPrimaryIndexOrResourceKeys()) {
// TODO: for some reason the BatchIndexWriter won't find the tables when running through maven
//d.batch().deleteAllSecondaryIndexKeysOfResourceId(resource, key);
for (SecondaryIndex secondaryIndex : resource.getSecondaryIndexes()) {
for (Object secondaryIndexKey : d.getSecondaryIndexKeysOfResourceId(secondaryIndex, key)) {
d.deleteSecondaryIndexKey(secondaryIndex, secondaryIndexKey, key);
;
}
}
assertEquals(0, d.getSecondaryIndexKeysOfResourceId(numIndex, key).size());
d.deleteResourceId(resource, key);
assertFalse(d.doesResourceIdExist(resource, key));
assertEquals(0, d.getSecondaryIndexKeysOfResourceId(nameIndex, key).size());
assertEquals(0, d.getSecondaryIndexKeysOfResourceId(numIndex, key).size());
}
}