Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.Session


        train_getAttribute(hs, "dirty", dirty);

        replay();

        Session session = new ClusteredSessionImpl(hsr, hs, analyzer);

        assertSame(session.getAttribute("dirty"), dirty);

        verify();

        expect(analyzer.checkAndResetDirtyState(dirty)).andReturn(true);

        train_getSession(hsr, false, hs);

        hs.setAttribute("dirty", dirty);

        replay();

        session.restoreDirtyObjects();

        verify();
    }
View Full Code Here


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

        replay();

        Session session = new SessionImpl(null, hs);

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

        verify();
    }
View Full Code Here

        train_getAttribute(ss, "foo", "bar");

        replay();

        Request request = new RequestImpl(sr, CHARSET, null);
        Session session = request.getSession(true);

        assertEquals(session.getAttribute("foo"), "bar");

        verify();
    }
View Full Code Here

        userDAO.delete(users.toArray(new User[0]));
    }

    public String getPersistedEntityClassName()
    {
        final Session session = request.getSession(true);

        final Object value = session.getAttribute("sso:" + User.class.getName());

        return value.getClass().getName();
    }
View Full Code Here

            this.key = key;
        }

        public Object get(Object instance, InstanceContext context)
        {
            Session session = getSession();

            if (session == null)
            {
                return null;
            }

            return session.getAttribute(key);
        }
View Full Code Here

    Object onActionFromKill()
    {
        if (!productionMode)
        {
            Session session = request.getSession(false);

            if (session == null)
            {
                alertManager.info("No server-side session currently exist.");
            } else
            {
                session.invalidate();
                alertManager.info("Server-side session invalidated.");
            }
        }

        return devmodezone.getBody();
View Full Code Here

    @Test
    public void force_session_create()
    {
        HttpServletRequest sr = mockHttpServletRequest();
        TapestrySessionFactory sf = newMock(TapestrySessionFactory.class);
        Session session = mockSession();

        expect(sf.getSession(true)).andReturn(session);

        replay();
View Full Code Here

    @Test
    public void isSessionInvalidated_is_false_when_session_exists_and_is_valid()
    {
        HttpServletRequest sr = mockHttpServletRequest();
        Session session = mockSession();

        TapestrySessionFactory sf = newMock(TapestrySessionFactory.class);

        expect(sf.getSession(false)).andReturn(session);
        expect(session.isInvalidated()).andReturn(false);

        replay();

        Request request = new RequestImpl(sr, CHARSET, sf);
View Full Code Here

    @Test
    public void isSessionInvalidated_is_true_when_session_is_invalid()
    {
        HttpServletRequest sr = mockHttpServletRequest();
        Session session = mockSession();

        TapestrySessionFactory sf = newMock(TapestrySessionFactory.class);

        expect(sf.getSession(false)).andReturn(session);
        expect(session.isInvalidated()).andReturn(true);

        replay();

        Request request = new RequestImpl(sr, CHARSET, sf);
View Full Code Here

    private Cookies cookies;

    Object onActivate() {

        // Clear session
        Session session = request.getSession(false);
        if (session != null) {
            session.invalidate();
        }

        // Remove RememberMe cookie
        cookies.removeCookieValue(TokenBasedRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.