Package org.apache.tapestry.ioc.internal.util

Examples of org.apache.tapestry.ioc.internal.util.ClasspathResource


        URL url = new URL("http", "localhost", JETTY_PORT, "/assets/app1/pages/nested/tapestry-button.png");

        byte[] downloaded = readContent(url);

        Resource classpathResource = new ClasspathResource(
                "org/apache/tapestry/integration/app1/pages/nested/tapestry-button.png");

        byte[] actual = readContent(classpathResource.toURL());

        assertEquals(downloaded, actual);
    }
View Full Code Here


        URL url = new URL("http", "localhost", JETTY_PORT, "/assets/app1/pages/tapestry-button.png");

        byte[] downloaded = readContent(url);

        Resource classpathResource = new ClasspathResource(
                "org/apache/tapestry/integration/app1/pages/tapestry-button.png");

        byte[] actual = readContent(classpathResource.toURL());

        assertEquals(downloaded, actual);
    }
View Full Code Here

        String path = packageName.replace('.', '/') + "/" + file;

        ClassLoader loader = getClass().getClassLoader();

        return new ClasspathResource(loader, path);
    }
View Full Code Here

        globals.store(request, response);

        String path = getClass().getPackage().getName().replace('.', '/') + "/" + fileName;

        Resource resource = new ClasspathResource(path);

        streamer.streamResource(resource);

        verify();
    }
View Full Code Here

        train_getPath(request, clientURL);

        train_toResourcePath(aliasManager, clientURL, resourcePath);

        train_requiresDigest(cache, new ClasspathResource(resourcePath), true);

        response.sendError(eq(HttpServletResponse.SC_FORBIDDEN), contains(resourcePath));

        replay();
View Full Code Here

        train_getPath(request, clientURL);

        train_toResourcePath(aliasManager, clientURL, resourcePath);

        train_requiresDigest(cache, new ClasspathResource(resourcePath), true);

        train_getDigest(cache, SMILEY, "RIGHT");

        response.sendError(eq(HttpServletResponse.SC_FORBIDDEN), contains(SMILEY_PATH));
View Full Code Here

        train_getPath(request, clientURL);

        train_toResourcePath(aliasManager, clientURL, resourcePath);

        train_requiresDigest(cache, new ClasspathResource(resourcePath), true);

        train_getDigest(cache, SMILEY, "RIGHT");

        train_getDateHeader(request, AssetDispatcher.IF_MODIFIED_SINCE_HEADER, -1);
View Full Code Here

        train_getComponentClassName(
                model,
                "org.apache.tapestry.internal.services.SubclassComponent");

        train_getBaseResource(model, new ClasspathResource(
                "org/apache/tapestry/internal/services/SubclassComponent.class"));

        train_getParentModel(model, parent);

        train_getComponentClassName(parent, SIMPLE_COMPONENT_CLASS_NAME);
View Full Code Here

    @Test
    public void asset_client_URL_is_cached()
    {
        ResourceCache cache = newResourceCache();

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

        ClasspathAssetAliasManager aliasManager = newClasspathAssetAliasManager();

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

    public void simple_asset_client_URL()
    {
        ResourceCache cache = newResourceCache();
        ClasspathAssetAliasManager aliasManager = newClasspathAssetAliasManager();

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

        train_requiresDigest(cache, r, false);

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

TOP

Related Classes of org.apache.tapestry.ioc.internal.util.ClasspathResource

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.