Examples of ILibrarySpecification


Examples of org.apache.tapestry.spec.ILibrarySpecification

    }

    private ILibrarySpecification newSpec(boolean exists, IRequestDecoder decoder)
    {
        MockControl control = newControl(ILibrarySpecification.class);
        ILibrarySpecification spec = (ILibrarySpecification) control.getMock();

        spec.checkExtension(Tapestry.REQUEST_DECODER_EXTENSION_NAME);
        control.setReturnValue(exists);

        if (exists)
        {
            spec.getExtension(Tapestry.REQUEST_DECODER_EXTENSION_NAME, IRequestDecoder.class);
            control.setReturnValue(decoder);
        }

        return spec;
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

    public void testNoExtension() throws Exception
    {
        HttpServletRequest request = newRequest();
        HttpServletResponse response = newResponse();
        ILibrarySpecification spec = newSpec(false, null);

        ServletRequestServicer servicer = (ServletRequestServicer) newMock(ServletRequestServicer.class);

        servicer.service(request, response);
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

        HttpServletRequest request = newRequest();
        HttpServletResponse response = newResponse();

        MockControl decoderc = newControl(IRequestDecoder.class);
        IRequestDecoder decoder = (IRequestDecoder) decoderc.getMock();
        ILibrarySpecification spec = newSpec(true, decoder);

        ServicerFixture servicer = new ServicerFixture();

        DecodedRequest decoded = new DecodedRequest();
        decoded.setRequestURI("/foo/bar/baz");
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

     * @since 2.2
     */

    public void testValidLibrary() throws Exception
    {
        ILibrarySpecification spec = parseLib("ValidLibrary.library");

        checkLine(spec, 24);

        checkList("pageNames", new String[]
        { "FirstPage", "SecondPage" }, spec.getPageNames());

        checkList("componentAliases", new String[]
        { "FirstComponent", "SecondComponent" }, spec.getComponentTypes());

        checkList("libraryIds", new String[]
        { "lib1", "lib2" }, spec.getLibraryIds());

        assertNotNull(spec.getSpecificationLocation());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

     * @since 3.0
     */

    public void testConfigureValue() throws Exception
    {
        ILibrarySpecification spec = parseLib("ConfigureValue.library");

        checkLine(spec, 22);
        checkLine(spec.getExtensionSpecification("bedrock"), 24);

        Bedrock bedrock = (Bedrock) spec.getExtension("bedrock", Bedrock.class);

        assertEquals("flintstone", bedrock.getFred());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

    /** @since 4.0 */

    public void testLibraryDescription() throws Exception
    {
        ILibrarySpecification ls = parseLib("LibraryDescription.library");

        assertEquals("Often, these are just placeholders.", ls.getDescription());
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

    }

    /** @since 4.0 */
    public void testMeta() throws Exception
    {
        ILibrarySpecification spec = parseLib("Meta.library");

        assertEquals("bar", spec.getProperty("foo"));
        assertEquals("long value", spec.getProperty("long"));
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

    private ILibrarySpecification newLibrarySpec()
    {
        Resource resource = new ClasspathResource(new DefaultClassResolver(),
                "/org/apache/tapestry/junit/Library.library");

        ILibrarySpecification spec = new LibrarySpecification();
        spec.setSpecificationLocation(resource);

        return spec;
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

        // following little kludge:

        if (location.getResourceURL() == null && path.startsWith("/"))
            location = new ClasspathResource(_resolver, path);

        ILibrarySpecification ls = _specificationSource.getLibrarySpecification(location);

        return new Namespace(id, this, ls, _specificationSource, _resolver);
    }
View Full Code Here

Examples of org.apache.tapestry.spec.ILibrarySpecification

        // We don't record line-precise data about <library> elements
        // so use the location for the specification as a whole (at least
        // identifying
        // the right file)

        ILibrarySpecification ls = _resources.findChildLibrarySpecification(getSpecificationLocation(), path, getLocation());

        return new Namespace(id, this, ls, _resources);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.