Package org.apache.tapestry

Examples of org.apache.tapestry.INamespace


        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        MockControl frameworkc = newControl(INamespace.class);
        INamespace framework = (INamespace) frameworkc.getMock();

        ISpecificationResolverDelegate delegate = newDelegate(cycle, namespace, spec);

        Resource namespaceLocation = newResource("LibraryStandin.library");

        namespace.containsComponentType("DelegateComponent");
        namespacec.setReturnValue(false);

        train(log, logc, ResolverMessages.resolvingComponent("DelegateComponent", namespace));

        namespace.getSpecificationLocation();
        namespacec.setReturnValue(namespaceLocation);

        train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                .getRelativeResource("DelegateComponent.jwc")));

        namespace.isApplicationNamespace();
        namespacec.setReturnValue(false);

        ISpecificationSource source = newSource(framework);

        framework.containsComponentType("DelegateComponent");
        frameworkc.setReturnValue(false);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here


        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        MockControl frameworkc = newControl(INamespace.class);
        INamespace framework = (INamespace) frameworkc.getMock();

        ISpecificationResolverDelegate delegate = newDelegate(cycle, namespace, null);

        Resource namespaceLocation = newResource("LibraryStandin.library");

        namespace.containsComponentType("DelegateComponent");
        namespacec.setReturnValue(false);

        train(log, logc, ResolverMessages.resolvingComponent("DelegateComponent", namespace));

        namespace.getSpecificationLocation();
        namespacec.setReturnValue(namespaceLocation);

        train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                .getRelativeResource("DelegateComponent.jwc")));

        namespace.isApplicationNamespace();
        namespacec.setReturnValue(false);

        ISpecificationSource source = newSource(framework);

        framework.containsComponentType("DelegateComponent");
        frameworkc.setReturnValue(false);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
View Full Code Here

        Log log = (Log) logc.getMock();

        Resource contextRoot = newResource("context/");

        MockControl namespacec = newControl(INamespace.class);
        INamespace namespace = (INamespace) namespacec.getMock();

        Resource namespaceLocation = newResource("LibraryStandin.library");
        Resource specLocation = contextRoot.getRelativeResource("WEB-INF/myapp/MyAppComponent.jwc");

        ISpecificationSource source = newSource(specLocation, spec);

        namespace.containsComponentType("MyAppComponent");
        namespacec.setReturnValue(false);

        train(log, logc, ResolverMessages.resolvingComponent("MyAppComponent", namespace));

        namespace.getSpecificationLocation();
        namespacec.setReturnValue(namespaceLocation);

        train(log, logc, ResolverMessages.checkingResource(namespaceLocation
                .getRelativeResource("MyAppComponent.jwc")));

        namespace.isApplicationNamespace();
        namespacec.setReturnValue(true);

        train(log, logc, ResolverMessages.checkingResource(specLocation));
        train(log, logc, ResolverMessages.installingComponent("MyAppComponent", namespace, spec));

        namespace.installComponentSpecification("MyAppComponent", spec);

        replayControls();

        ComponentSpecificationResolverImpl resolver = new ComponentSpecificationResolverImpl();
        resolver.setLog(log);
View Full Code Here

    public abstract IEngineService getPageService();

    public ILink getLink(IRequestCycle cycle)
    {
        String parameter = null;
        INamespace namespace = getTargetNamespace();
        String targetPage = getTargetPage();

        if (namespace == null)
            parameter = targetPage;
        else
            parameter = namespace.constructQualifiedName(targetPage);

        return getPageService().getLink(cycle, parameter);
    }
View Full Code Here

        return result;
    }

    private Properties getNamespaceProperties(IComponent component, Locale locale)
    {
        INamespace namespace = component.getNamespace();

        Resource namespaceLocation = namespace.getSpecificationLocation();

        Map propertiesMap = findPropertiesMapForResource(namespaceLocation);

        Properties result = (Properties) propertiesMap.get(locale);
View Full Code Here

        return embedded.getSpecification().getAllowBody();
    }

    public boolean getAllowBody(String libraryId, String type, Location location)
    {
        INamespace namespace = _component.getNamespace();

        _resolver.resolve(_cycle, namespace, libraryId, type, location);

        IComponentSpecification spec = _resolver.getSpecification();
View Full Code Here

    }

    private INamespace newNamespace(String id)
    {
        MockControl control = newControl(INamespace.class);
        INamespace ns = (INamespace) control.getMock();

        ns.getId();
        control.setReturnValue(id);

        return ns;
    }
View Full Code Here

        verifyControls();
    }

    public void testNotApplicationNamespace()
    {
        INamespace ns = newNamespace("library");
        IPage page = newPage(ns, null);
        IRequestCycle cycle = newRequestCycle(page, "/");
        IMarkupWriter writer = newWriter("http://foo.com/context/");

        run(writer, cycle);
View Full Code Here

        IComponentSpecification spec = newSpec(location);

        IPage page = newPage(spec, source, locale);

        INamespace namespace = new Namespace(null, null, newLibrarySpec(), null, null);

        page.setNamespace(namespace);

        return source.getMessages(page);
    }
View Full Code Here

    }

    private INamespace newNamespace(String pageName, IComponentSpecification spec)
    {
        MockControl control = newControl(INamespace.class);
        INamespace namespace = (INamespace) control.getMock();

        namespace.containsPage(pageName);
        control.setReturnValue(spec != null);

        if (spec != null)
        {
            namespace.getPageSpecification(pageName);
            control.setReturnValue(spec);
        }

        return namespace;
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.INamespace

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.