Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.ComponentSpecification


        EnhancementOperation op = newOp();

        replayControls();

        IComponentSpecification spec = new ComponentSpecification();

        new ComponentAnnotationWorker().performEnhancement(op, spec, method);

        verifyControls();

        return spec.getComponent(id);
    }
View Full Code Here


    private IComponentSpecification execute(MethodAnnotationEnhancementWorker worker,
            String methodName)
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = new ComponentSpecification();

        Method method = findMethod(AnnotatedPage.class, methodName);

        replayControls();
View Full Code Here

public class TestAssetAnnotationWorker extends BaseAnnotationTestCase
{
    public void testSuccess()
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = new ComponentSpecification();

        replayControls();

        Method m = findMethod(AnnotatedPage.class, "getGlobalStylesheet");

        new AssetAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

        IAssetSpecification as = spec.getAsset("globalStylesheet");
        assertEquals("/style/global.css", as.getPath());
        assertNull(as.getLocation());
        assertEquals("globalStylesheet", as.getPropertyName());
    }
View Full Code Here

        EnhancementOperation op = (EnhancementOperation) opc.getMock();

        op.getPropertyType(propertyName);
        opc.setReturnValue(m.getReturnType());

        IComponentSpecification spec = new ComponentSpecification();

        replayControls();

        new ParameterAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

        return spec.getParameter(parameterName);
    }
View Full Code Here

public class TestBeanAnnotationWorker extends BaseAnnotationTestCase
{
    public void testBeanClassSpecified()
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = new ComponentSpecification();

        Method m = findMethod(AnnotatedPage.class, "getMapBean");

        replayControls();

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

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

        assertEquals("mapBean", bs.getPropertyName());
        assertEquals(HashMap.class.getName(), bs.getClassName());
        assertEquals(BeanLifecycle.REQUEST, bs.getLifecycle());
        assertNull(bs.getLocation());
View Full Code Here

    }

    public void testBeanClassNotSpecified()
    {
        EnhancementOperation op = newOp("hashMapBean", HashMap.class);
        IComponentSpecification spec = new ComponentSpecification();

        Method m = findMethod(AnnotatedPage.class, "getHashMapBean");

        replayControls();

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

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

        assertEquals("hashMapBean", bs.getPropertyName());
        assertEquals(HashMap.class.getName(), bs.getClassName());
        assertEquals(BeanLifecycle.REQUEST, bs.getLifecycle());
        assertNull(bs.getLocation());
View Full Code Here

    }

    public void testInitializer()
    {
        EnhancementOperation op = newOp("beanWithInitializer", Target.class);
        IComponentSpecification spec = new ComponentSpecification();

        Method m = findMethod(AnnotatedPage.class, "getBeanWithInitializer");

        replayControls();

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

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

        List l = bs.getInitializers();
        LightweightBeanInitializer lbi = (LightweightBeanInitializer) l.get(0);

        assertEquals("intValue=10", lbi.getPropertyName());
View Full Code Here

    }

    public void testLifecycle()
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = new ComponentSpecification();

        Method m = findMethod(AnnotatedPage.class, "getRenderLifecycleBean");

        replayControls();

        new BeanAnnotationWorker().performEnhancement(op, spec, m);

        verifyControls();

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

        assertEquals(BeanLifecycle.RENDER, bs.getLifecycle());
    }
View Full Code Here

    }

    private IComponentSpecification attempt(Class baseClass)
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = new ComponentSpecification();

        replayControls();

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

    private IComponentSpecification newSpec(String path)
    {
        Resource resource = new ClasspathResource(new DefaultClassResolver(), path);

        IComponentSpecification spec = new ComponentSpecification();
        spec.setSpecificationLocation(resource);

        return spec;
    }
View Full Code Here

TOP

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

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.