Package org.apache.shindig.common.cache

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


    // 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


*/
public class EhCacheCacheProviderTest {

  @Test
  public void getAnonCache() throws Exception {
    CacheProvider defaultProvider = new EhCacheCacheProvider(
        "res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml", true, true);
    Cache<String, String> cache = defaultProvider.createCache(null);
    Assert.assertNotNull(cache);
    Assert.assertNull(cache.getElement("test"));
    cache.addElement("test", "value1");
    Assert.assertEquals("value1", cache.getElement("test"));
    cache.removeElement("test");
View Full Code Here

  }

  @Test
  public void getNamedCache() throws Exception {
    CacheProvider defaultProvider = new EhCacheCacheProvider(
        "res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml", true, true);
    Cache<String, String> cache = defaultProvider.createCache("testcache");
    Cache<String, String> cache2 = defaultProvider.createCache("testcache");
    Assert.assertNotNull(cache);
    Assert.assertEquals(cache, cache2);
    Assert.assertNull(cache.getElement("test"));
    cache.addElement("test", "value1");
    Assert.assertEquals("value1", cache.getElement("test"));
View Full Code Here

    // 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


  // Fails due to non-existent mail classes referenced in caja
  // @Test
  public void testIncludedURLRequestMarkedInternal() throws Exception {
    CacheProvider lru = new LruCacheProvider(3);
    DefaultHtmlSerializer defaultSerializer = new DefaultHtmlSerializer();
    CapturingPipeline pipeline = new CapturingPipeline();
    rewriter = new CajaContentRewriter(lru, pipeline, defaultSerializer, proxyUriManager) {
      @Override
      protected PluginCompiler makePluginCompiler(PluginMeta m, MessageQueue q) {
View Full Code Here

    // 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


  // Fails due to non-existent mail classes referenced in caja
  // @Test
  public void testIncludedURLRequestMarkedInternal() throws Exception {
    CacheProvider lru = new LruCacheProvider(3);
    DefaultHtmlSerializer defaultSerializer = new DefaultHtmlSerializer();
    CapturingPipeline pipeline = new CapturingPipeline();
    rewriter = new CajaContentRewriter(lru, pipeline, defaultSerializer, proxyUriManager) {
      @Override
      protected PluginCompiler makePluginCompiler(PluginMeta m, MessageQueue q) {
View Full Code Here

    // 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


  // Fails due to non-existent mail classes referenced in caja
  // @Test
  public void testIncludedURLRequestMarkedInternal() throws Exception {
    CacheProvider lru = new LruCacheProvider(3);
    DefaultHtmlSerializer defaultSerializer = new DefaultHtmlSerializer();
    CapturingPipeline pipeline = new CapturingPipeline();
    rewriter = new CajaContentRewriter(lru, pipeline, defaultSerializer, proxyUriManager) {
      @Override
      protected PluginCompiler makePluginCompiler(PluginMeta m, MessageQueue q) {
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

TOP

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

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.