Package org.apache.tapestry5.services

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


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

        replay();

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

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

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

        replay();

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

        // First try creates it:

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

        verify();
    }
View Full Code Here

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

        replay();

        AssetSource source = new AssetSourceImpl(null, configuration, symbolSource, null, tracker);

        // First try creates it:

        assertSame(source.getExpandedAsset("${path}/SimpleComponent.properties"), asset);

        verify();

    }
View Full Code Here

        train_getLocale(threadLocale, locale);

        replay();

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

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

        verify();
    }
View Full Code Here

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

        replay();

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

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

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

        assertSame(source.getAsset(baseResource,
                "classpath:/org/apache/tapestry5/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, null, null, tracker);

        try
        {
            source.getAsset(baseResource,
                    "classpath:org/apache/tapestry5/internal/services/SimpleComponent.properties", Locale.UK);
            unreachable();
        } catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

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

        replay();

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

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

        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

        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

TOP

Related Classes of org.apache.tapestry5.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.