Package org.apache.tapestry

Examples of org.apache.tapestry.INamespace


    }

    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


        IRequestCycle cycle = newCycle();
        Location l = fabricateLocation(13);
        IComponentSpecification spec = newSpecification();

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

        namespace.containsComponentType("MyComponent");
        control.setReturnValue(true);

        namespace.getComponentSpecification("MyComponent");
        control.setReturnValue(spec);

        replayControls();

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

        IRequestCycle cycle = newCycle();
        Location l = fabricateLocation(13);
        IComponentSpecification spec = newSpecification();

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

        MockControl libraryc = newControl(INamespace.class);
        INamespace library = (INamespace) libraryc.getMock();

        namespace.getChildNamespace("lib");
        namespacec.setReturnValue(library);

        library.containsComponentType("MyComponent");
        libraryc.setReturnValue(true);

        library.getComponentSpecification("MyComponent");
        libraryc.setReturnValue(spec);

        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();

        Resource namespaceLocation = newResource("LibraryStandin.library");
        Resource specLocation = namespaceLocation.getRelativeResource("MyComponent.jwc");

        ISpecificationSource source = newSource(specLocation, spec);

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

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

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

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

        namespace.installComponentSpecification("MyComponent", spec);

        replayControls();

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

    }

    private INamespace newNamespace(String prefixes)
    {
        MockControl control = newControl(INamespace.class);
        INamespace namespace = (INamespace) control.getMock();

        namespace.getPropertyValue(NamespaceClassSearchPageClassProvider.PACKAGES_NAME);
        control.setReturnValue(prefixes);

        return namespace;
    }
View Full Code Here

        return namespace;
    }

    public void testDefaultSearchList()
    {
        INamespace namespace = newNamespace(null);

        replayControls();

        List prefixes = new NamespaceClassSearchPageClassProvider()
                .buildPackageSearchList(namespace);
View Full Code Here

        verifyControls();
    }

    public void testSearchListWithPrefixes()
    {
        INamespace namespace = newNamespace("org.foo,org.bar.baz");

        replayControls();

        List prefixes = new NamespaceClassSearchPageClassProvider()
                .buildPackageSearchList(namespace);
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();

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

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

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

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

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

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

        ISpecificationSource source = newSource(framework);

        framework.containsComponentType("FrameworkComponent");
        frameworkc.setReturnValue(true);

        framework.getComponentSpecification("FrameworkComponent");
        frameworkc.setReturnValue(spec);

        train(log, logc, ResolverMessages
                .installingComponent("FrameworkComponent", namespace, spec));
        namespace.installComponentSpecification("FrameworkComponent", spec);
View Full Code Here

        verifyControls();
    }

    public void testFound()
    {
        INamespace namespace = newNamespace("org.foo");

        MockControl crc = newControl(ClassResolver.class);
        ClassResolver cr = (ClassResolver) crc.getMock();

        IComponentSpecification spec = newSpec();
View Full Code Here

        verifyControls();
    }

    public void testNotFound()
    {
        INamespace namespace = newNamespace("org.foo");

        MockControl crc = newControl(ClassResolver.class);
        ClassResolver cr = (ClassResolver) crc.getMock();

        IComponentSpecification spec = newSpec();
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.