use of org.apache.jackrabbit.api.management.RepositoryManager in project jackrabbit by apache.
the class DataStoreAPITest method testDataStoreGarbageCollection.
/**
* Test data store garbage collection.
*/
public void testDataStoreGarbageCollection() throws RepositoryException {
JackrabbitRepositoryFactory rf = new RepositoryFactoryImpl();
Properties prop = new Properties();
prop.setProperty("org.apache.jackrabbit.repository.home", TEST_DIR);
prop.setProperty("org.apache.jackrabbit.repository.conf", TEST_DIR + "/repository.xml");
JackrabbitRepository rep = (JackrabbitRepository) rf.getRepository(prop);
RepositoryManager rm = rf.getRepositoryManager(rep);
// need to login to start the repository
Session session = rep.login();
DataStoreGarbageCollector gc = rm.createDataStoreGarbageCollector();
try {
gc.mark();
gc.sweep();
} finally {
gc.close();
}
session.logout();
rm.stop();
}
Aggregations