Package org.apache.tapestry.asset

Examples of org.apache.tapestry.asset.AssetFactory


        verify();
    }

    public void testAddBodyScript()
    {
        AssetFactory factory = newAssetFactory();
        Location l = newLocation();
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = createWriter();

        replay();
View Full Code Here


        verify();
    }

    public void testGetUniqueString()
    {
        AssetFactory factory = newAssetFactory();
        Location l = newLocation();

        replay();

        PageRenderSupportImpl prs = new PageRenderSupportImpl(factory, "", l, newBuilder(null));
View Full Code Here

        verify();
    }

    public void testGetUniqueStringWithNamespace()
    {
        AssetFactory factory = newAssetFactory();
        Location l = newLocation();

        replay();

        PageRenderSupportImpl prs = new PageRenderSupportImpl(factory, "NAMESPACE", l, newBuilder(null));
View Full Code Here

        verify();
    }
   
    public void testAddInitializationScript()
    {
        AssetFactory factory = newAssetFactory();
        Location l = newLocation();
        IMarkupWriter writer = createWriter();

        replay();
View Full Code Here

        IRequestCycle cycle = newCycle();
       
        IMarkupWriter writer = createWriter();
       
        AssetFactory assetFactory = newMock(AssetFactory.class);
       
        Resource script1 = newResource();
        IAsset asset1 = newAsset("/script1.js");
       
        Resource script2 = newResource();
        IAsset asset2 = newAsset("/script2.js");
       
        expect(assetFactory.createAsset(script1, null)).andReturn(asset1);

        expect(assetFactory.createAsset(script2, null)).andReturn(asset2);

        replay();

        PageRenderSupportImpl prs = new PageRenderSupportImpl(assetFactory, "", null, newBuilder(writer));
View Full Code Here

        IComponentSpecification spec = new ComponentSpecification();
        ClasspathResource base = new ClasspathResource(new DefaultClassResolver(), "/org/apache/tapestry/resolver/MyComponent.jwc");
        spec.setSpecificationLocation(base);
        spec.setComponentClassName("org.apache.tapestry.resolver.MyComponent");

        AssetFactory classpathFactory = newMock(AssetFactory.class);
        AssetFactory contextFactory = newMock(AssetFactory.class);
        Resource contextRoot = newMock(Resource.class);
        Resource webinfLocation = newMock(Resource.class);
        Resource webinfAppLocation = newMock(Resource.class);

        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();
        resolver.setApplicationId("foo");
        resolver.setClasspathAssetFactory(classpathFactory);
        resolver.setContextAssetFactory(contextFactory);
        resolver.setContextRoot(contextRoot);
       
        expect(contextRoot.getRelativeResource("WEB-INF/")).andReturn(webinfLocation);
        expect(webinfLocation.getRelativeResource("foo/")).andReturn(webinfAppLocation);

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
        expect(comp.getNamespace()).andReturn(namespace);
        expect(namespace.getPropertyValue("org.apache.tapestry.component-class-packages")).andReturn("org.apache.tapestry.resolver");

        Location l = newMock(Location.class);
        IAsset asset = newMock(IAsset.class);
        Resource resource = newMock(Resource.class);
       
        expect(contextFactory.assetExists(spec, webinfAppLocation, "MyComponent.html", null)).andReturn(true);
        expect(comp.getLocation()).andReturn(l);
        expect(contextFactory.createAsset(webinfAppLocation, spec, "MyComponent.html", null, l)).andReturn(asset);
        expect(asset.getResourceLocation()).andReturn(resource);

        replay();

        resolver.initializeService();
View Full Code Here

        IComponentSpecification spec = new ComponentSpecification();
        ClasspathResource base = new ClasspathResource(new DefaultClassResolver(), "/org/apache/tapestry/resolver/MyComponent.jwc");
        spec.setSpecificationLocation(base);
        spec.setComponentClassName("org.apache.tapestry.resolver.MyComponent");

        AssetFactory classpathFactory = newMock(AssetFactory.class);
        AssetFactory contextFactory = newMock(AssetFactory.class);
        Resource contextRoot = newMock(Resource.class);
        Resource webinfLocation = newMock(Resource.class);
        Resource webinfAppLocation = newMock(Resource.class);

        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();
        resolver.setApplicationId("foo");
        resolver.setClasspathAssetFactory(classpathFactory);
        resolver.setContextAssetFactory(contextFactory);
        resolver.setContextRoot(contextRoot);

        expect(contextRoot.getRelativeResource("WEB-INF/")).andReturn(webinfLocation);
        expect(webinfLocation.getRelativeResource("foo/")).andReturn(webinfAppLocation);

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
        expect(comp.getNamespace()).andReturn(namespace);
        expect(namespace.getPropertyValue("org.apache.tapestry.component-class-packages")).andReturn("org.apache.tapestry.resolver");

        Location l = newMock(Location.class);
        IAsset asset = newMock(IAsset.class);
        Resource resource = newMock(Resource.class);

        expect(contextFactory.assetExists(spec, webinfAppLocation, "MyComponent.html", null)).andReturn(false);
        expect(contextFactory.assetExists(spec, webinfLocation, "MyComponent.html", null)).andReturn(true);
        expect(comp.getLocation()).andReturn(l);
        expect(contextFactory.createAsset(webinfLocation, spec, "MyComponent.html", null, l)).andReturn(asset);
        expect(asset.getResourceLocation()).andReturn(resource);

        replay();

        resolver.initializeService();
View Full Code Here

        IComponentSpecification spec = new ComponentSpecification();
        ClasspathResource base = new ClasspathResource(new DefaultClassResolver(), "/org/apache/tapestry/resolver/MyComponent.jwc");
        spec.setSpecificationLocation(base);
        spec.setComponentClassName("org.apache.tapestry.resolver.MyComponent");

        AssetFactory classpathFactory = newMock(AssetFactory.class);
        AssetFactory contextFactory = newMock(AssetFactory.class);
        Resource contextRoot = newMock(Resource.class);
        Resource webinfLocation = newMock(Resource.class);
        Resource webinfAppLocation = newMock(Resource.class);

        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();
        resolver.setApplicationId("foo");
        resolver.setClasspathAssetFactory(classpathFactory);
        resolver.setContextAssetFactory(contextFactory);
        resolver.setContextRoot(contextRoot);

        expect(contextRoot.getRelativeResource("WEB-INF/")).andReturn(webinfLocation);
        expect(webinfLocation.getRelativeResource("foo/")).andReturn(webinfAppLocation);

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
        expect(comp.getNamespace()).andReturn(namespace);
        expect(namespace.getPropertyValue("org.apache.tapestry.component-class-packages")).andReturn("org.apache.tapestry.resolver");

        Location l = newMock(Location.class);
        IAsset asset = newMock(IAsset.class);
        Resource resource = newMock(Resource.class);

        expect(contextFactory.assetExists(spec, webinfAppLocation, "MyComponent.html", null)).andReturn(false);
        expect(contextFactory.assetExists(spec, webinfLocation, "MyComponent.html", null)).andReturn(false);
        expect(classpathFactory.assetExists(spec, base, "MyComponent.html", null)).andReturn(false);

        expect(contextFactory.assetExists(spec, webinfAppLocation, "resolver/MyComponent.html", null)).andReturn(false);
        expect(contextFactory.assetExists(spec, webinfLocation, "resolver/MyComponent.html", null)).andReturn(true);

        expect(comp.getLocation()).andReturn(l);
        expect(contextFactory.createAsset(webinfLocation, spec, "resolver/MyComponent.html", null, l)).andReturn(asset);
        expect(asset.getResourceLocation()).andReturn(resource);

        replay();

        resolver.initializeService();
View Full Code Here

        IComponentSpecification spec = new ComponentSpecification();
        ClasspathResource base = new ClasspathResource(new DefaultClassResolver(), "/org/apache/tapestry/resolver/MyComponent.jwc");
        spec.setSpecificationLocation(base);
        spec.setComponentClassName("org.apache.tapestry.resolver.MyComponent");

        AssetFactory classpathFactory = newMock(AssetFactory.class);
        AssetFactory contextFactory = newMock(AssetFactory.class);
        Resource contextRoot = newMock(Resource.class);
        Resource webinfLocation = newMock(Resource.class);
        Resource webinfAppLocation = newMock(Resource.class);

        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();
        resolver.setApplicationId("foo");
        resolver.setClasspathAssetFactory(classpathFactory);
        resolver.setContextAssetFactory(contextFactory);
        resolver.setContextRoot(contextRoot);

        expect(contextRoot.getRelativeResource("WEB-INF/")).andReturn(webinfLocation);
        expect(webinfLocation.getRelativeResource("foo/")).andReturn(webinfAppLocation);

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
        expect(comp.getNamespace()).andReturn(namespace);
        expect(namespace.getPropertyValue("org.apache.tapestry.component-class-packages")).andReturn("org.apache.tapestry.resolver");

        Location l = newMock(Location.class);
        IAsset asset = newMock(IAsset.class);
        Resource resource = newMock(Resource.class);

        expect(contextFactory.assetExists(spec, webinfAppLocation, "MyComponent.html", null)).andReturn(false);
        expect(contextFactory.assetExists(spec, webinfLocation, "MyComponent.html", null)).andReturn(false);
        expect(classpathFactory.assetExists(spec, base, "MyComponent.html", null)).andReturn(true);

        expect(comp.getLocation()).andReturn(l);
        expect(classpathFactory.createAsset(base, spec, "MyComponent.html", null, l)).andReturn(asset);
        expect(asset.getResourceLocation()).andReturn(resource);
View Full Code Here

        nested.flush();

        MarkupWriterSource source = newSource(pw, ct, writer);
        IPage page = newPage(ct);
        AssetFactory assetFactory = newAssetFactory();
       
        IRequestCycle cycle = newCycle("ZePage", page);
       
        writer.comment("BEGIN Tapestry Portlet appId NAMESPACE");
        writer.comment("Page: ZePage");
View Full Code Here

TOP

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