frames.add(Frame.fromBodyFragment(channelNumber, contentBody, 0, contentBody.length));
myFrameHandler.setFrames(frames.iterator());
try {
new AMQConnection(factory.params(Executors.newFixedThreadPool(1)), myFrameHandler).start();
} catch (IOException e) {
UnexpectedFrameError unexpectedFrameError = findUnexpectedFrameError(e);
assertNotNull(unexpectedFrameError);
assertEquals(AMQP.FRAME_BODY, unexpectedFrameError.getReceivedFrame().type);
assertEquals(AMQP.FRAME_HEADER, unexpectedFrameError.getExpectedFrameType());