Package org.apache.tapestry.enhance

Examples of org.apache.tapestry.enhance.EnhancementOperation


    }

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

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

        op.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(method),
                "return getMessages().getMessage(\"like-getter\");");
        op.claimProperty("likeGetter");

        replayControls();

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


        verifyControls();
    }

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

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

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

        replayControls();

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

        assertNotNull(worker._delegate);
    }

    public void testDelegation()
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();

        InjectAssetWorker delegate = (InjectAssetWorker) newMock(InjectAssetWorker.class);

        Method m = findMethod(AnnotatedPage.class, "getStylesheetAsset");
View Full Code Here

        assertNotNull(worker._delegate);
    }

    public void testDelegation()
    {
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();

        InjectComponentWorker delegate = (InjectComponentWorker) newMock(InjectComponentWorker.class);

        delegate.injectComponent(op, "fred", "fredField");
View Full Code Here

public class TestAnnotationEnhancementWorker extends BaseAnnotationTestCase
{
    protected EnhancementOperation newOp(Class baseClass)
    {
        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();

        op.getBaseClass();
        control.setReturnValue(baseClass);

        return op;
    }
View Full Code Here

    /**
     * No method annotations registered.
     */
    public void testNoAnnotations()
    {
        EnhancementOperation op = newOp(AnnotatedPage.class);
        IComponentSpecification spec = newSpec();

        replayControls();

        AnnotationEnhancementWorker worker = new AnnotationEnhancementWorker();
View Full Code Here

        verifyControls();
    }

    public void testAnnotationMatch()
    {
        EnhancementOperation op = newOp(AnnotatedPage.class);
        IComponentSpecification spec = newSpec();

        MethodAnnotationEnhancementWorker methodWorker = (MethodAnnotationEnhancementWorker) newMock(MethodAnnotationEnhancementWorker.class);

        Method m = findMethod(AnnotatedPage.class, "getInjectedObject");
View Full Code Here

        verifyControls();
    }

    public void testAnnotationWithSubclass()
    {
        EnhancementOperation op = newOp(AnnotatedPageSubclass.class);
        IComponentSpecification spec = newSpec();

        MethodAnnotationEnhancementWorker methodWorker = (MethodAnnotationEnhancementWorker) newMock(MethodAnnotationEnhancementWorker.class);

        Method m = findMethod(AnnotatedPageSubclass.class, "getInjectedObject");
View Full Code Here

    public void testAnnotationFailure()
    {
        ErrorLog log = newLog();
        Throwable t = new RuntimeException("Woops!");

        EnhancementOperation op = newOp(AnnotatedPage.class);
        IComponentSpecification spec = newSpec();

        MockControl methodWorkerc = newControl(MethodAnnotationEnhancementWorker.class);
        MethodAnnotationEnhancementWorker methodWorker = (MethodAnnotationEnhancementWorker) methodWorkerc
                .getMock();
View Full Code Here

        return (ErrorLog) newMock(ErrorLog.class);
    }

    public void testClassAnnotation()
    {
        EnhancementOperation op = newOp(DeprecatedBean.class);
        IComponentSpecification spec = newSpec();

        ClassAnnotationEnhancementWorker classWorker = (ClassAnnotationEnhancementWorker) newMock(ClassAnnotationEnhancementWorker.class);

        classWorker.performEnhancement(op, spec, DeprecatedBean.class);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.enhance.EnhancementOperation

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.