@Test public void incrStringIntLongInt() throws TimeoutException, CacheException { EasyMock.expect(client.incr("key1", 1, 10L, 1000)).andReturn(2L); EasyMock.replay(client); assertEquals(2L, clientWrapper.incr("key1", 1, 10, 1000)); EasyMock.verify(client); }
@Override public long incr(final String key, final int by) throws TimeoutException, CacheException { try { return memcachedClient.incr(key, by); } catch (OperationTimeoutException e) { LOGGER.warn("Operation timeout while incr {}", key, e); throw new TimeoutException(e.getMessage()); } catch (RuntimeException e) { throw mapAndRethrow(e); } }
MemcacheClientWrapper extends AbstractMemcacheClientWrapper { @Override public long incr(final String key, final int by) throws TimeoutException, CacheException { try { return memcachedClient.incr(key, by); } catch (OperationTimeoutException e) { LOGGER.warn("Operation timeout while incr {}", key, e); throw new TimeoutException(e.getMessage()); } catch (RuntimeException e) { throw mapAndRethrow(e); } } }
MemcacheClientWrapper extends AbstractMemcacheClientWrapper { @Override public long incr(final String key, final int by) throws TimeoutException, CacheException { try { return memcachedClient.incr(key, by); } catch (OperationTimeoutException e) { LOGGER.warn("Operation timeout while incr {}", key, e); throw new TimeoutException(e.getMessage()); } catch (RuntimeException e) { throw mapAndRethrow(e); } } MemcacheClientWrapper(final MemcachedClientIF memcachedClient); }
MemcacheClientWrapper extends AbstractMemcacheClientWrapper { @Override public long incr(final String key, final int by) throws TimeoutException, CacheException { try { return memcachedClient.incr(key, by); } catch (OperationTimeoutException e) { LOGGER.warn("Operation timeout while incr {}", key, e); throw new TimeoutException(e.getMessage()); } catch (RuntimeException e) { throw mapAndRethrow(e); } } MemcacheClientWrapper(final MemcachedClientIF memcachedClient); @Override boolean add(final String key, final int exp, final Object value); @Override boolean add(final String key, final int exp, final T value, final CacheTranscoder transcoder); @Override long decr(final String key, final int by); @Override long decr(final String key, final int by, final long def); @Override boolean delete(final String key); @Override void flush(); @Override Object get(final String key); @Override T get(final String key, final CacheTranscoder transcoder); @Override T get(final String key, final CacheTranscoder transcoder, final long timeout); @Override Collection<SocketAddress> getAvailableServers(); @Override Map<String, Object> getBulk(final Collection<String> keys); @Override Map<String, T> getBulk(final Collection<String> keys, final CacheTranscoder transcoder); @Override long incr(final String key, final int by); @Override long incr(final String key, final int by, final long def); @Override long incr(final String key, final int by, final long def, final int expiration); @Override boolean set(final String key, final int exp, final Object value); @Override boolean set(final String key, final int exp, final T value, final CacheTranscoder transcoder); @Override void shutdown(); @Override CacheTranscoder getTranscoder(); @Override Object getNativeClient(); }
MemcacheClientWrapper extends AbstractMemcacheClientWrapper { @Override public long incr(final String key, final int by) throws TimeoutException, CacheException { try { return memcachedClient.incr(key, by); } catch (OperationTimeoutException e) { LOGGER.warn("Operation timeout while incr {}", key, e); throw new TimeoutException(e.getMessage()); } catch (RuntimeException e) { throw mapAndRethrow(e); } } MemcacheClientWrapper(final MemcachedClientIF memcachedClient); @Override boolean add(final String key, final int exp, final Object value); @Override boolean add(final String key, final int exp, final T value, final CacheTranscoder transcoder); @Override long decr(final String key, final int by); @Override long decr(final String key, final int by, final long def); @Override boolean delete(final String key); @Override void flush(); @Override Object get(final String key); @Override T get(final String key, final CacheTranscoder transcoder); @Override T get(final String key, final CacheTranscoder transcoder, final long timeout); @Override Collection<SocketAddress> getAvailableServers(); @Override Map<String, Object> getBulk(final Collection<String> keys); @Override Map<String, T> getBulk(final Collection<String> keys, final CacheTranscoder transcoder); @Override long incr(final String key, final int by); @Override long incr(final String key, final int by, final long def); @Override long incr(final String key, final int by, final long def, final int expiration); @Override boolean set(final String key, final int exp, final Object value); @Override boolean set(final String key, final int exp, final T value, final CacheTranscoder transcoder); @Override void shutdown(); @Override CacheTranscoder getTranscoder(); @Override Object getNativeClient();  }