Examples of AssetSource


Examples of org.apache.tapestry.services.AssetSource

        Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        // First try creates it:

        assertSame(source.getAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);

        // Second try shows that it is cached

        assertSame(source.getAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry.services.AssetSource

        Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        // First try creates it:

        assertSame(source.getClasspathAsset(
                "org/apache/tapestry/internal/services/SimpleComponent.properties",
                Locale.UK), asset);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry.services.AssetSource

        train_getLocale(threadLocale, locale);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        assertSame(
                source
                        .getClasspathAsset("org/apache/tapestry/internal/services/SimpleComponent.properties"),
                asset);

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry.services.AssetSource

        Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        assertSame(source.getAsset(
                _baseResource,
                "classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
                Locale.UK), asset);

        // Check that a leading slash is not a problem:

        assertSame(source.getAsset(
                _baseResource,
                "classpath:/org/apache/tapestry/internal/services/SimpleComponent.properties",
                Locale.UK), asset);

        verify();
View Full Code Here

Examples of org.apache.tapestry.services.AssetSource

        Map<String, AssetFactory> configuration = Collections.emptyMap();

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        try
        {
            source.getAsset(
                    _baseResource,
                    "classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
                    Locale.UK);
            unreachable();
        }
View Full Code Here

Examples of org.apache.tapestry5.services.AssetSource

        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        JavaScriptSupport js = mockJavaScriptSupport();

        train_expandSymbols(source, path, expanded);

        train_getAsset(assetSource, null, expanded, null, asset);
View Full Code Here

Examples of org.apache.tapestry5.services.AssetSource

        getMocksControl().checkOrder(true);

        Asset coreAsset = mockAsset();
        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        AssetSource assetSource = mockAssetSource();
        SymbolSource symbolSource = mockSymbolSource();

        train_expandSymbols(symbolSource, CORE_ASSET_PATH_UNEXPANDED, CORE_ASSET_PATH);
        train_getAsset(assetSource, null, CORE_ASSET_PATH, null, coreAsset);
View Full Code Here

Examples of org.apache.tapestry5.services.AssetSource

        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        DocumentLinker linker = mockDocumentLinker();
        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();

        train_expandSymbols(source, path, expanded);

        train_getAsset(assetSource, null, expanded, null, asset);
View Full Code Here

Examples of org.apache.tapestry5.services.AssetSource

        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        JavaScriptSupport js = mockJavaScriptSupport();

        train_expandSymbols(source, path, expanded);

        train_getAsset(assetSource, null, expanded, null, asset);
View Full Code Here

Examples of org.apache.tapestry5.services.AssetSource

        Map<String, AssetFactory> configuration = Collections.singletonMap("classpath", factory);

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration, null);

        // First try creates it:

        assertSame(source.getAsset(baseResource, "SimpleComponent.properties", Locale.UK), asset);

        // Second try shows that it is cached

        assertSame(source.getAsset(baseResource, "SimpleComponent.properties", Locale.UK), asset);

        verify();
    }
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.