use of com.adaptris.util.text.mime.ByteArrayIterator in project interlok by adaptris.
the class TestMultipartOutput method testCreateMultiPartWithNullPayload.
@Test
public void testCreateMultiPartWithNullPayload() {
try {
MultiPartOutput output = new MultiPartOutput(guid.getUUID());
byte[] nullOutput = null;
output.addPart(nullOutput, guid.getUUID());
byte[] mimePayload = output.getBytes();
ByteArrayIterator input = new ByteArrayIterator(output.getBytes());
assertEquals(NUMBER_OF_PARTS, 1, input.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
use of com.adaptris.util.text.mime.ByteArrayIterator in project interlok by adaptris.
the class TestMultipartOutput method testCreateQuotedPrintableMimeOutput.
@Test
public void testCreateQuotedPrintableMimeOutput() {
try {
MultiPartOutput output = new MultiPartOutput(guid.getUUID());
output.addPart(PAYLOAD_1, ENCODING_QUOTED, guid.getUUID());
ByteArrayIterator input = new ByteArrayIterator(output.getBytes());
assertEquals(NUMBER_OF_PARTS, 1, input.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
use of com.adaptris.util.text.mime.ByteArrayIterator in project interlok by adaptris.
the class TestMultipartOutput method testCreateMultiPartWithRemovedParts.
@Test
public void testCreateMultiPartWithRemovedParts() {
try {
MultiPartOutput output = new MultiPartOutput(guid.getUUID());
String matchingContentId = guid.getUUID();
output.addPart(PAYLOAD_1, guid.getUUID());
output.addPart(PAYLOAD_1, matchingContentId);
output.addPart(PAYLOAD_1, guid.getUUID());
output.addPart(PAYLOAD_1, matchingContentId);
output.removePart(matchingContentId);
byte[] mimePayload = output.getBytes();
ByteArrayIterator input = new ByteArrayIterator(output.getBytes());
assertEquals(NUMBER_OF_PARTS, 2, input.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
use of com.adaptris.util.text.mime.ByteArrayIterator in project interlok by adaptris.
the class TestMultipartOutput method testCreatePlainMimeOutput.
@Test
public void testCreatePlainMimeOutput() {
try {
MultiPartOutput output = new MultiPartOutput(guid.getUUID());
output.addPart(PAYLOAD_1, guid.getUUID());
ByteArrayIterator input = new ByteArrayIterator(output.getBytes());
assertEquals(NUMBER_OF_PARTS, 1, input.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
use of com.adaptris.util.text.mime.ByteArrayIterator in project interlok by adaptris.
the class TestMultipartOutput method testCreate8bitMimeOutput.
@Test
public void testCreate8bitMimeOutput() {
try {
MultiPartOutput output = new MultiPartOutput(guid.getUUID());
output.addPart(PAYLOAD_1, ENCODING_8BIT, guid.getUUID());
ByteArrayIterator input = new ByteArrayIterator(output.getBytes());
assertEquals(NUMBER_OF_PARTS, 1, input.size());
} catch (Exception e) {
fail(e.getMessage());
}
}
Aggregations