Search in sources :

Example 11 with MultiPayloadMessageFactory

use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.

the class MultiPayloadStringOutputParameterTest method testInsert.

@Test
public void testInsert() throws Exception {
    MultiPayloadStringOutputParameter parameter = new MultiPayloadStringOutputParameter();
    MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
    parameter.insert(PAYLOAD, ID, message);
    assertEquals(PAYLOAD, message.getContent(ID));
}
Also used : MultiPayloadMessageFactory(com.adaptris.core.MultiPayloadMessageFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) Test(org.junit.Test)

Example 12 with MultiPayloadMessageFactory

use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.

the class MultiPayloadStringOutputParameterTest method testInsertUseDefaultId.

@Test
public void testInsertUseDefaultId() throws Exception {
    MultiPayloadStringOutputParameter parameter = new MultiPayloadStringOutputParameter();
    MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory();
    MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) messageFactory.newMessage();
    parameter.insert(PAYLOAD, null, message);
    assertEquals(PAYLOAD, message.getContent(messageFactory.getDefaultPayloadId()));
}
Also used : MultiPayloadMessageFactory(com.adaptris.core.MultiPayloadMessageFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) Test(org.junit.Test)

Example 13 with MultiPayloadMessageFactory

use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.

the class MultiPayloadByteArrayInputParameterTest method testExtract.

@Test
public void testExtract() throws Exception {
    MultiPayloadByteArrayInputParameter parameter = new MultiPayloadByteArrayInputParameter();
    parameter.setPayloadId(ID);
    MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage(ID, PAYLOAD);
    assertArrayEquals(PAYLOAD, parameter.extract(message));
    assertArrayEquals(PAYLOAD, parameter.extract(ID, message));
    assertArrayEquals(PAYLOAD, parameter.extract(null, message));
}
Also used : MultiPayloadMessageFactory(com.adaptris.core.MultiPayloadMessageFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) Test(org.junit.Test)

Example 14 with MultiPayloadMessageFactory

use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.

the class MultiPayloadByteArrayOutputParameterTest method testInsert.

@Test
public void testInsert() throws Exception {
    MultiPayloadByteArrayOutputParameter parameter = new MultiPayloadByteArrayOutputParameter();
    MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
    parameter.insert(PAYLOAD, ID, message);
    assertArrayEquals(PAYLOAD, message.getPayload(ID));
}
Also used : MultiPayloadMessageFactory(com.adaptris.core.MultiPayloadMessageFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) Test(org.junit.Test)

Example 15 with MultiPayloadMessageFactory

use of com.adaptris.core.MultiPayloadMessageFactory in project interlok by adaptris.

the class MultiPayloadByteArrayOutputParameterTest method testInsertUseDefaultId.

@Test
public void testInsertUseDefaultId() throws Exception {
    MultiPayloadByteArrayOutputParameter parameter = new MultiPayloadByteArrayOutputParameter();
    MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory();
    MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) messageFactory.newMessage();
    parameter.insert(PAYLOAD, null, message);
    assertArrayEquals(PAYLOAD, message.getPayload(messageFactory.getDefaultPayloadId()));
}
Also used : MultiPayloadMessageFactory(com.adaptris.core.MultiPayloadMessageFactory) MultiPayloadAdaptrisMessage(com.adaptris.core.MultiPayloadAdaptrisMessage) Test(org.junit.Test)

Aggregations

MultiPayloadMessageFactory (com.adaptris.core.MultiPayloadMessageFactory)26 MultiPayloadAdaptrisMessage (com.adaptris.core.MultiPayloadAdaptrisMessage)24 Test (org.junit.Test)23 InputStream (java.io.InputStream)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 Before (org.junit.Before)2 ServiceException (com.adaptris.core.ServiceException)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1