Examples of EventContext


Examples of org.apache.tapestry5.EventContext

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

        train_getCount(context, 0);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.EventContext

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

        train_getCount(context, 0);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    @Test
    public void coerce_context()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        PageResources resources = mockPageResources();
        EventContext context = mockEventContext();
        Integer value = new Integer(27);

        train_toClass(resources, "java.lang.Integer", Integer.class);

        train_getCount(context, 2);
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    @Test
    public void coerce_when_not_enough_context()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        EventContext context = mockEventContext();
        Logger logger = mockLogger();

        train_isDebugEnabled(logger, false);

        train_getCount(context, 0);
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    @Test
    public void unable_to_coerce()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        EventContext context = mockEventContext();
        PageResources resources = mockPageResources();
        Logger logger = mockLogger();

        train_isDebugEnabled(logger, false);

        train_toClass(resources, Integer.class.getName(), Integer.class);

        train_getCount(context, 1);

        expect(context.get(Integer.class, 0)).andThrow(new NumberFormatException("Not so easy, is it?"));

        replay();

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

Examples of org.apache.tapestry5.EventContext

        if (nestedComponentId == null && eventType == null) return false;

        if (!componentClassResolver.isPageName(activePageName)) return false;

        EventContext eventContext = decodeContext(matcher.group(CONTEXT));

        EventContext activationContext = decodeContext(request.getParameter(InternalConstants.PAGE_CONTEXT_NAME));

        // The event type is often omitted, and defaults to "action".

        if (eventType == null) eventType = EventConstants.ACTION;
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        {
            public Boolean answer() throws Throwable
            {
                Object[] arguments = EasyMock.getCurrentArguments();

                EventContext ec = (EventContext) arguments[1];

                assertEquals(ec.getCount(), context.length);

                for (int i = 0; i < context.length; i++)
                {
                    assertEquals(ec.get(Object.class, i), context[i]);
                }


                return handled;
            }
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        train_canonicalizePageName(resolver, pageName, pageName);

        train_collectPageActivationContext(collector, pageName, 3);

        EventContext pageActivationContext = new ArrayEventContext(typeCoercer, 3);
        PageRenderRequestParameters parameters = new PageRenderRequestParameters(pageName, pageActivationContext);

        expect(factory.createPageRenderLink(parameters)).andReturn(link);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        train_getName(activePage, "order/View");
        train_getName(primaryPage, primaryPageName);

        train_collectPageActivationContext(collector, "order/View", "x", "y");

        EventContext pageActivationContext = new ArrayEventContext(typeCoercer, "x", "y");
        EventContext eventContext = new ArrayEventContext(typeCoercer, 3, 5, 9);

        ComponentEventRequestParameters parameters = new ComponentEventRequestParameters("order/View", primaryPageName,
                                                                                         "gnip.gnop", "myevent",
                                                                                         pageActivationContext,
                                                                                         eventContext);
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    public void override_passivate_context()
    {
        ComponentClassResolver resolver = mockComponentClassResolver();
        LinkSource source = mockLinkSource();
        Link link = mockLink();
        EventContext eventContext = mockEventContext();

        train_resolvePageClassNameToPageName(resolver, PAGE_CLASS.getName(), PAGE_NAME);

        expect(source.createPageRenderLink(PAGE_NAME, true, "fred", "barney")).andReturn(link);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.