Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.AssetSource


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

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

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

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

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

        verify();
View Full Code Here


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

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

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

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

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        try
        {
            source.findAsset(_baseResource, "DoesNotExist.properties", Locale.UK);
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(
View Full Code Here

    public void asset_field_with_full_annotation()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        Inject annotation = newMock(Inject.class);
        AssetSource source = newAssetSource();
        Resource r = newResource();
        SymbolSource symbolSource = newSymbolSource();

        train_findFieldsOfType(ct, InjectAssetWorker.ASSET_TYPE_NAME, "_fred");
View Full Code Here

        getMocksControl().checkOrder(true);

        Asset coreAsset = mockAsset();
        DocumentHeadBuilder builder = mockDocumentScriptBuilder();
        Asset asset = mockAsset();
        AssetSource assetSource = mockAssetSource();
        SymbolSource symbolSource = mockSymbolSource();

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

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

        DocumentHeadBuilder builder = mockDocumentScriptBuilder();
        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();

        train_expandSymbols(source, path, expanded);

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

{

    @Test
    public void no_path_annotation()
    {
        AssetSource source = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        TypeCoercer typeCoercer = mockTypeCoercer();
        SymbolSource symbolSource = mockSymbolSource();
View Full Code Here

    }

    @Test
    public void normal_conversion()
    {
        AssetSource source = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        Asset asset = mockAsset();
        String path = "${foo}";
        String expanded = "foo/bar/baz.gif";
        AnnotationProvider annotationProvider = mockAnnotationProvider();
View Full Code Here

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

        replay();

        AssetSource source = new AssetSourceImpl(threadLocale, configuration);

        // First try creates it:

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

        // Second try shows that it is cached

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

        verify();
    }
View Full Code Here

        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

TOP

Related Classes of org.apache.tapestry.services.AssetSource

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.