Search in sources :

Example 11 with AggregationCompleted

use of org.nhindirect.monitor.dao.entity.AggregationCompleted in project nhin-d by DirectProject.

the class AggregationDAOImpl_getAggregationCompletedTest method testGetAggregationCompleted_nonEmptyRepository_keyDoesntExist_assertNoAggregation.

@Test
public void testGetAggregationCompleted_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);
    assertNotNull(notifDao.getAggregation("12345"));
    final Aggregation remove = new Aggregation();
    remove.setExchangeBlob(new byte[] { 0, 3, 2 });
    remove.setId("12345");
    remove.setVersion(1);
    notifDao.removeAggregation(remove, "12345");
    final AggregationCompleted aggr = notifDao.getAggregationCompleted("doenst matter", true);
    assertNull(aggr);
}
Also used : Aggregation(org.nhindirect.monitor.dao.entity.Aggregation) AggregationCompleted(org.nhindirect.monitor.dao.entity.AggregationCompleted) Test(org.junit.Test)

Aggregations

AggregationCompleted (org.nhindirect.monitor.dao.entity.AggregationCompleted)11 Test (org.junit.Test)7 Aggregation (org.nhindirect.monitor.dao.entity.Aggregation)6 OptimisticLockException (javax.persistence.OptimisticLockException)4 AggregationDAOException (org.nhindirect.monitor.dao.AggregationDAOException)3 AggregationVersionException (org.nhindirect.monitor.dao.AggregationVersionException)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Calendar (java.util.Calendar)1 EntityManager (javax.persistence.EntityManager)1 Exchange (org.apache.camel.Exchange)1 Buffer (org.fusesource.hawtbuf.Buffer)1 AggregationDAOImpl (org.nhindirect.monitor.dao.impl.AggregationDAOImpl)1