use of org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl in project activemq-artemis by apache.
the class KahaDBSchedulerIndexRebuildTest method createScheduler.
protected JobSchedulerStoreImpl createScheduler() {
JobSchedulerStoreImpl scheduler = new JobSchedulerStoreImpl();
scheduler.setDirectory(schedulerStoreDir);
scheduler.setJournalMaxFileLength(10 * 1024);
return scheduler;
}
use of org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl in project activemq-artemis by apache.
the class KahaDBSchedulerIndexRebuildTest method testIndexRebuilds.
@Test
public void testIndexRebuilds() throws Exception {
IOHelper.deleteFile(schedulerStoreDir);
JobSchedulerStoreImpl schedulerStore = createScheduler();
broker = createBroker(schedulerStore);
broker.start();
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
Connection connection = cf.createConnection();
connection.start();
for (int i = 0; i < NUM_JOBS; ++i) {
scheduleRepeating(connection);
}
connection.close();
JobScheduler scheduler = schedulerStore.getJobScheduler("JMS");
assertNotNull(scheduler);
assertEquals(NUM_JOBS, scheduler.getAllJobs().size());
broker.stop();
IOHelper.delete(new File(schedulerStoreDir, "scheduleDB.data"));
schedulerStore = createScheduler();
broker = createBroker(schedulerStore);
broker.start();
scheduler = schedulerStore.getJobScheduler("JMS");
assertNotNull(scheduler);
assertEquals(NUM_JOBS, scheduler.getAllJobs().size());
}
use of org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl in project activemq-artemis by apache.
the class SchedulerDBVersionTest method testCreateStore.
@Ignore("Used only when a new version of the store needs to archive it's test data.")
@Test
public void testCreateStore() throws Exception {
JobSchedulerStoreImpl scheduler = new JobSchedulerStoreImpl();
File dir = new File("src/test/resources/org/apache/activemq/store/schedulerDB/legacy");
IOHelper.deleteFile(dir);
scheduler.setDirectory(dir);
scheduler.setJournalMaxFileLength(1024 * 1024);
broker = createBroker(scheduler);
broker.start();
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
Connection connection = cf.createConnection();
connection.start();
scheduleRepeating(connection);
connection.close();
broker.stop();
}
Aggregations