Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IContainedComponent


    public void testComponentProperty() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentProperty.jwc");

        IContainedComponent cc = cs.getComponent("body");

        assertEquals("my-value", cc.getProperty("my-property"));
    }
View Full Code Here


    public void testComponentInjectProperty() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentInjectProperty.jwc");

        IContainedComponent cc = cs.getComponent("body");

        assertEquals("myProperty", cc.getPropertyName());

        cc = cs.getComponent("fred");

        assertNull(cc.getPropertyName());
    }
View Full Code Here

    public void testComponentCopyOf() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentCopyOf.jwc");

        IContainedComponent source = cs.getComponent("source");
        IContainedComponent copy = cs.getComponent("copy");
        IContainedComponent override = cs.getComponent("override");

        assertEquals("Insert", source.getType());
        assertEquals("Insert", copy.getType());
        assertEquals("Insert", override.getType());

        IBindingSpecification b = source.getBinding("value");

        assertEquals(BindingType.PREFIXED, b.getType());
        assertEquals("ognl:date", b.getValue());

        assertSame(b, copy.getBinding("value"));

        IBindingSpecification b2 = override.getBinding("value");
        assertEquals("ognl:tomorrow", b2.getValue());

        b = copy.getBinding("foo");

        assertSame(b, override.getBinding("foo"));

        b = copy.getBinding("formatter");

        assertSame(b, override.getBinding("formatter"));
    }
View Full Code Here

                String id = (String) ids.get(i);

                // Get the sub-component specification from the
                // container's specification.

                IContainedComponent contained = containerSpec.getComponent(id);

                String type = contained.getType();
                Location location = contained.getLocation();

                _componentResolver.resolve(cycle, namespace, type, location);

                IComponentSpecification componentSpecification = _componentResolver
                        .getSpecification();
View Full Code Here

        _componentResolver.resolve(cycle, container.getNamespace(), componentType, location);

        INamespace componentNamespace = _componentResolver.getNamespace();
        IComponentSpecification spec = _componentResolver.getSpecification();

        IContainedComponent contained = new ContainedComponent();
        contained.setLocation(location);
        contained.setType(componentType);

        IComponent result = instantiateComponent(
                page,
                container,
                componentId,
View Full Code Here

     */

    public void testBinding40() throws Exception
    {
        IComponentSpecification spec = parseComponent("Binding40.jwc");
        IContainedComponent cc = spec.getComponent("component");

        IBindingSpecification bs = cc.getBinding("simple");

        assertEquals(BindingType.PREFIXED, bs.getType());
        assertEquals("message:some-key", bs.getValue());

        bs = cc.getBinding("enclosed");

        assertEquals(BindingType.PREFIXED, bs.getType());
        assertEquals("ognl:zip.zap.zoop", bs.getValue());
    }
View Full Code Here

    {
        IComponentSpecification spec = parsePage("StaticBindingValue.page");

        checkLine(spec, 22);

        IContainedComponent c = spec.getComponent("c");

        checkLine(c, 24);

        IBindingSpecification b = c.getBinding("fred");
        checkLine(b, 25);

        assertEquals("literal:flintstone", b.getValue());

        b = c.getBinding("barney");
        checkLine(b, 26);

        assertEquals("literal:rubble", b.getValue());

        b = c.getBinding("rock");
        checkLine(b, 27);
        assertEquals("literal:hudson", b.getValue());
    }
View Full Code Here

    public void testListenerBinding() throws Exception
    {
        IComponentSpecification spec = parsePage("ListenerBinding.page");

        checkLine(spec, 22);
        IContainedComponent c = spec.getComponent("c");

        checkLine(c, 24);

        IListenerBindingSpecification lbs = (ListenerBindingSpecification) c.getBinding("listener");

        checkLine(lbs, 25);

        String expectedScript = buildExpectedScript(new String[]
        { "if page.isFormInputValid():", "  cycle.page = \"Results\"", "else:",
View Full Code Here

    public void testInheritInformalParameters() throws Exception
    {
        IComponentSpecification spec = parseComponent("TestInheritInformal.jwc");

        IContainedComponent border = spec.getComponent("border");
        assertEquals(border.getInheritInformalParameters(), false);

        IContainedComponent textField = spec.getComponent("textField");
        assertEquals(textField.getInheritInformalParameters(), true);
    }
View Full Code Here

    public void testComponentProperty() throws Exception
    {
        IComponentSpecification cs = parseComponent("ComponentProperty.jwc");

        IContainedComponent cc = cs.getComponent("body");

        assertEquals("my-value", cc.getProperty("my-property"));
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.IContainedComponent

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.