use of com.alibaba.dubbo.common.model.Person in project dubbo by alibaba.
the class AbstractSerializationPersionFailTest method test_StringPersonListMap.
@Test
public void test_StringPersonListMap() throws Exception {
Map<String, List<Person>> args = new HashMap<String, List<Person>>();
List<Person> sublist = new ArrayList<Person>();
sublist.add(new Person());
args.put("1", sublist);
try {
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(args);
fail();
} catch (NotSerializableException expected) {
} catch (IllegalStateException expected) {
assertThat(expected.getMessage(), containsString("Serialized class com.alibaba.dubbo.common.model.Person must implement java.io.Serializable"));
}
}
use of com.alibaba.dubbo.common.model.Person in project dubbo by alibaba.
the class AbstractSerializationPersionFailTest method test_IntPersonMap.
@Test
public void test_IntPersonMap() throws Exception {
Map<Integer, Person> args = new HashMap<Integer, Person>();
args.put(1, new Person());
try {
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(args);
fail();
} catch (NotSerializableException expected) {
} catch (IllegalStateException expected) {
assertThat(expected.getMessage(), containsString("Serialized class com.alibaba.dubbo.common.model.Person must implement java.io.Serializable"));
}
}
use of com.alibaba.dubbo.common.model.Person in project dubbo by alibaba.
the class AbstractSerializationPersionFailTest method test_Person.
@Test
public void test_Person() throws Exception {
try {
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(new Person());
fail();
} catch (NotSerializableException expected) {
} catch (IllegalStateException expected) {
assertThat(expected.getMessage(), containsString("Serialized class com.alibaba.dubbo.common.model.Person must implement java.io.Serializable"));
}
}
use of com.alibaba.dubbo.common.model.Person in project dubbo by alibaba.
the class AbstractSerializationPersionFailTest method test_PersonSet.
@Test
public void test_PersonSet() throws Exception {
Set<Person> args = new HashSet<Person>();
args.add(new Person());
try {
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeObject(args);
fail();
} catch (NotSerializableException expected) {
} catch (IllegalStateException expected) {
assertThat(expected.getMessage(), containsString("Serialized class com.alibaba.dubbo.common.model.Person must implement java.io.Serializable"));
}
}
use of com.alibaba.dubbo.common.model.Person in project dubbo by alibaba.
the class AbstractSerializationPersionOkTest method test_PersonSet.
@Test
public void test_PersonSet() throws Exception {
Set<Person> args = new HashSet<Person>();
args.add(new Person());
assertObject(args);
}
Aggregations