Search in sources :

Example 1 with MockHttpStoreManager

use of com.zimbra.cs.store.http.HttpStoreManagerTest.MockHttpStoreManager in project zm-mailbox by Zimbra.

the class MailboxTestUtil method clearData.

/**
     * Clears the database and index.
     * @param zimbraServerDir the directory that contains the ZimbraServer project
     */
public static void clearData(String zimbraServerDir) throws Exception {
    HSQLDB.clearDatabase(zimbraServerDir);
    MailboxManager.getInstance().clearCache();
    MailboxIndex.shutdown();
    File index = new File("build/test/index");
    if (index.isDirectory()) {
        deleteDirContents(index);
    }
    StoreManager sm = StoreManager.getInstance();
    if (sm instanceof MockStoreManager) {
        ((MockStoreManager) sm).purge();
    } else if (sm instanceof MockHttpStoreManager) {
        MockHttpStore.purge();
    }
    DocumentHandler.resetLocalHost();
    EphemeralStore.getFactory().shutdown();
}
Also used : MockStoreManager(com.zimbra.cs.store.MockStoreManager) File(java.io.File) MockHttpStoreManager(com.zimbra.cs.store.http.HttpStoreManagerTest.MockHttpStoreManager) StoreManager(com.zimbra.cs.store.StoreManager) MockStoreManager(com.zimbra.cs.store.MockStoreManager) MockHttpStoreManager(com.zimbra.cs.store.http.HttpStoreManagerTest.MockHttpStoreManager)

Aggregations

MockStoreManager (com.zimbra.cs.store.MockStoreManager)1 StoreManager (com.zimbra.cs.store.StoreManager)1 MockHttpStoreManager (com.zimbra.cs.store.http.HttpStoreManagerTest.MockHttpStoreManager)1 File (java.io.File)1