killRemoteCacheManager(remoteCacheManager);
killServers(hotRodServer);
}
public void testPutAndGet() throws Exception {
User user = createUser();
remoteCache.put(1, user);
// try to get the object through the local cache interface and check it's the same object we put
assertEquals(1, cache.keySet().size());
byte[] key = (byte[]) cache.keySet().iterator().next();
Object localObject = cache.get(key);
assertNotNull(localObject);
assertTrue(localObject instanceof byte[]);
Object unmarshalledObject = ProtobufUtil.fromWrappedByteArray(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager), (byte[]) localObject);
assertTrue(unmarshalledObject instanceof User);
assertUser((User) unmarshalledObject);
// get the object through the remote cache interface and check it's the same object we put
User fromRemoteCache = remoteCache.get(1);
assertUser(fromRemoteCache);
}