Examples of Memcache


Examples of com.googlecode.hibernate.memcached.Memcache

  public void testXmemcachedClient() throws Exception {
    PropertiesHelper propertiesHelper = new PropertiesHelper(
        this.properties);
    XmemcachedClientFactory clientFactory = new XmemcachedClientFactory(
        propertiesHelper);
    Memcache cache = clientFactory.createMemcacheClient();
    testCache(cache);
    cache.shutdown();
  }
View Full Code Here

Examples of com.googlecode.hibernate.memcached.Memcache

  public void testSpymemcacheClient() throws Exception {
    PropertiesHelper propertiesHelper = new PropertiesHelper(
        this.properties);
    SpyMemcacheClientFactory clientFactory = new SpyMemcacheClientFactory(
        propertiesHelper);
    Memcache cache = clientFactory.createMemcacheClient();
    testCache(cache);
    cache.shutdown();
  }
View Full Code Here

Examples of foo.domaintest.util.Memcache

  @Test
  public void testIntegration() throws Exception {
    StashAction stash = new StashAction();
    stash.response = new Response(sleeper, servletResponse, metrics);
    stash.memcache = new Memcache(null, metrics);
    StringWriter stashWriter = new StringWriter();
    when(servletResponse.getWriter()).thenReturn(new PrintWriter(stashWriter));
    stash.tempUrlFactory = new TempUrlFactory("http://testing.example/stash");
    stash.lazyRandomToken = lazy("token");
    stash.status = 234;
    stash.payload = "foo";
    stash.run();

    TempAction temp = new TempAction();
    temp.response = new Response(sleeper, servletResponse, metrics);
    temp.memcache = new Memcache(null, metrics);
    StringWriter tempWriter = new StringWriter();
    when(servletResponse.getWriter()).thenReturn(new PrintWriter(tempWriter));
    temp.requestPath = stashWriter.toString().replaceFirst(".*/", "");
    temp.run();
    verify(servletResponse).setStatus(234);
View Full Code Here

Examples of foo.domaintest.util.Memcache

  @Rule public TestEnvironment env = new TestEnvironment(new LocalMemcacheServiceTestConfig());

  @Test
  public void testSavesAndReturnsToken() {
    TokenAction action = new TokenAction();
    action.memcache = new Memcache(null, mock(Metrics.class));
    action.response = new FakeResponse();
    action.randomToken = "token";
    action.run();
    assertEquals(
        new FakeResponse().setPayload("token"),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.