Package org.infinispan.client.hotrod.protostream.domain

Examples of org.infinispan.client.hotrod.protostream.domain.User


      List<Address> addresses = reader.readCollection("address", new ArrayList<Address>(), Address.class);

      Integer age = reader.readInt("age");
      User.Gender gender = reader.readObject("gender", User.Gender.class);

      User user = new User();
      user.setId(id);
      user.setAccountIds(accountIds);
      user.setName(name);
      user.setSurname(surname);
      user.setAge(age);
      user.setGender(gender);
      user.setAddresses(addresses);
      return user;
   }
View Full Code Here


      killServers(hotRodServer);
   }

   @Test
   public void testPutAndGet() throws Exception {
      User user = new User();
      user.setId(1);
      user.setName("Tom");
      user.setSurname("Cat");
      user.setGender(User.Gender.MALE);
      user.setAccountIds(Collections.singletonList(12));
      Address address = new Address();
      address.setStreet("Dark Alley");
      address.setPostCode("1234");
      user.setAddresses(Collections.singletonList(address));

      remoteCache.put(1, user);

      User fromCache = remoteCache.get(1);
      assertEquals(1, fromCache.getId());
      assertEquals("Tom", fromCache.getName());
      assertEquals("Cat", fromCache.getSurname());
      assertEquals(User.Gender.MALE, fromCache.getGender());
      assertNotNull(fromCache.getAccountIds());
      assertEquals(1, fromCache.getAccountIds().size());
      assertEquals(12, fromCache.getAccountIds().get(0).intValue());
      assertNotNull(fromCache.getAddresses());
      assertEquals(1, fromCache.getAddresses().size());
      assertEquals("Dark Alley", fromCache.getAddresses().get(0).getStreet());
      assertEquals("1234", fromCache.getAddresses().get(0).getPostCode());
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.protostream.domain.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.