Examples of EnhancementOperation


Examples of org.apache.tapestry.enhance.EnhancementOperation

    }

    public void testSetterIsClaimed()
    {
        Location l = newLocation();
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();

        Method method = findMethod(AnnotatedPage.class, "getLikeGetter");

        op.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(method),
                "{\n  return getMessages().getMessage(\"like-getter\");\n}\n",
                l);
        op.claimReadonlyProperty("likeGetter");

        replay();

        new MessageAnnotationWorker().performEnhancement(op, spec, method, l);
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

    }

    private void attempt(String methodName, String codeBlock)
    {
        Location l = newLocation();
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();

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

        op.addMethod(Modifier.PUBLIC, new MethodSignature(method), codeBlock, l);

        replay();

        new MessageAnnotationWorker().performEnhancement(op, spec, method, l);
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

            Location location)
    {
        Method m = findMethod(AnnotatedComponent.class, "get"
                + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1));
       
        EnhancementOperation op = newMock(EnhancementOperation.class);
       
        expect(op.getPropertyType(propertyName)).andReturn(m.getReturnType());
       
        IComponentSpecification spec = new ComponentSpecification();

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

   
    public void testParameterNotAllowed()
    {
        Method m = findMethod(AnnotatedPage.class, "getSimpleParameter");
       
        EnhancementOperation op = newMock(EnhancementOperation.class);
               
        IComponentSpecification spec = new ComponentSpecification();

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

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

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

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

        assertNull(bs.getInitializers());
    }

    private EnhancementOperation newOp(String propertyName, Class propertyType)
    {
        EnhancementOperation op = newMock(EnhancementOperation.class);
       
        expect(op.getPropertyType(propertyName)).andReturn(propertyType);

        return op;
    }
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

    }

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

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

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

        assertNull(bs.getInitializers());
    }

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

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

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

        assertEquals("intValue=10", lbi.getPropertyName());
    }

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

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

        replay();
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperation

@Test
public class AnnotationEnhancementWorkerTest extends BaseAnnotationTestCase
{
    protected EnhancementOperation newOp(Class baseClass)
    {
        EnhancementOperation op = newMock(EnhancementOperation.class);

        expect(op.getBaseClass()).andReturn(baseClass);

        return op;
    }
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.