Package org.apache.tapestry5.runtime

Examples of org.apache.tapestry5.runtime.PageLifecycleListener


        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        ComponentModel model = mockComponentModel();
        ComponentPageElement element = mockComponentPageElement();
        Page page = mockPage();
        PageLifecycleListener listener = newMock(PageLifecycleListener.class);

        train_getModel(ins, model);

        page.addLifecycleListener(listener);
View Full Code Here


    }

    @Test
    public void detach_notification()
    {
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();

        listener1.containingPageDidDetach();
        listener2.containingPageDidDetach();

        replay();

        Page page = new PageImpl(null, locale, null);
View Full Code Here

     * Also checks that listeners are invoked, even if the page is dirty.
     */
    @Test
    public void detach_dirty_if_dirty_count_non_zero()
    {
        PageLifecycleListener listener = newPageLifecycle();

        listener.containingPageDidDetach();

        replay();

        Page page = new PageImpl(null, locale, null);

View Full Code Here

    @Test
    public void detach_dirty_if_listener_throws_exception()
    {
        ComponentPageElement element = mockComponentPageElement();
        Logger logger = mockLogger();
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();
        RuntimeException t = new RuntimeException("Listener detach exception.");

        train_getLogger(element, logger);

        listener1.containingPageDidDetach();
        setThrowable(t);

        logger.error(contains("failed during page detach"), same(t));

        listener2.containingPageDidDetach();

        replay();

        Page page = new PageImpl(null, locale, null);
        page.setRootElement(element);
View Full Code Here

    }

    @Test
    public void attach_notification()
    {
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();

        listener1.restoreStateBeforePageAttach();
        listener2.restoreStateBeforePageAttach();

        listener1.containingPageDidAttach();
        listener2.containingPageDidAttach();

        replay();

        Page page = new PageImpl(null, locale, null);
View Full Code Here

    }

    @Test
    public void load_notification()
    {
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();

        listener1.containingPageDidLoad();
        listener2.containingPageDidLoad();

        replay();

        Page page = new PageImpl(LOGICAL_PAGE_NAME, locale, null);
View Full Code Here

        Component component = mockComponent();
        Instantiator ins = mockInstantiator(component);
        ComponentModel model = mockComponentModel();
        ComponentPageElement element = mockComponentPageElement();
        Page page = mockPage();
        PageLifecycleListener listener = newMock(PageLifecycleListener.class);

        train_getModel(ins, model);

        page.addLifecycleListener(listener);
View Full Code Here

    }

    @Test
    public void detach_notification()
    {
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();

        listener1.containingPageDidDetach();
        listener2.containingPageDidDetach();

        MetaDataLocator locator = newMetaDataLocator(LOGICAL_PAGE_NAME, true);

        replay();
View Full Code Here

    @Test
    public void detach_dirty_if_listener_throws_exception()
    {
        ComponentPageElement element = mockComponentPageElement();
        Logger logger = mockLogger();
        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();
        RuntimeException t = new RuntimeException("Listener detach exception.");
        MetaDataLocator locator = newMetaDataLocator(LOGICAL_PAGE_NAME, true);

        train_getLogger(element, logger);

        listener1.containingPageDidDetach();
        setThrowable(t);

        logger.error(contains("failed during page detach"), same(t));

        listener2.containingPageDidDetach();

        replay();

        Page page = new PageImpl(LOGICAL_PAGE_NAME, selector, null, perThreadManager, locator);
        page.setRootElement(element);
View Full Code Here

    @Test
    public void attach_notification()
    {
        MetaDataLocator locator = newMetaDataLocator(LOGICAL_PAGE_NAME, true);

        PageLifecycleListener listener1 = newPageLifecycle();
        PageLifecycleListener listener2 = newPageLifecycle();

        listener1.containingPageDidAttach();
        listener2.containingPageDidAttach();

        replay();

        Page page = new PageImpl(LOGICAL_PAGE_NAME, selector, null, perThreadManager, locator);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.runtime.PageLifecycleListener

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.