use of com.alibaba.dubbo.common.model.BizExceptionNoDefaultConstructor in project dubbo by alibaba.
the class AbstractSerializationTest method test_BizExceptionNoDefaultConstructor.
@Test
public void test_BizExceptionNoDefaultConstructor() throws Exception {
BizExceptionNoDefaultConstructor e = new BizExceptionNoDefaultConstructor("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", ((BizExceptionNoDefaultConstructor) read).getMessage());
}
use of com.alibaba.dubbo.common.model.BizExceptionNoDefaultConstructor in project dubbo by alibaba.
the class AbstractSerializationTest method test_BizExceptionNoDefaultConstructor_WithType.
@Test
public void test_BizExceptionNoDefaultConstructor_WithType() throws Exception {
BizExceptionNoDefaultConstructor e = new BizExceptionNoDefaultConstructor("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(BizExceptionNoDefaultConstructor.class);
assertEquals("Hello", ((BizExceptionNoDefaultConstructor) read).getMessage());
}
Aggregations