Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.Session


        hs.setMaxInactiveInterval(seconds);

        replay();

        Session session = new SessionImpl(hs, null);

        session.setMaxInactiveInterval(seconds);

        verify();
    }
View Full Code Here


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

        replay();

        Session session = new SessionImpl(hs, null);

        assertEquals(session.getMaxInactiveInterval(), seconds);

        verify();
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void get_aso_already_exists()
    {
        Request request = mockRequest();
        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()
    {
        Request request = mockRequest();
        Session session = mockSession();
        Class asoClass = ReadOnlyBean.class;
        Object aso = new ReadOnlyBean();
        String key = "aso:" + asoClass.getName();
        ApplicationStateCreator creator = mockApplicationStateCreator();

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

        // Second for get()
        train_getSession(request, true, session);

        // Not in map
        train_getAttribute(session, key, null);

        train_create(creator, aso);

        session.setAttribute(key, aso);

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

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

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

        replay();

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

        System.err.println("DELETED");
    }
   
    public String getPersistedEntityClassName()
    {
      Session session = request.getSession(true);
     
      Object value = session.getAttribute("sso:"+User.class.getName());
     
      System.err.println("getPersistedEntityClassName(): "+value);
     
      return value.getClass().getName();
    }
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

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

        replay();

        Session session = new SessionImpl(null, hs, lock);

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

        verify();
    }
View Full Code Here

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

        replay();

        Session session = new SessionImpl(null, hs, lock);

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

        verify();
    }
View Full Code Here

        hs.invalidate();

        replay();

        Session session = new SessionImpl(null, hs, lock);

        session.invalidate();

        verify();
    }
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.