Search in sources :

Example 1 with StaticCounterFailFirstMockMessageProducer

use of com.adaptris.core.stubs.StaticCounterFailFirstMockMessageProducer in project interlok by adaptris.

the class RetryOnceStandaloneProducerTest method testProducerFailsFirstTimeOnlyAsProducer.

@Test
public void testProducerFailsFirstTimeOnlyAsProducer() {
    StaticCounterFailFirstMockMessageProducer producer = new StaticCounterFailFirstMockMessageProducer();
    producer.setFailUntilCount(0);
    producer.resetCount();
    service.setProducer(producer);
    try {
        service.doService(AdaptrisMessageFactory.getDefaultInstance().newMessage());
    } catch (Exception e) {
        fail();
    }
}
Also used : StaticCounterFailFirstMockMessageProducer(com.adaptris.core.stubs.StaticCounterFailFirstMockMessageProducer) Test(org.junit.Test)

Example 2 with StaticCounterFailFirstMockMessageProducer

use of com.adaptris.core.stubs.StaticCounterFailFirstMockMessageProducer in project interlok by adaptris.

the class RetryOnceStandaloneProducerTest method testProducerFailsFirstTimeOnlyAsService.

@Test
public void testProducerFailsFirstTimeOnlyAsService() {
    StaticCounterFailFirstMockMessageProducer producer = new StaticCounterFailFirstMockMessageProducer();
    producer.setFailUntilCount(1);
    producer.resetCount();
    service.setProducer(producer);
    try {
        service.doService(AdaptrisMessageFactory.getDefaultInstance().newMessage());
    } catch (Exception e) {
        fail();
    }
}
Also used : StaticCounterFailFirstMockMessageProducer(com.adaptris.core.stubs.StaticCounterFailFirstMockMessageProducer) Test(org.junit.Test)

Aggregations

StaticCounterFailFirstMockMessageProducer (com.adaptris.core.stubs.StaticCounterFailFirstMockMessageProducer)2 Test (org.junit.Test)2