use of org.apache.dubbo.common.serialize.model.BizException in project dubbo by alibaba.
the class AbstractSerializationTest method test_BizException_WithType.
@Test
public void test_BizException_WithType() throws Exception {
BizException e = new BizException("Hello");
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(e);
objectOutput.flushBuffer();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
Object read = deserialize.readObject(BizException.class);
assertEquals("Hello", ((BizException) read).getMessage());
}
use of org.apache.dubbo.common.serialize.model.BizException in project dubbo by alibaba.
the class AbstractSerializationTest method test_BizException.
@Test
public void test_BizException() throws Exception {
BizException e = new BizException("Hello");
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(e);
objectOutput.flushBuffer();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
Object read = deserialize.readObject();
assertEquals("Hello", ((BizException) read).getMessage());
}
Aggregations