HessianTestHelper hessianTestHelper = new HessianTestHelper();
MessageContext msgContext = hessianTestHelper.createAxis2MessageContext(synEnv);
OMElement element = hessianTestHelper.buildHessianTestMessage(testMessageName, msgContext);
OMNode hessianNode = element.getFirstOMChild();
OMText hessianTextNode = (OMText) hessianNode;
SynapseBinaryDataSource synapseBinaryDataSource = (SynapseBinaryDataSource)
((DataHandler) hessianTextNode.getDataHandler()).getDataSource();
InputStream inputStream = synapseBinaryDataSource.getInputStream();
byte[] originalByteArray = IOUtils.toByteArray(getClass().getResourceAsStream(
testMessageName));
byte[] builderByteArray = IOUtils.toByteArray(inputStream);
assertTrue(Arrays.equals(originalByteArray, builderByteArray));