Search in sources :

Example 6 with Person

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

the class AbstractSerializationPersionOkTest method test_PersonList.

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

Example 7 with Person

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

the class AbstractSerializationPersionOkTest method test_PersonListList.

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

Example 8 with Person

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

the class PojoUtilsTest method test_simpleCollection.

@Test
public void test_simpleCollection() throws Exception {
    Type gtype = getType("returnListPersonMethod");
    List<Person> list = new ArrayList<Person>();
    list.add(new Person());
    {
        Person person = new Person();
        person.setName("xxxx");
        list.add(person);
    }
    assertObject(list, gtype);
}
Also used : Type(java.lang.reflect.Type) ArrayList(java.util.ArrayList) 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)

Example 9 with Person

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

the class AbstractSerializationPersionOkTest 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);
    assertObject(args);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Person(com.alibaba.dubbo.common.model.Person) Test(org.junit.Test)

Example 10 with Person

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

the class AbstractSerializationPersionOkTest method test_StringPersonMap.

@Test
public void test_StringPersonMap() throws Exception {
    Map<String, Person> args = new HashMap<String, Person>();
    args.put("1", new Person());
    assertObject(args);
}
Also used : HashMap(java.util.HashMap) Person(com.alibaba.dubbo.common.model.Person) Test(org.junit.Test)

Aggregations

Person (com.alibaba.dubbo.common.model.Person)18 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)9 ObjectOutput (com.alibaba.dubbo.common.serialize.ObjectOutput)7 NotSerializableException (java.io.NotSerializableException)7 HashMap (java.util.HashMap)7 List (java.util.List)6 SerializablePerson (com.alibaba.dubbo.common.model.SerializablePerson)5 BigPerson (com.alibaba.dubbo.common.model.person.BigPerson)5 HashSet (java.util.HashSet)2 LinkedList (java.util.LinkedList)2 JUnitMatchers.containsString (org.junit.matchers.JUnitMatchers.containsString)2 Type (java.lang.reflect.Type)1 LinkedHashMap (java.util.LinkedHashMap)1