Package org.apache.shindig.common.cache

Examples of org.apache.shindig.common.cache.LruCacheProvider


    assertEquals(cajaCssParser.serialize(styleSheet), cajaCssParser.serialize(styleSheet2));
  }

  @Test
  public void testCache() throws Exception {
    cajaCssParser.setCacheProvider(new LruCacheProvider(100));
    // Ensure that we return cloned instances and not the original out of the cache. Cloned
    // instances intentionally do not compare equal but should produce the same output
    List<Object> styleSheet = cajaCssParser.parse(CSS);
    List<Object> styleSheet2 = cajaCssParser.parse(CSS);
    assertFalse(styleSheet.equals(styleSheet2));
View Full Code Here


  private CajaCssParser cajaCssParser;

  @Before
  public void setUp() throws Exception {
    cajaCssParser = new CajaCssParser();
    cajaCssParser.setCacheProvider(new LruCacheProvider(10));
  }
View Full Code Here

  HttpRequest signedRequest;


  @Before
  public void setUp() {
    cacheProvider = new LruCacheProvider(100);
    cache = new DefaultHttpCache(cacheProvider);
    service = new DefaultInvalidationService(cache, cacheProvider, new AtomicLong());
    appxToken = new FakeGadgetToken();
    appxToken.setAppId("AppX");
    appxToken.setOwnerId("OwnerX");
View Full Code Here

  /**
   * gets the cache provider to use for the set of tests
   * @return default cache provider
   */
  protected CacheProvider getCacheProvider() throws Exception {
    return new LruCacheProvider(5);
  }
View Full Code Here

public class BasicHttpFetcherTest extends AbstractHttpFetcherTest {

  @Before
  public void setUp() {
    CacheProvider cacheProvider = new LruCacheProvider(10);
    HttpCache cache = new DefaultHttpCache(cacheProvider);
    fetcher = new BasicHttpFetcher(cache, Integer.MAX_VALUE);
  }
View Full Code Here

    base = new BasicOAuthStore();
    serviceProvider = new FakeOAuthServiceProvider(clock);
    fetcherConfig = new OAuthFetcherConfig(
        new BasicBlobCrypter("abcdefghijklmnop".getBytes()),
        getOAuthStore(base),
        new DefaultHttpCache(new LruCacheProvider(10)),
        clock);

    logger = Logger.getLogger(OAuthFetcher.class.getName());
    logger.addHandler(new Handler() {
      @Override
View Full Code Here

TOP

Related Classes of org.apache.shindig.common.cache.LruCacheProvider

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.