Package org.apache.shindig.common.cache

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


    // FIXME: Caja has trouble with the NekoSimplifiedHtmlParser
    // Disabling neko for now
    parsers = ImmutableList.of(/*neko, */caja);

    CacheProvider lru = new LruCacheProvider(3);
    RequestPipeline pipeline = EasyMock.createNiceMock(RequestPipeline.class);
    DefaultHtmlSerializer defaultSerializer = new DefaultHtmlSerializer();
    proxyUriManager = EasyMock.createNiceMock(ProxyUriManager.class);
    rewriter = new CajaContentRewriter(lru, pipeline, defaultSerializer, proxyUriManager) {
      @Override
View Full Code Here


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

  HttpRequest signedRequest;


  @Override
  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

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

  public void testClone() throws Exception {
    // Set the cache so we force cloning
    cajaCssParser.setCacheProvider(new LruCacheProvider(100));

    // Compare the raw parsed structure to a cloned one
    List<Object> styleSheet = cajaCssParser.parseImpl(CSS);
    List<Object> styleSheet2 = cajaCssParser.parse(CSS);
    assertEquals(cajaCssParser.serialize(styleSheet), cajaCssParser.serialize(styleSheet2));
View Full Code Here

    List<Object> styleSheet2 = cajaCssParser.parse(CSS);
    assertEquals(cajaCssParser.serialize(styleSheet), cajaCssParser.serialize(styleSheet2));
  }

  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

  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

  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

  }

  @Test
  public void testClone() throws Exception {
    // Set the cache so we force cloning
    cajaCssParser.setCacheProvider(new LruCacheProvider(100));

    // Compare the raw parsed structure to a cloned one
    List<Object> styleSheet = cajaCssParser.parseImpl(CSS);
    List<Object> styleSheet2 = cajaCssParser.parse(CSS);
    assertEquals(cajaCssParser.serialize(styleSheet), cajaCssParser.serialize(styleSheet2));
View Full Code Here

    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

  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

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.