@Test
public void testAlarmQueueThreadError() {

    EntityDataStoreManager manager = m_persistenceManager.getEntityDataStoreManager();
    AlarmQueue alarmQueue = mock(AlarmQueue.class);
    AlarmQueueThread alarmQueueThread = new AlarmQueueThread(alarmQueue);
    AlarmInfo alarmInfo = buildAlarmInfo();
    m_alarmService.raiseAlarm(alarmInfo);
    doThrow(new RuntimeException("error")).when(alarmQueue).clearQueue();
    // should not throw an exception, only log
    manager.beginTransaction();
    alarmQueueThread.doOneRun();
    manager.commitTransaction();
    manager.beginTransaction();
    List<Alarm> alarms = manager.findAll(Alarm.class);
    manager.commitTransaction();
    assertEquals(0, alarms.size());
}