use of org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeJournalLoader in project activemq-artemis by apache.
the class StorageManagerTestBase method createStorage.
/**
* @throws Exception
*/
protected void createStorage() throws Exception {
if (storeType == StoreConfiguration.StoreType.DATABASE) {
journal = createJDBCJournalStorageManager(createDefaultJDBCConfig(true));
} else {
journal = createJournalStorageManager(createDefaultInVMConfig());
}
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new ArrayList<GroupingInfo>(), new ArrayList<AddressBindingInfo>());
journal.loadMessageJournal(new FakePostOffice(), null, null, null, null, null, null, new FakeJournalLoader());
}
use of org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeJournalLoader in project activemq-artemis by apache.
the class RestartSMTest method testRestartStorageManager.
@Test
public void testRestartStorageManager() throws Exception {
File testdir = new File(getTestDir());
deleteDirectory(testdir);
PostOffice postOffice = new FakePostOffice();
final JournalStorageManager journal = new JournalStorageManager(createDefaultInVMConfig(), EmptyCriticalAnalyzer.getInstance(), execFactory, execFactory);
try {
journal.start();
List<QueueBindingInfo> queueBindingInfos = new ArrayList<>();
journal.loadBindingJournal(queueBindingInfos, new ArrayList<GroupingInfo>(), new ArrayList<AddressBindingInfo>());
journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader());
journal.stop();
deleteDirectory(testdir);
journal.start();
journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader());
queueBindingInfos = new ArrayList<>();
journal.loadBindingJournal(queueBindingInfos, new ArrayList<GroupingInfo>(), new ArrayList<AddressBindingInfo>());
journal.start();
} finally {
try {
journal.stop();
} catch (Exception ex) {
RestartSMTest.log.warn(ex.getMessage(), ex);
}
}
}
Aggregations