Package org.springframework.web.portlet

Examples of org.springframework.web.portlet.HandlerMapping


    pac.setConfigLocations(new String[] {CONF});
    pac.refresh();
  }
 
  public void testPortletModeView() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.VIEW);
   
    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("viewHandler"), handler);
  }
View Full Code Here


    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("viewHandler"), handler);
  }

  public void testPortletModeEdit() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.EDIT);
   
    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("editHandler"), handler);
  }
View Full Code Here

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("editHandler"), handler);
  }
 
  public void testPortletModeHelp() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.HELP);
   
    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("helpHandler"), handler);
  }
View Full Code Here

    pac.setConfigLocations(new String[] {CONF});
    pac.refresh();
  }
 
  public void testParameterMapping() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest addRequest = new MockPortletRequest();
    addRequest.addParameter("action", "add");

    MockPortletRequest removeRequest = new MockPortletRequest();
    removeRequest.addParameter("action", "remove");
   
    Object addHandler = hm.getHandler(addRequest).getHandler();
    Object removeHandler = hm.getHandler(removeRequest).getHandler();
   
    assertEquals(pac.getBean("addItemHandler"), addHandler);
    assertEquals(pac.getBean("removeItemHandler"), removeHandler);
  }
View Full Code Here

    assertEquals(pac.getBean("addItemHandler"), addHandler);
    assertEquals(pac.getBean("removeItemHandler"), removeHandler);
  }
 
  public void testUnregisteredHandlerWithNoDefault() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest request = new MockPortletRequest();
    request.addParameter("action", "modify");

    assertNull(hm.getHandler(request));   
  }
View Full Code Here

    pac.setConfigLocations(new String[] {CONF});
    pac.refresh();
  }
 
  public void testPortletModeViewWithParameter() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest addRequest = new MockPortletRequest();
    addRequest.setPortletMode(PortletMode.VIEW);
    addRequest.setParameter("action", "add");

    MockPortletRequest removeRequest = new MockPortletRequest();
    removeRequest.setPortletMode(PortletMode.VIEW);
    removeRequest.setParameter("action", "remove");
   
    Object addHandler = hm.getHandler(addRequest).getHandler();
    Object removeHandler = hm.getHandler(removeRequest).getHandler();
   
    assertEquals(pac.getBean("addItemHandler"), addHandler);
    assertEquals(pac.getBean("removeItemHandler"), removeHandler);
  }
View Full Code Here

    assertEquals(pac.getBean("addItemHandler"), addHandler);
    assertEquals(pac.getBean("removeItemHandler"), removeHandler);
  }

  public void testPortletModeEditWithParameter() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");
   
    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.EDIT);
    request.setParameter("action", "prefs");
   
    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("preferencesHandler"), handler);
  }
View Full Code Here

    pac.setConfigLocations(new String[] {CONF});
    pac.refresh();
  }

  public void testPortletModeView() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");

    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.VIEW);

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("viewHandler"), handler);
  }
View Full Code Here

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("viewHandler"), handler);
  }

  public void testPortletModeEdit() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");

    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.EDIT);

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("editHandler"), handler);
  }
View Full Code Here

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("editHandler"), handler);
  }

  public void testPortletModeHelp() throws Exception {
    HandlerMapping hm = (HandlerMapping)pac.getBean("handlerMapping");

    MockPortletRequest request = new MockPortletRequest();
    request.setPortletMode(PortletMode.HELP);

    Object handler = hm.getHandler(request).getHandler();
    assertEquals(pac.getBean("helpHandler"), handler);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.portlet.HandlerMapping

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.