Package org.apache.tapestry.annotations

Examples of org.apache.tapestry.annotations.OnEvent


    @Test
    public void method_with_non_void_return_value()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "java.lang.String",
                "foo", null, null);

        train_findMethods(ct, signature);
View Full Code Here


    @Test
    public void method_with_non_primitive_parameter()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String" }, null);
View Full Code Here

    @Test
    public void method_with_primitive_parameter()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "boolean" }, null);
View Full Code Here

    @Test
    public void method_with_multiple_parameters()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String", "java.lang.Integer" }, null);
View Full Code Here

    @Test
    public void method_include_context()
    {
        ClassTransformation ct = newClassTransformation();
        MutableComponentModel model = newMutableComponentModel();
        OnEvent annotation = newOnEvent();

        MethodSignature signature = new MethodSignature(Modifier.PRIVATE, "void", "foo",
                new String[]
                { "java.lang.String", OnEventWorker.OBJECT_ARRAY_TYPE, "java.lang.Integer" }, null);
View Full Code Here

            builder.begin();

            closeCount++;
        }

        OnEvent annotation = transformation.getMethodAnnotation(method, OnEvent.class);

        String[] eventTypes = extractEventTypes(method, annotation);

        if (eventTypes.length > 0)
        {
View Full Code Here

        replay();

        ClassTransformation ct = createClassTransformation(EventHandlerTarget.class, logger);

        OnEvent annotation = ct.getMethodAnnotation(new TransformMethodSignature("handler"), OnEvent.class);

        // Check that the attributes of the annotation match the expectation.

        assertEquals(annotation.value(), "fred");
        assertEquals(annotation.component(), "alpha");

        verify();
    }
View Full Code Here

    {
        // $1 is the event

        int parameterCount = getParameterCount(method);

        OnEvent annotation = transformation.getMethodAnnotation(method, OnEvent.class);

        String eventType = extractEventType(method, annotation);

        String componentId = extractComponentId(method, annotation);
View Full Code Here

        replay();

        ClassTransformation ct = createClassTransformation(EventHandlerTarget.class, log);

        OnEvent annotation = ct.getMethodAnnotation(new MethodSignature("handler"), OnEvent.class);

        // Check that the attributes of the annotation match the expectation.

        assertEquals(annotation.value(), new String[]
        { "fred", "barney" });
        assertEquals(annotation.component(), new String[]
        { "alpha", "beta" });

        verify();
    }
View Full Code Here

            builder.begin();

            closeCount++;
        }

        OnEvent annotation = transformation.getMethodAnnotation(method, OnEvent.class);

        String eventType = extractEventType(method, annotation);

        if (InternalUtils.isNonBlank(eventType))
        {
View Full Code Here

TOP

Related Classes of org.apache.tapestry.annotations.OnEvent

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.