   @Test
   public void testDecode() throws Exception {

      //构造序列化后的hessian字节码
      SwallowMessage msg = new SwallowMessage();
      msg.setGeneratedTime(new Date());
      msg.setMessageId(123L);
      HashMap<String, String> map = new HashMap<String, String>();
      map.put("property-key", "property-value");
      msg.setContent("content");
      ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
      Hessian2Output h2o = new Hessian2Output(bos);
      h2o.setSerializerFactory(factory);
      h2o.writeObject(msg);
      h2o.flush();
      h2o.close();
      byte[] content = bos.toByteArray();
      //使用HessianDecoder解码
      HessianDecoder hessianDecoder = new HessianDecoder();
      Message actualMsg = (Message) hessianDecoder.decode(null, null, ChannelBuffers.wrappedBuffer(content));
      //assert
      Assert.assertEquals(msg, actualMsg);
   }