@Test
  public void testInMemoryObjectStore() throws Exception {
    final IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("inMemoryStore");

    final ObjectStore<?> store = filter.getStore();
    assertEquals(InMemoryObjectStore.class, store.getClass());

    final InMemoryObjectStore<?> memoryStore = (InMemoryObjectStore<?>) store;
    assertEquals(1000, memoryStore.getEntryTTL());
    assertEquals(2000, memoryStore.getExpirationInterval());
    assertEquals(3000, memoryStore.getMaxEntries());
  }
Пример #2
0
 public void testIdempotentSecureHashReceiverRouter() throws Exception {
   Router r = lookupInboundRouterFromService("IdempotentSecureHashReceiverRouter");
   assertTrue(r instanceof IdempotentSecureHashReceiver);
   IdempotentSecureHashReceiver router = (IdempotentSecureHashReceiver) r;
   assertEquals("SHA-128", router.getMessageDigestAlgorithm());
   assertNotNull(router.getStore());
   assertTrue(router.getStore() instanceof InMemoryObjectStore);
   InMemoryObjectStore store = (InMemoryObjectStore) router.getStore();
   assertEquals(1001, store.getEntryTTL());
   assertEquals(1001, store.getExpirationInterval());
   assertEquals(1001, store.getMaxEntries());
   assertEquals("xyz", store.getName());
   assertNotNull(store.getScheduler());
 }
  @Test
  public void testIdempotentSecureHashReceiverRouter() throws Exception {
    MessageProcessor router = lookupMessageProcessorFromFlow("IdempotentSecureHashReceiverRouter");
    assertTrue(router instanceof IdempotentSecureHashMessageFilter);

    IdempotentSecureHashMessageFilter filter = (IdempotentSecureHashMessageFilter) router;
    assertEquals("SHA-128", filter.getMessageDigestAlgorithm());
    assertNotNull(filter.getStore());
    assertTrue(filter.getStore() instanceof InMemoryObjectStore);

    InMemoryObjectStore<String> store = (InMemoryObjectStore<String>) filter.getStore();
    assertEquals(1001, store.getEntryTTL());
    assertEquals(1001, store.getExpirationInterval());
    assertEquals(1001, store.getMaxEntries());
    assertEquals("xyz", store.getName());
    assertNotNull(store.getScheduler());
  }