Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IComponentSpecification


        ErrorLog log = newLog();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        IComponentSpecification spec = newSpec("foobar", "session");

        page.getSpecification();
        pagec.setReturnValue(spec);

        page.getIdPath();
View Full Code Here


        MockControl componentc = newControl(IComponent.class);
        IComponent component = (IComponent) componentc.getMock();

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        MockControl psc = newControl(IPropertySpecification.class);
        IPropertySpecification ps = (IPropertySpecification) psc.getMock();

        component.getSpecification();
        componentc.setReturnValue(spec);

        spec.getPropertySpecification("zip");
        specc.setReturnValue(ps);

        ps.getPersistence();
        psc.setReturnValue("unknown");
View Full Code Here

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) newMock(PropertyPersistenceStrategySource.class);

        page.getSpecification();
        pagec.setReturnValue(spec);

        spec.getPropertySpecification("foobar");
        specc.setReturnValue(null);

        page.getExtendedId();
        pagec.setReturnValue("TestPage");

        page.getSpecification();
        pagec.setReturnValue(spec);

        spec.getSpecificationLocation();
        specc.setReturnValue(r);

        log.error(
                "A property change event for property foobar of TestPage was observed, "
                        + "but no such property is identified in the specification (" + r + ").",
View Full Code Here

        IContainedComponent cc = new ContainedComponent();
        cc.setPropertyName(propertyName);
        cc.setLocation(location);

        MockControl control = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) control.getMock();

        spec.getComponentIds();
        control.setReturnValue(Collections.singletonList(componentId));

        spec.getComponent(componentId);
        control.setReturnValue(cc);

        return spec;
    }
View Full Code Here

        return spec;
    }

    public void testNoWork()
    {
        IComponentSpecification spec = newSpec("fred", null, null);
        EnhancementOperation op = (EnhancementOperation) newMock(EnhancementOperation.class);

        replayControls();

        new InjectComponentWorker().performEnhancement(op, spec);
View Full Code Here

        verifyControls();
    }

    public void testSuccess()
    {
        IComponentSpecification spec = newSpec("fred", "barney", null);
        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();

        op.getPropertyType("barney");
        control.setReturnValue(IComponent.class);
View Full Code Here

        Throwable ex = new ApplicationRuntimeException(EnhanceMessages.claimedProperty("barney"));

        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();

        IComponentSpecification spec = newSpec("fred", "barney", l);

        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        op.getPropertyType("barney");
        control.setReturnValue(IComponent.class);
View Full Code Here

    {
        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();

        MockControl specc = newControl(IComponentSpecification.class);
        IComponentSpecification spec = (IComponentSpecification) specc.getMock();

        Location l = fabricateLocation(21);

        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        op.findUnclaimedAbstractProperties();
        opc.setReturnValue(Collections.singletonList("fred"));

        Throwable ex = new ApplicationRuntimeException("Arbitrary error.");

        op.getPropertyType("fred");
        opc.setThrowable(ex);

        op.getBaseClass();
        opc.setReturnValue(BaseComponent.class);

        spec.getLocation();
        specc.setReturnValue(l);

        log.error(EnhanceMessages.errorAddingProperty("fred", BaseComponent.class, ex), l, ex);

        replayControls();
View Full Code Here

    /** @since 3.0 * */

    public void testMessageBeanInitializer() throws Exception
    {
        IComponentSpecification spec = parsePage("MessageBeanInitializer.page");

        IBeanSpecification bs = spec.getBeanSpecification("fred");
        checkLine(bs, 24);
        BindingBeanInitializer i = (BindingBeanInitializer) bs.getInitializers().get(0);

        assertEquals("barney", i.getPropertyName());
        assertEquals("message:rubble", i.getBindingReference());
View Full Code Here

     * @since 4.0
     */

    public void testExpressionBeanInitializer() throws Exception
    {
        IComponentSpecification spec = parsePage("ExpressionBeanInitializer_3_0.page");

        IBeanSpecification bs = spec.getBeanSpecification("zebean");

        BindingBeanInitializer i = (BindingBeanInitializer) bs.getInitializers().get(0);

        assertEquals("barney", i.getPropertyName());
        assertEquals("ognl:rubble", i.getBindingReference());
View Full Code Here

TOP

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

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.