CodecUtil.copy(new FileInputStream(msgoutFile), expectedstream);
assertEquals("Wrong Expected result", new String(expectedstream.toByteArray()), new String(out.toByteArray()));
Message roundtripMessage = new Message(new FileInputStream(msgoutFile), config);
ByteArrayOutputStream outRoundtrip = new ByteArrayOutputStream();
roundtripMessage.writeTo(outRoundtrip, MessageUtils.LENIENT);
assertEquals("Failed LENIENT roundtrip", new String(out.toByteArray()), new String(outRoundtrip.toByteArray()));
roundtripMessage = new Message(new FileInputStream(msgoutFile), config);
outRoundtrip = new ByteArrayOutputStream();
roundtripMessage.writeTo(outRoundtrip, MessageUtils.STRICT_ERROR);