Package org.apache.tapestry.runtime

Examples of org.apache.tapestry.runtime.ComponentEvent


    public void component_id_matches_are_case_insensitive()
    {
        ComponentEventHandler handler = mockComponentEventHandler();

        replay();
        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, _coercer, null);

        assertTrue(event.matches("eventtype", "SOMEID", 0));

        verify();
    }
View Full Code Here


    {
        ComponentEventHandler handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", new String[]{"27"}, handler, _coercer,
                                                      null);

        assertEquals(event.coerceContext(0, "java.lang.Integer"), new Integer(27));

        verify();
    }
View Full Code Here

        ComponentEventHandler handler = mockComponentEventHandler();
        Component component = mockComponent();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", new String[]{"27"}, handler, _coercer,
                                                      null);

        event.setSource(component, "foo.Bar.baz()");

        try
        {
            event.coerceContext(1, "java.lang.Integer");
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
                         "Method foo.Bar.baz() has more parameters than there are context values for this component event.");
View Full Code Here

        ComponentEventHandler handler = mockComponentEventHandler();
        Component component = mockComponent();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", new String[]{"abc"}, handler, _coercer,
                                                      null);

        event.setSource(component, "foo.Bar.baz()");

        try
        {
            event.coerceContext(0, "java.lang.Integer");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            // Different JVMs will report the conversion error slightly differently,
View Full Code Here

        train_handleResult(handler, result, component, methodDescription, true);

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, _coercer, null);

        event.setSource(component, methodDescription);

        assertFalse(event.isAborted());

        assertTrue(event.storeResult(result));

        assertTrue(event.isAborted());

        verify();
    }
View Full Code Here

        train_handleResult(handler, result, component, methodDescription, false);

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, _coercer, null);

        event.setSource(component, methodDescription);

        assertFalse(event.storeResult(result));

        assertFalse(event.isAborted());

        verify();
    }
View Full Code Here

        Component component = mockComponent();
        ComponentEventHandler handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, _coercer, null);

        event.setSource(component, "foo.Bar.baz()");

        assertFalse(event.storeResult(null));

        assertFalse(event.isAborted());

        verify();
    }
View Full Code Here

        expect(handler.handleResult(result, component, "foo.Bar.baz()")).andReturn(true);

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, _coercer, null);

        event.setSource(component, "foo.Bar.baz()");
        event.storeResult(result);

        try
        {
            event.setSource(component, "foo.Bar.biff()");
            event.storeResult(null);
            unreachable();
        }
        catch (IllegalStateException ex)
        {
            assertEquals(ex.getMessage(), ServicesMessages
View Full Code Here

    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);

        assertTrue(event.matches("eventType", "someId", 0));
        assertFalse(event.matches("foo", "someId", 0));

        verify();
    }
View Full Code Here

    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);

        assertTrue(event.matches("EVENTTYPE", "someid", 0));

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.runtime.ComponentEvent

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.