Package org.apache.tapestry

Examples of org.apache.tapestry.ComponentEventHandler


    public void store_result_and_continue()
    {
        Object result = new Object();
        String methodDescription = "foo.Bar.baz()";
        Component component = mockComponent();
        ComponentEventHandler handler = mockComponentEventHandler();

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

        replay();
View Full Code Here


    @Test
    public void store_null_result_does_not_abort_or_invoke_handler()
    {
        Component component = mockComponent();
        ComponentEventHandler handler = mockComponentEventHandler();

        replay();

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

    @SuppressWarnings("unchecked")
    @Test
    public void store_result_when_aborted_is_failure()
    {
        Object result = new Object();
        ComponentEventHandler handler = mockComponentEventHandler();
        Component component = mockComponent();

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

        replay();

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

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

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

                return true;
            }
        };
View Full Code Here

        try
        {
            final Holder<ActionResponseGenerator> holder = Holder.create();

            ComponentEventHandler handler = new ComponentEventHandler()
            {
                public boolean handleResult(Object result, Component component,
                        String methodDescription)
                {
                    if (result instanceof Boolean) return ((Boolean) result);
View Full Code Here

        try
        {
            final Holder<ActionResponseGenerator> holder = Holder.create();

            ComponentEventHandler handler = new ComponentEventHandler()
            {
                public boolean handleResult(Object result, Component component,
                        String methodDescription)
                {
                    if (result instanceof Boolean)
View Full Code Here

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

        ComponentEventHandler handler = new ComponentEventHandler()
        {
            @SuppressWarnings("unchecked")
            public boolean handleResult(Object result, Component component, String methodDescription)
            {
                PassivateContextHandler contextHandler = _registry.getByInstance(result);
View Full Code Here

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

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

                return true;
            }
        };
View Full Code Here

    }

    @Test
    public void matches_on_event_type()
    {
        ComponentEventHandler handler = newComponentEventHandler();

        replay();

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

    }

    @Test
    public void event_type_match_is_case_insensitive()
    {
        ComponentEventHandler handler = newComponentEventHandler();

        replay();

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

TOP

Related Classes of org.apache.tapestry.ComponentEventHandler

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.