/** * Puts a cache item to the cache. * <p> * @param item * @throws IOException */ @Override public void update( ICacheElement<K, V> item ) throws IOException { update( item, 0 ); }
/** * Puts a cache item to the cache. * <p> * @param item * @throws IOException */ @Override public void update( ICacheElement<K, V> item ) throws IOException { update( item, 0 ); }
/** * Verify update functionality * <p> * @throws IOException */ public void testUpdate_normal() throws IOException { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); String cacheName = "test"; ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); // DO WORK client.update( element ); // VERIFY assertEquals( "Wrong type.", RemoteRequestType.UPDATE, mockDispatcher.lastRemoteCacheRequest .getRequestType() ); }
/** * Verify update functionality * <p> * @throws IOException */ public void testUpdate_normal() throws IOException { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); String cacheName = "test"; ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); // DO WORK client.update( element ); // VERIFY assertEquals( "Wrong type.", RemoteRequestType.UPDATE, mockDispatcher.lastRemoteCacheRequest .getRequestType() ); }