private void decodePI(ProtocolInitiation pi) throws Exception
{
// we need to do this test at the level of the decoder since we initially only expect PI frames
// so the protocol handler is not set up to know whether it should be expecting a PI frame or
// a different type of frame
AMQDecoder decoder = new AMQDecoder(true);
AMQEncoder encoder = new AMQEncoder();
TestProtocolEncoderOutput peo = new TestProtocolEncoderOutput();
encoder.encode(_mockIoSession, pi, peo);
TestProtocolDecoderOutput pdo = new TestProtocolDecoderOutput();
decoder.decode(_mockIoSession, peo.result, pdo);
((ProtocolInitiation) pdo.result).checkVersion(this);
}