Search in sources :

Example 6 with SerializablePerson

use of com.alibaba.dubbo.common.model.SerializablePerson in project dubbo by alibaba.

the class AbstractSerializationTest method test_StringSPersonListMap.

// ================ Complex Collection Type ================ 
@Test
public void test_StringSPersonListMap() throws Exception {
    Map<String, List<SerializablePerson>> args = new HashMap<String, List<SerializablePerson>>();
    List<SerializablePerson> sublist = new ArrayList<SerializablePerson>();
    sublist.add(new SerializablePerson());
    args.put("1", sublist);
    assertObject(args);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) SerializablePerson(com.alibaba.dubbo.common.model.SerializablePerson) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test)

Example 7 with SerializablePerson

use of com.alibaba.dubbo.common.model.SerializablePerson in project dubbo by alibaba.

the class AbstractSerializationTest method test_SPersonList.

@Test
public void test_SPersonList() throws Exception {
    List<SerializablePerson> args = new ArrayList<SerializablePerson>();
    args.add(new SerializablePerson());
    assertObject(args);
}
Also used : SerializablePerson(com.alibaba.dubbo.common.model.SerializablePerson) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 8 with SerializablePerson

use of com.alibaba.dubbo.common.model.SerializablePerson in project dubbo by alibaba.

the class PojoUtilsTest method test_Map_List_pojo.

@Test
public void test_Map_List_pojo() throws Exception {
    Map<String, List<Object>> map = new HashMap<String, List<Object>>();
    List<Object> list = new ArrayList<Object>();
    list.add(new Person());
    list.add(new SerializablePerson());
    map.put("k", list);
    Object generalize = PojoUtils.generalize(map);
    Object realize = PojoUtils.realize(generalize, Map.class);
    assertEquals(map, realize);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) SerializablePerson(com.alibaba.dubbo.common.model.SerializablePerson) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) BigPerson(com.alibaba.dubbo.common.model.person.BigPerson) SerializablePerson(com.alibaba.dubbo.common.model.SerializablePerson) Person(com.alibaba.dubbo.common.model.Person) Test(org.junit.Test)

Aggregations

SerializablePerson (com.alibaba.dubbo.common.model.SerializablePerson)8 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)4 List (java.util.List)3 Person (com.alibaba.dubbo.common.model.Person)2 BigPerson (com.alibaba.dubbo.common.model.person.BigPerson)2 BigInteger (java.math.BigInteger)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1