use of org.nhindirect.monitor.dao.entity.Aggregation in project nhin-d by DirectProject.
the class AggregationDAOImpl_getAggregationKeysTest method testGetAggregationKeys_multipleEntriesInRepository_assertKeysRetrieved.
@Test
public void testGetAggregationKeys_multipleEntriesInRepository_assertKeysRetrieved() throws Exception {
final Aggregation insert = new Aggregation();
insert.setExchangeBlob(new byte[] { 0, 3, 2 });
insert.setId("12345");
insert.setVersion(0);
notifDao.addUpdateAggregation(insert);
final Aggregation insert2 = new Aggregation();
insert2.setExchangeBlob(new byte[] { 0, 3, 2 });
insert2.setId("123456");
insert2.setVersion(0);
notifDao.addUpdateAggregation(insert2);
final List<String> keys = notifDao.getAggregationKeys();
assertEquals(2, keys.size());
final Iterator<String> iter = keys.iterator();
assertEquals("12345", iter.next());
assertEquals("123456", iter.next());
}
use of org.nhindirect.monitor.dao.entity.Aggregation in project nhin-d by DirectProject.
the class AggregationDAOImpl_getAggregationTest method testGetAggregation_emptyRepository_assertNoAggregation.
@Test
public void testGetAggregation_emptyRepository_assertNoAggregation() throws Exception {
final Aggregation aggr = notifDao.getAggregation("doenst matter");
assertNull(aggr);
}
use of org.nhindirect.monitor.dao.entity.Aggregation in project nhin-d by DirectProject.
the class AggregationDAOImpl_getAggregationTest method testGetAggregation_nonEmptyRepository_keyExists_assertAggregationFound.
@Test
public void testGetAggregation_nonEmptyRepository_keyExists_assertAggregationFound() throws Exception {
final Aggregation insert = new Aggregation();
insert.setExchangeBlob(new byte[] { 0, 3, 2 });
insert.setId("12345");
insert.setVersion(0);
notifDao.addUpdateAggregation(insert);
final Aggregation aggr = notifDao.getAggregation("12345");
assertNotNull(aggr);
assertEquals(aggr, insert);
}
use of org.nhindirect.monitor.dao.entity.Aggregation in project nhin-d by DirectProject.
the class AggregationDAOImpl_getAggregationTest method testGetAggregation_nonEmptyRepository_keyDoesntExist_assertNoAggregation.
@Test
public void testGetAggregation_nonEmptyRepository_keyDoesntExist_assertNoAggregation() throws Exception {
final Aggregation insert = new Aggregation();
insert.setExchangeBlob(new byte[] { 0, 3, 2 });
insert.setId("12345");
insert.setVersion(0);
notifDao.addUpdateAggregation(insert);
final Aggregation aggr = notifDao.getAggregation("doenst matter");
assertNull(aggr);
}
use of org.nhindirect.monitor.dao.entity.Aggregation in project nhin-d by DirectProject.
the class AggregationDAOImpl_removeAggregationTest method testRemoveAggregation_emptyRepository_assertExcpetion.
@Test
public void testRemoveAggregation_emptyRepository_assertExcpetion() throws Exception {
final Aggregation remove = new Aggregation();
remove.setExchangeBlob(new byte[] { 0, 3, 2 });
remove.setId("12345");
remove.setVersion(0);
boolean exceptionOccured = false;
try {
notifDao.removeAggregation(remove, "12345");
} catch (AggregationDAOException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations