public void testUpdate()
throws Exception
{
IRemoteCacheAttributes irca = new RemoteCacheAttributes();
irca.setRemoveUponRemotePut( false );
ICompositeCacheManager cacheMgr = new CompositeCacheManagerMockImpl();
RemoteCacheListener listener = new RemoteCacheListener( irca, cacheMgr );
String cacheName = "testName";
String key = "key";
String value = "value fdsadf dsafdsa fdsaf dsafdsaf dsafdsaf dsaf dsaf dsaf dsafa dsaf dsaf dsafdsaf";
IElementAttributes attr = new ElementAttributes();
attr.setMaxLifeSeconds( 34 );
IElementSerializer elementSerializer = new StandardSerializer();
ICacheElementSerialized element = new CacheElementSerialized( cacheName, key, elementSerializer
.serialize( value ), attr );
listener.handlePut( element );
ICacheElement after = cacheMgr.getCache( cacheName ).get( key );
assertNotNull( "Should have a deserialized object.", after );
assertEquals( "Values should be the same.", value, after.getVal() );
assertEquals( "Attributes should be the same.", attr.getMaxLifeSeconds(), after
.getElementAttributes().getMaxLifeSeconds() );