use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getKeysTest method testGetKeys_multipleEntries_assertMultipleKeys.
@Test
public void testGetKeys_multipleEntries_assertMultipleKeys() {
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(notifDao);
final Tx tx1 = TestUtils.makeMessage(TxMessageType.IMF, "12345", "", "me@test.com", "you@test.com", "", "", "");
final Exchange exchange1 = new DefaultExchange(context);
exchange1.getIn().setBody(tx1);
repo.add(context, "12345", exchange1);
final Tx tx2 = TestUtils.makeMessage(TxMessageType.IMF, "123456", "", "me@test.com", "you@test.com", "", "", "");
final Exchange exchange2 = new DefaultExchange(context);
exchange2.getIn().setBody(tx2);
repo.add(context, "123456", exchange2);
final Set<String> keys = repo.getKeys();
assertEquals(2, keys.size());
Iterator<String> iter = keys.iterator();
assertEquals("12345", iter.next());
assertEquals("123456", iter.next());
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getKeysTest method testGetKeys_singleEntry_assertSingleKey.
@Test
public void testGetKeys_singleEntry_assertSingleKey() {
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(notifDao);
final Tx tx = TestUtils.makeMessage(TxMessageType.IMF, "12345", "", "me@test.com", "you@test.com", "", "", "");
final Exchange exchange = new DefaultExchange(context);
exchange.getIn().setBody(tx);
repo.add(context, "12345", exchange);
final Set<String> keys = repo.getKeys();
assertEquals(1, keys.size());
assertEquals("12345", keys.iterator().next());
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getSetPropertiesTest method testGetSetMaxDeliveries.
@Test
public void testGetSetMaxDeliveries() {
ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository();
repo.setMaximumRedeliveries(10);
assertEquals(10, repo.getMaximumRedeliveries());
repo.setMaximumRedeliveries(100);
assertEquals(100, repo.getMaximumRedeliveries());
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getSetPropertiesTest method testGetSetRecoveryInterval.
@Test
public void testGetSetRecoveryInterval() {
ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository();
assertEquals(5000, repo.getRecoveryIntervalInMillis());
repo.setRecoveryInterval(10);
assertEquals(10, repo.getRecoveryIntervalInMillis());
repo.setRecoveryInterval(10, TimeUnit.SECONDS);
assertEquals(10000, repo.getRecoveryIntervalInMillis());
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getSetPropertiesTest method testGetSetUseRecover.
@Test
public void testGetSetUseRecover() {
ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository();
repo.setUseRecovery(true);
assertTrue(repo.isUseRecovery());
repo.setUseRecovery(false);
assertFalse(repo.isUseRecovery());
}
Aggregations