Package org.apache.tapestry

Examples of org.apache.tapestry.Asset


    @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();
        TypeCoercer typeCoercer = mockTypeCoercer();
        Path pathAnnotation = mockPath();
        SymbolSource symbolSource = mockSymbolSource();

        train_getAnnotation(annotationProvider, Path.class, pathAnnotation);
        train_value(pathAnnotation, path);
        train_expandSymbols(symbolSource, path, expanded);
        train_findAsset(source, null, expanded, null, asset);
        train_coerce(typeCoercer, asset, Asset.class, asset);

        replay();

        ObjectProvider provider = new AssetObjectProvider(source, typeCoercer, symbolSource);

        Asset result = provider.provide(Asset.class, annotationProvider, locator);

        assertSame(result, asset);

        verify();
    }
View Full Code Here


    @Test
    public void add_script_link_by_asset()
    {
        DocumentScriptBuilder builder = mockDocumentScriptBuilder();
        Asset asset = mockAsset();

        train_toClientURL(asset, ASSET_URL);
        builder.addScriptLink(ASSET_URL);

        replay();
View Full Code Here

    {
        String path = "${root}/foo/bar.pdf";
        String expanded = "org/apache/tapestry/foo/bar.pdf";

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

        train_expandSymbols(source, path, expanded);
View Full Code Here

    @Test
    public void no_head_element()
    {
        Document d = new Document();
        Environment env = mockEnvironment();
        Asset asset = mockAsset();

        d.newRootElement("foo");
        String initial = d.toString();

        train_peek(env, Document.class, d);
View Full Code Here

    @Test
    public void head_element_found()
    {
        Document d = new Document();
        Environment env = mockEnvironment();
        Asset asset = mockAsset();

        d.newRootElement("html").element("head");

        train_peek(env, Document.class, d);
View Full Code Here

    @Test
    public void add_script_link_by_asset()
    {
        DocumentHeadBuilder builder = mockDocumentScriptBuilder();
        Asset asset = mockAsset();

        train_toClientURL(asset, ASSET_URL);
        builder.addScriptLink(ASSET_URL);

        replay();
View Full Code Here

    @Test
    public void core_assets_added()
    {
        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 path = "${root}/foo/bar.pdf";
        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);
View Full Code Here

    @Test
    public void add_stylesheet_link()
    {
        String media = "print";
        DocumentHeadBuilder builder = mockDocumentScriptBuilder();
        Asset asset = mockAsset();

        train_toClientURL(asset, ASSET_URL);
        builder.addStylesheetLink(ASSET_URL, media);

        replay();
View Full Code Here

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

        Resource expectedResource = _baseResource.forFile("SimpleComponent_en_GB.properties");

        train_getRootResource(factory, _rootResource);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.Asset

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.