Examples of ResponseCompressionAnalyzer


Examples of org.apache.tapestry5.services.ResponseCompressionAnalyzer

    @Test(dataProvider = "compression_search_data")
    public void compression_search(String contentType, boolean expected)
    {
        List<String> configuration = CollectionFactory.newList("is/inlist");

        ResponseCompressionAnalyzer analyzer = new ResponseCompressionAnalyzerImpl(null, configuration);

        assertEquals(analyzer.isCompressable(contentType), expected);
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ResponseCompressionAnalyzer

        // With the significant changes to the handling of assets in 5.4, we introduced a problem:
        // We were checking at page render time whether to generate URLs for normal or compressed
        // assets and that peeked at the HttpServletRequest global, which isn't set up by PageTester.
        // What we're doing here is using a hacked version of that code to force GZip support
        // on.
        configuration.add(ResponseCompressionAnalyzer.class, new ResponseCompressionAnalyzer()
        {
            public boolean isGZipEnabled(ContentType contentType)
            {
                return locator.getObject(CompressionAnalyzer.class, null).isCompressable(contentType.getMimeType());
            }
View Full Code Here

Examples of org.apache.tapestry5.services.ResponseCompressionAnalyzer

    @Test(dataProvider = "compression_search_data")
    public void compression_search(String contentType, boolean expected)
    {
        List<String> configuration = CollectionFactory.newList("is/inlist");

        ResponseCompressionAnalyzer analyzer = new ResponseCompressionAnalyzerImpl(null, configuration, true);

        assertEquals(analyzer.isCompressable(contentType), expected);
    }
View Full Code Here

Examples of org.apache.tapestry5.services.ResponseCompressionAnalyzer

        // With the significant changes to the handling of assets in 5.4, we introduced a problem:
        // We were checking at page render time whether to generate URLs for normal or compressed
        // assets and that peeked at the HttpServletRequest global, which isn't set up by PageTester.
        // What we're doing here is using a hacked version of that code to force GZip support
        // on.
        configuration.add(ResponseCompressionAnalyzer.class, new ResponseCompressionAnalyzer()
        {
            public boolean isGZipEnabled(String contentType)
            {
                return locator.getObject(CompressionAnalyzer.class, null).isCompressable(contentType);
            }
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.