Package net.spy.memcached

Examples of net.spy.memcached.OperationTimeoutException


    @Test
    public void testCacheGetThrowsTimeoutException()
            throws UnsupportedEncodingException, IOException {
        final String url = "foo";
        EasyMock.expect(mockMemcachedClient.get(url)).andThrow(
                new OperationTimeoutException("op timeout"));
        replayMocks();
        try {
            impl.getEntry(url);
            fail("IOException not thrown");
        } catch (IOException ex) {
View Full Code Here


        // update
        EasyMock.expect(
                mockMemcachedClient.cas(EasyMock.eq(url), EasyMock.eq(v
                        .getCas()), EasyMock.aryEq(new byte[0]))).andThrow(
                new OperationTimeoutException("op timeout"));
        mockSerializer.writeTo(EasyMock.same(updatedValue), EasyMock
                .isA(OutputStream.class));
        replayMocks();
        try {
            impl.updateEntry(url, callback);
View Full Code Here

        final String url = "foo";
        final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry();
        impl = new MemcachedHttpCacheStorage(mockMemcachedClient);
       
        EasyMock.expect(mockMemcachedClient.set(EasyMock.eq(url), EasyMock.anyInt(), EasyMock.anyObject()))
            .andThrow(new OperationTimeoutException(url));
       
        replayMocks();
        boolean sawIOException = false;
        try {
            impl.putEntry(url, entry);
View Full Code Here

    public void testCacheDeleteThrowsIOExceptionOnTimeout() throws Exception {
        final String url = "foo";
        impl = new MemcachedHttpCacheStorage(mockMemcachedClient);
       
        EasyMock.expect(mockMemcachedClient.delete(url))
            .andThrow(new OperationTimeoutException(url));
       
        replayMocks();
        boolean sawIOException = false;
        try {
            impl.removeEntry(url);
View Full Code Here

    } catch (InterruptedException e) {
      throw new RuntimeException("Interrupted waiting for value", e);
    } catch (ExecutionException e) {
      throw new RuntimeException("Exception waiting for value", e);
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }
  }
View Full Code Here

        throw (CancellationException) e.getCause();
      } else {
        throw new RuntimeException("Exception waiting for value", e);
      }
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }
  }
View Full Code Here

        throw (CancellationException) e.getCause();
      } else {
        throw new RuntimeException("Exception waiting for value", e);
      }
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }

  }
View Full Code Here

    } catch (InterruptedException e) {
      throw new RuntimeException("Interrupted waiting for value", e);
    } catch (ExecutionException e) {
      throw new RuntimeException("Exception waiting for value", e);
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }
  }
View Full Code Here

    } catch (InterruptedException e) {
      throw new RuntimeException("Interrupted waiting for value", e);
    } catch (ExecutionException e) {
      throw new RuntimeException("Exception waiting for value", e);
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }
  }
View Full Code Here

        throw (CancellationException) e.getCause();
      } else {
        throw new RuntimeException("Exception waiting for value", e);
      }
    } catch (TimeoutException e) {
      throw new OperationTimeoutException("Timeout waiting for value", e);
    }
  }
View Full Code Here

TOP

Related Classes of net.spy.memcached.OperationTimeoutException

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.