Search in sources :

Example 16 with MockRequestReplyProducer

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

the class RequestReplyProducerTest method testRequest_AdaptrisMessage_ProduceDestination.

@Test
public void testRequest_AdaptrisMessage_ProduceDestination() throws Exception {
    MockRequestReplyProducer mock = createAndStart();
    try {
        AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("dummy");
        AdaptrisMessage reply = mock.request(msg);
        assertSame(msg, reply);
        assertTrue(msg.headersContainsKey(MockRequestReplyProducer.REPLY_METADATA_KEY));
    } finally {
        LifecycleHelper.stopAndClose(mock);
    }
}
Also used : MockRequestReplyProducer(com.adaptris.core.stubs.MockRequestReplyProducer) Test(org.junit.Test)

Example 17 with MockRequestReplyProducer

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

the class RequestReplyProducerTest method testRequest_AdaptrisMessage.

@Test
public void testRequest_AdaptrisMessage() throws Exception {
    MockRequestReplyProducer mock = createAndStart();
    try {
        AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("dummy");
        AdaptrisMessage reply = mock.request(msg);
        assertSame(msg, reply);
        assertTrue(msg.headersContainsKey(MockRequestReplyProducer.REPLY_METADATA_KEY));
    } finally {
        LifecycleHelper.stopAndClose(mock);
    }
}
Also used : MockRequestReplyProducer(com.adaptris.core.stubs.MockRequestReplyProducer) Test(org.junit.Test)

Example 18 with MockRequestReplyProducer

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

the class RequestReplyProducerTest method testRequest_AdaptrisMessage_Long.

@Test
public void testRequest_AdaptrisMessage_Long() throws Exception {
    MockRequestReplyProducer mock = createAndStart();
    try {
        AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("dummy");
        AdaptrisMessage reply = mock.request(msg, 10L);
        assertSame(msg, reply);
        assertTrue(msg.headersContainsKey(MockRequestReplyProducer.REPLY_METADATA_KEY));
    } finally {
        LifecycleHelper.stopAndClose(mock);
    }
}
Also used : MockRequestReplyProducer(com.adaptris.core.stubs.MockRequestReplyProducer) Test(org.junit.Test)

Example 19 with MockRequestReplyProducer

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

the class RequestReplyProducerTest method testProduce.

@Test
public void testProduce() throws Exception {
    AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("dummy");
    MockRequestReplyProducer mock = createAndStart();
    try {
        mock.produce(msg);
        assertEquals(1, mock.getProducedMessages().size());
    } finally {
        LifecycleHelper.stopAndClose(mock);
    }
}
Also used : MockRequestReplyProducer(com.adaptris.core.stubs.MockRequestReplyProducer) Test(org.junit.Test)

Aggregations

MockRequestReplyProducer (com.adaptris.core.stubs.MockRequestReplyProducer)19 Test (org.junit.Test)18 MockChannel (com.adaptris.core.stubs.MockChannel)7 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)7 MockMessageConsumer (com.adaptris.core.stubs.MockMessageConsumer)2 MockSkipProducerService (com.adaptris.core.stubs.MockSkipProducerService)1 MockWorkflowInterceptor (com.adaptris.core.stubs.MockWorkflowInterceptor)1 TimeInterval (com.adaptris.util.TimeInterval)1