Esempio n. 1
0
  /** Basic dispatcher test which verifies erroneous interceptor. */
  @Test
  public void testAfterProviderErrorInOnly() {
    ErrorInterceptor interceptor = new ErrorInterceptor(true, ExchangeInterceptor.PROVIDER);
    _camelContext.getWritebleRegistry().put("interceptor", interceptor);

    ServiceReference ref = registerInOnlyService("inOnly", new MockHandler());
    Exchange exchange = sendMessage(ref, TEST_CONTENT);

    assertNoCause("Error after on target Provider", exchange);
    Assert.assertEquals(2, interceptor.getCount());
  }
Esempio n. 2
0
  /** Basic dispatcher test which verifies erroneous interceptor. */
  @Test
  public void testBeforeProviderErrorInOut() {
    ErrorInterceptor interceptor = new ErrorInterceptor(false, ExchangeInterceptor.PROVIDER);
    _camelContext.getWritebleRegistry().put("interceptor", interceptor);

    ServiceReference ref = registerInOutService("inOut");
    Exchange exchange = sendMessage(ref, TEST_CONTENT);

    assertNoCause("Error before on target Provider", exchange);
    Assert.assertEquals(2, interceptor.getCount());
  }