Package org.apache.tapestry

Examples of org.apache.tapestry.ComponentEventCallback


    }

    @Test
    public void store_null_result_does_not_abort_or_invoke_handler()
    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void store_result_when_aborted_is_failure()
    {
        Object result = new Object();
        ComponentEventCallback handler = mockComponentEventHandler();

        expect(handler.handleResult(result)).andReturn(true);

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);
View Full Code Here

     */
    private String[] collectActivationContextForPage(final Page page)
    {
        final List context = newList();

        ComponentEventCallback callback = new ComponentEventCallback()
        {
            @SuppressWarnings("unchecked")
            public boolean handleResult(Object result)
            {
                PassivateContextHandler contextHandler = _registry.getByInstance(result);
View Full Code Here

        return new IAnswer<Boolean>()
        {
            @SuppressWarnings("unchecked")
            public Boolean answer() throws Throwable
            {
                ComponentEventCallback handler = (ComponentEventCallback) EasyMock
                        .getCurrentArguments()[2];

                handler.handleResult(new Object[]{"foo", "bar"});

                return true;
            }
        };
    }
View Full Code Here

    }

    @Test
    public void matches_on_event_type()
    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);
View Full Code Here

    }

    @Test
    public void event_type_match_is_case_insensitive()
    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);
View Full Code Here

    }

    @Test
    public void matches_on_component_id()
    {
        ComponentEventCallback handler = mockComponentEventHandler();

        replay();

        ComponentEvent event = new ComponentEventImpl("eventType", "someId", null, handler, null);
View Full Code Here

    }

    @Test
    public void component_id_matches_are_case_insensitive()
    {
        ComponentEventCallback handler = mockComponentEventHandler();

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

        assertTrue(event.matches("eventtype", "SOMEID", 0));
View Full Code Here

    }

    @Test
    public void coerce_context()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        PageResources resources = mockPageResources();

        train_toClass(resources, "java.lang.Integer", Integer.class);
        train_coerce(resources, "27", Integer.class, new Integer(27));
View Full Code Here

    }

    @Test
    public void coerce_when_not_enough_context()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        Component component = mockComponent();

        replay();

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

TOP

Related Classes of org.apache.tapestry.ComponentEventCallback

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.