Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.Session


    @SuppressWarnings("unchecked")
    @Test
    public void get_aso_already_exists()
    {
        SessionHolder holder = newSessionHolder();
        Session session = mockSession();
        Class asoClass = ReadOnlyBean.class;
        Object aso = new ReadOnlyBean();
        String key = "aso:" + asoClass.getName();
        ApplicationStateCreator creator = mockApplicationStateCreator();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void get_aso_needs_to_be_created()
    {
        SessionHolder holder = newSessionHolder();
        Session session = mockSession();
        Class asoClass = ReadOnlyBean.class;
        Object aso = new ReadOnlyBean();
        String key = "aso:" + asoClass.getName();
        ApplicationStateCreator creator = mockApplicationStateCreator();

        // First for exists()
        train_getSession(holder, false, session);
        train_getAttribute(session, key, null);

        // Second for get()
        train_getSession(holder, true, session);
        train_getAttribute(session, key, null);

        train_create(creator, aso);

        session.setAttribute(key, aso);

        // Then for exists() after
        train_getSession(holder, false, session);
        train_getAttribute(session, key, aso);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void set_aso()
    {
        SessionHolder holder = newSessionHolder();
        Session session = mockSession();
        Class asoClass = ReadOnlyBean.class;
        Object aso = new ReadOnlyBean();
        String key = "aso:" + asoClass.getName();

        train_getSession(holder, true, session);
        session.setAttribute(key, aso);

        replay();

        ApplicationStatePersistenceStrategy strategy = new SessionApplicationStatePersistenceStrategy(
                holder);
View Full Code Here

        expect(hs.getAttributeNames()).andReturn(e);

        replay();

        Session session = new SessionImpl(hs);

        assertEquals(session.getAttributeNames(), Arrays.asList("barney", "fred"));

        verify();
    }
View Full Code Here

        expect(hs.getAttributeNames()).andReturn(e);

        replay();

        Session session = new SessionImpl(hs);

        assertEquals(session.getAttributeNames("f"), Arrays.asList("fanny", "fred"));

        verify();
    }
View Full Code Here

        expect(hs.getAttributeNames()).andReturn(e);

        replay();

        Session session = new SessionImpl(hs);

        assertEquals(session.getAttributeNames(), Arrays.asList("barney", "fred"));

        verify();
    }
View Full Code Here

        expect(hs.getAttributeNames()).andReturn(e);

        replay();

        Session session = new SessionImpl(hs);

        assertEquals(session.getAttributeNames("f"), Arrays.asList("fanny", "fred"));

        verify();
    }
View Full Code Here

        hs.invalidate();

        replay();

        Session session = new SessionImpl(hs);

        session.invalidate();

        verify();
    }
View Full Code Here

        hs.setMaxInactiveInterval(seconds);

        replay();

        Session session = new SessionImpl(hs);

        session.setMaxInactiveInterval(seconds);

        verify();
    }
View Full Code Here

        expect(hs.getMaxInactiveInterval()).andReturn(seconds);

        replay();

        Session session = new SessionImpl(hs);

        assertEquals(session.getMaxInactiveInterval(), seconds);

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.Session

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.