Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.AssetFactory


    }

    @Test
    public void absolute_asset_with_known_prefix()
    {
        AssetFactory factory = mockAssetFactory();
        ThreadLocale threadLocale = mockThreadLocale();
        Asset asset = mockAsset();

        Resource expectedResource = _rootResource
                .forFile("org/apache/tapestry/internal/services/SimpleComponent_en_GB.properties");
View Full Code Here


        Context context = mockContext();
        Request request = mockRequest();

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context, null);

        assertEquals(factory.getRootResource().toString(), "context:/");

        verify();
    }
View Full Code Here

        train_optimizePath(optimizer, "/context/foo/Bar.txt", "/opt/path1");
        train_optimizePath(optimizer, "/context/foo/Bar.txt", "/opt/path2");

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context, optimizer);

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), "/opt/path1");

        // In real life, toString() is the same as toClientURL(), but we're testing
View Full Code Here

        Context context = newContext();
        Request request = newRequest();

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context);

        assertEquals(factory.getRootResource().toString(), "context:/");

        verify();
    }
View Full Code Here

        train_getContextPath(request, "/context");

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context);

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), "/context/foo/Bar.txt");
        assertEquals(asset.toString(), asset.toClientURL());
View Full Code Here

    private final Resource _rootResource = new ClasspathResource("/");

    @Test
    public void relative_asset()
    {
        AssetFactory factory = newAssetFactory();
        ThreadLocale threadLocale = newThreadLocale();
        Asset asset = newAsset();

        Resource expectedResource = _baseResource.forFile("SimpleComponent_en_GB.properties");
View Full Code Here

    }

    @Test
    public void get_classpath_asset()
    {
        AssetFactory factory = newAssetFactory();
        ThreadLocale threadLocale = newThreadLocale();
        Asset asset = newAsset();

        Resource expectedResource = _baseResource.forFile("SimpleComponent_en_GB.properties");
View Full Code Here

    }

    @Test
    public void get_classpath_asset_for_unspecified_locale()
    {
        AssetFactory factory = newAssetFactory();
        ThreadLocale threadLocale = newThreadLocale();
        Asset asset = newAsset();
        Locale locale = Locale.UK;

        Resource expectedResource = _baseResource.forFile("SimpleComponent_en_GB.properties");
View Full Code Here

    }

    @Test
    public void absolute_asset_with_known_prefix()
    {
        AssetFactory factory = newAssetFactory();
        ThreadLocale threadLocale = newThreadLocale();
        Asset asset = newAsset();

        Resource expectedResource = _rootResource
                .forFile("org/apache/tapestry/internal/services/SimpleComponent_en_GB.properties");
View Full Code Here

        DocumentScriptBuilder builder = newDocumentScriptBuilder();
        Asset asset = newAsset();
        Resource root = newResource();
        Resource file = newResource();
        SymbolSource source = newSymbolSource();
        AssetFactory factory = newAssetFactory();

        train_expandSymbols(source, path, expanded);

        train_getRootResource(factory, root);
        train_forFile(root, expanded, file);
View Full Code Here

TOP

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

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.