Пример #1
0
 public void testIdempotentReceiverRouter() throws Exception {
   Router r = lookupInboundRouterFromService("IdempotentReceiverRouter");
   assertTrue(r instanceof IdempotentReceiver);
   IdempotentReceiver router = (IdempotentReceiver) r;
   assertEquals("#[message:id]-#[message:correlationId]", router.getIdExpression());
   assertNotNull(router.getStore());
   assertTrue(router.getStore() instanceof TextFileObjectStore);
   TextFileObjectStore store = (TextFileObjectStore) router.getStore();
   assertEquals(-1, store.getEntryTTL());
   assertEquals(1000, store.getExpirationInterval());
   assertEquals(10000000, store.getMaxEntries());
   assertEquals("foo", store.getDirectory());
   assertNotNull(store.getName());
   assertNotNull(store.getScheduler());
 }
  @Test
  public void testIdempotentReceiverRouter() throws Exception {
    MessageProcessor router = lookupMessageProcessorFromFlow("IdempotentReceiverRouter");
    assertTrue(router instanceof IdempotentMessageFilter);

    IdempotentMessageFilter filter = (IdempotentMessageFilter) router;
    assertEquals("#[message:id]-#[message:correlationId]", filter.getIdExpression());
    assertNotNull(filter.getStore());
    assertTrue(filter.getStore() instanceof TextFileObjectStore);

    TextFileObjectStore store = (TextFileObjectStore) filter.getStore();
    assertEquals(-1, store.getEntryTTL());
    assertEquals(1000, store.getExpirationInterval());
    assertEquals(10000000, store.getMaxEntries());
    assertEquals("foo", store.getDirectory());
    assertNotNull(store.getName());
    assertNotNull(store.getScheduler());
  }