Examples of IPortletCookieDao


Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

  /**
   * Control test invocation of {@link PortletCookieServiceImpl#updatePortalCookie(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}.
   */
  @Test
  public void testUpdatePortletCookieControl() {
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
   
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
    EasyMock.expect(portletCookieDao.updatePortalCookieExpiration(portalCookie, PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
    EasyMock.replay(portletCookieDao);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

   * Test {@link PortletCookieServiceImpl#getOrCreatePortalCookie(javax.servlet.http.HttpServletRequest)}.
   * that results in creating a new PortalCookie.
   */
  @Test
  public void testGetOrCreatePortalCookieCreate() {
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
   
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
    EasyMock.replay(portletCookieDao);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

   * Test {@link PortletCookieServiceImpl#getOrCreatePortalCookie(javax.servlet.http.HttpServletRequest)}.
   * that results in returning an existing portalcookie from the request cookies
   */
  @Test
  public void testGetOrCreatePortalCookieGetExistingFromRequestCookies() {
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
   
    EasyMock.expect(portletCookieDao.getPortalCookie("ABCDEF")).andReturn(portalCookie);
    EasyMock.replay(portletCookieDao);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

   * Test {@link PortletCookieServiceImpl#getOrCreatePortalCookie(javax.servlet.http.HttpServletRequest)}.
   * that results in returning an existing portalcookie from the id stored in the session.
   */
  @Test
  public void testGetOrCreatePortalCookieGetExistingFromSession() {
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
   
    EasyMock.expect(portletCookieDao.getPortalCookie("ABCDEF")).andReturn(portalCookie);
    EasyMock.replay(portletCookieDao);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

  public void testAddCookieControl() {
    Cookie portletCookie = new Cookie("somePortletCookieName", "somePortletCookieValue");
    // max age will trigger persistence
    portletCookie.setMaxAge(360);
   
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
   
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
   
   
    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
    EasyMock.expect(portletCookieDao.addOrUpdatePortletCookie(portalCookie, portletCookie)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

  public void testAddCookieRemove() {
    Cookie portletCookie = new Cookie("somePortletCookieName", "somePortletCookieValue");
    // max age will trigger persistence removal
    portletCookie.setMaxAge(0);
   
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
   
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
   
    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
    EasyMock.expect(portletCookieDao.addOrUpdatePortletCookie(portalCookie, portletCookie)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
View Full Code Here

Examples of org.jasig.portal.portlet.dao.IPortletCookieDao

  public void testAddCookieSessionOnly() {
    Cookie portletCookie = new Cookie("somePortletCookieName", "somePortletCookieValue");
    // max age will trigger persistence
    portletCookie.setMaxAge(-1);
   
    IPortletCookieDao portletCookieDao = EasyMock.createMock(IPortletCookieDao.class);
   
    MockPortalCookie portalCookie = new MockPortalCookie();
    portalCookie.setValue("ABCDEF");
   
    EasyMock.expect(portletCookieDao.createPortalCookie(PortletCookieServiceImpl.DEFAULT_MAX_AGE)).andReturn(portalCookie);
   
    PortletCookieServiceImpl cookieService = new PortletCookieServiceImpl();
    cookieService.setPortletCookieDao(portletCookieDao);
   
    IPortletWindowId mockWindowId = EasyMock.createMock(IPortletWindowId.class);
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.