{
baos.write(i);
}
byte[] originalBytes = baos.toByteArray();
byte[] compressedBytes = compressor.compressByteArray(originalBytes);
assertTrue("Source compressedBytes should be compressed", compressor.isCompressed(compressedBytes));
// now create a BytesMessage from the compressed byte[]
AbstractJmsTransformer trans = new SessionEnabledObjectToJMSMessage(session);
trans.setReturnDataType(DataTypeFactory.create(BytesMessage.class));