Package test.utils.json

Examples of test.utils.json.User


  @Test
  public void test4() {
    SimpleObj2 so2 = new SimpleObj2();
    so2.setId(334);
   
    User user = new User();
    user.setId(2434L);
    user.setName("Pengtao");
    so2.setUser(user);
   
    Book book = new Book();
    book.setId(23424);
    book.setPrice(3.4);
View Full Code Here


    long[][] map = new long[][]{{3L, 44L, 55L}, {24, 324, 3}};
    obj.setMap(map);
   
    List<User> users = new ArrayList<User>();
    for (int j = 0; j < 3; j++) {
      User user = new User();
      user.setId((long)j);
      user.setName("user" + j);
      users.add(user);
    }
    obj.setUsers(users.toArray(new User[0]));
   
    String json = Json.toJson(obj);
View Full Code Here

 
  @Test
  public void test8() {
    List<User> users = new ArrayList<User>();
    for (int j = 0; j < 3; j++) {
      User user = new User();
      user.setId((long)j);
      user.setName("user" + j);
      users.add(user);
    }
    User[] u = users.toArray(new User[0]);
    String json = Json.toJson(u);
   
View Full Code Here

    m.setMap(map);
   
    Map<String, User[]> userMap = new HashMap<String, User[]>();
    List<User> users = new ArrayList<User>();
    for (int j = 0; j < 3; j++) {
      User user = new User();
      user.setId((long)j);
      user.setName("user" + j);
      users.add(user);
    }
    User[] u = users.toArray(new User[0]);
    userMap.put("user1", u);
   
    users = new ArrayList<User>();
    for (int j = 10; j < 12; j++) {
      User user = new User();
      user.setId((long)j);
      user.setName("user_b" + j);
      users.add(user);
    }
    u = users.toArray(new User[0]);
    userMap.put("user2", u);
    m.setUserMap(userMap);
View Full Code Here

TOP

Related Classes of test.utils.json.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.