Package org.springframework.web.servlet.resource

Examples of org.springframework.web.servlet.resource.CachingResourceTransformer


  public ResourceChainRegistration(boolean cacheResources, Cache cache) {
    Assert.isTrue(!cacheResources || cache != null, "'cache' is required when cacheResources=true");
    if (cacheResources) {
      this.resolvers.add(new CachingResourceResolver(cache));
      this.transformers.add(new CachingResourceTransformer(cache));
    }
  }
View Full Code Here


    assertThat(transformers, Matchers.hasSize(3));
    assertThat(transformers.get(0), Matchers.instanceOf(CachingResourceTransformer.class));
    assertThat(transformers.get(1), Matchers.instanceOf(CssLinkResourceTransformer.class));
    assertThat(transformers.get(2), Matchers.instanceOf(AppCacheManifestTransformer.class));

    CachingResourceTransformer cachingTransformer = (CachingResourceTransformer) transformers.get(0);
    assertThat(cachingTransformer.getCache(), Matchers.instanceOf(ConcurrentMapCache.class));
    assertEquals("test-resource-cache", cachingTransformer.getCache().getName());
  }
View Full Code Here

  @Test
  public void resourceChainWithOverrides() throws Exception {
    CachingResourceResolver cachingResolver = Mockito.mock(CachingResourceResolver.class);
    VersionResourceResolver versionResolver = Mockito.mock(VersionResourceResolver.class);
    PathResourceResolver pathResourceResolver = new PathResourceResolver();
    CachingResourceTransformer cachingTransformer = Mockito.mock(CachingResourceTransformer.class);
    AppCacheManifestTransformer appCacheTransformer = Mockito.mock(AppCacheManifestTransformer.class);
    CssLinkResourceTransformer cssLinkTransformer = new CssLinkResourceTransformer();

    this.registration.setCachePeriod(3600)
        .resourceChain(false)
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.resource.CachingResourceTransformer

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.