use of org.nhindirect.monitor.dao.AggregationDAO in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_confirmTest method testConfirm_daoException_assertNoAggregation.
@Test
public void testConfirm_daoException_assertNoAggregation() throws Exception {
AggregationDAO dao = mock(AggregationDAO.class);
doThrow(new RuntimeException()).when(dao).confirmAggregation((String) any());
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(dao);
boolean exceptionOccured = false;
try {
repo.confirm(context, "12345");
} catch (RuntimeException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.monitor.dao.AggregationDAO in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_doStartTest method testDoStart_emptyAggregation_assertNoException.
@Test
public void testDoStart_emptyAggregation_assertNoException() throws Exception {
AggregationDAO dao = mock(AggregationDAO.class);
when(dao.getAggregationKeys()).thenReturn(new ArrayList<String>());
when(dao.getAggregationCompletedKeys()).thenReturn(new ArrayList<String>());
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(dao);
repo.doStart();
repo.doStop();
}
use of org.nhindirect.monitor.dao.AggregationDAO in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getKeysTest method testGetKeys_daoException_assertException.
@Test
public void testGetKeys_daoException_assertException() throws Exception {
AggregationDAO dao = mock(AggregationDAO.class);
doThrow(new RuntimeException()).when(dao).getAggregationKeys();
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(dao);
boolean exceptionOccured = false;
try {
repo.getKeys();
} catch (RuntimeException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.monitor.dao.AggregationDAO in project nhin-d by DirectProject.
the class TestSingleRecipReliableMessageMonitorRoute method postProcessTest.
@Override
public void postProcessTest() throws Exception {
super.postProcessTest();
final AggregationDAO dao = (AggregationDAO) context.getRegistry().lookup("aggregationDAO");
dao.purgeAll();
assertEquals(0, dao.getAggregationKeys().size());
assertEquals(0, dao.getAggregationCompletedKeys().size());
}
use of org.nhindirect.monitor.dao.AggregationDAO in project nhin-d by DirectProject.
the class TestFailedAddUpdateExchangeMonitorRoute method postProcessTest.
@Override
public void postProcessTest() throws Exception {
super.postProcessTest();
final AggregationDAO dao = (AggregationDAO) context.getRegistry().lookup("aggregationDAO");
dao.purgeAll();
assertEquals(0, dao.getAggregationKeys().size());
assertEquals(0, dao.getAggregationCompletedKeys().size());
}
Aggregations