Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ClasspathAssetAliasManager


    {
        ResourceCache cache = mockResourceCache();

        Resource r = new ClasspathResource("foo/Bar.txt");

        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        train_requiresDigest(cache, r, false);

        String expectedClientURL = "/context/asset/foo/Bar.txt";
View Full Code Here


    @Test
    public void simple_asset_client_URL()
    {
        ResourceCache cache = mockResourceCache();
        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        Resource r = new ClasspathResource("foo/Bar.txt");

        train_requiresDigest(cache, r, false);
View Full Code Here

    @Test
    public void protected_asset_client_URL()
    {
        ResourceCache cache = mockResourceCache();
        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        Resource r = new ClasspathResource("foo/Bar.txt");

        train_requiresDigest(cache, r, true);
View Full Code Here

    {
        ResourceCache cache = mockResourceCache();

        Resource r = new ClasspathResource("foo/Bar.txt");

        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        train_requiresDigest(cache, r, false);

        String expectedClientURL = "/context/asset/foo/Bar.txt";
View Full Code Here

    @Test
    public void simple_asset_client_URL()
    {
        ResourceCache cache = mockResourceCache();
        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        Resource r = new ClasspathResource("foo/Bar.txt");

        train_requiresDigest(cache, r, false);
View Full Code Here

    @Test
    public void protected_asset_client_URL()
    {
        ResourceCache cache = mockResourceCache();
        ClasspathAssetAliasManager aliasManager = mockClasspathAssetAliasManager();

        Resource r = new ClasspathResource("foo/Bar.txt");

        train_requiresDigest(cache, r, true);
View Full Code Here

        expected.put("tapestry", "org/apache/tapestry5");
        expected.put("tapestry-internal", "org/apache/tapestry5/internal");
        expected.put("mylib", "com/example/mylib");

        ClasspathAssetAliasManager manager = new ClasspathAssetAliasManagerImpl(null, configuration());

        assertEquals(manager.getMappings(), expected);
    }
View Full Code Here

        train_getContextPath(request, "/ctx");

        replay();

        ClasspathAssetAliasManager manager = new ClasspathAssetAliasManagerImpl(new AssetPathConstructorImpl(request,
                baseURLSource, APP_VERSION, "", false), configuration());

        String expectedPath = "/ctx" + RequestConstants.ASSET_PATH_PREFIX + APP_VERSION + "/" + expectedClientURL;
        assertEquals(manager.toClientURL(resourcePath), expectedPath);

        verify();
    }
View Full Code Here

    }

    @Test
    public void failure_if_path_not_in_mapped_alias_folder()
    {
        ClasspathAssetAliasManager manager = new ClasspathAssetAliasManagerImpl(null, configuration());

        try
        {
            manager.toClientURL("org/example/icons/flag.gif");
            unreachable();
        } catch (UnknownValueException ex)
        {
            assertMessageContains(ex, "Unable to create a client URL for classpath resource org/example/icons/flag.gif");
View Full Code Here

        train_optimizePath(optimizer, "/ctx" + RequestConstants.ASSET_PATH_PREFIX + expectedClientURL, OPTIMIZED);


        replay();

        ClasspathAssetAliasManager manager = new ClasspathAssetAliasManagerImpl(request, optimizer, configuration());

        assertEquals(manager.toClientURL(resourcePath), OPTIMIZED);

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.ClasspathAssetAliasManager

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.