Package org.springframework.mock.web.portlet

Examples of org.springframework.mock.web.portlet.MockPortletConfig


  }

  public void testParseConfigWithBang() {
    MockPortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);

    portletConfig.addInitParameter("viewNamespace", "/view");
    portletConfig.addInitParameter("defaultViewAction", "index!input");

    Map<PortletMode, ActionMapping> actionMap = new HashMap<PortletMode, ActionMapping>();

    dispatcher.parseModeConfig(actionMap, portletConfig, PortletMode.VIEW, "viewNamespace", "defaultViewAction");
View Full Code Here


    }
   
    public void testParseConfigWithBang() {
      MockPortletContext portletContext = new MockPortletContext();
      MockPortletConfig portletConfig = new MockPortletConfig(portletContext);

      portletConfig.addInitParameter("viewNamespace", "/view");
      portletConfig.addInitParameter("defaultViewAction", "index!input");
     
      Map<PortletMode, ActionMapping> actionMap = new HashMap<PortletMode, ActionMapping>();
     
      dispatcher.parseModeConfig(actionMap, portletConfig, PortletMode.VIEW, "viewNamespace", "defaultViewAction");
     
View Full Code Here

    assertEquals(portletContext, bean.getPortletContext());
  }

  public void testPortletContextAwareWithPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletConfig);
    PortletContextAwareBean bean = new PortletContextAwareBean();
    assertNull(bean.getPortletContext());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletContext should have been set", bean.getPortletContext());
View Full Code Here

    assertEquals(portletContext, bean.getPortletContext());
  }

  public void testPortletContextAwareWithPortletContextAndPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletContext, portletConfig);
    PortletContextAwareBean bean = new PortletContextAwareBean();
    assertNull(bean.getPortletContext());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletContext should have been set", bean.getPortletContext());
View Full Code Here

    assertEquals(portletContext, bean.getPortletContext());
  }

  public void testPortletContextAwareWithNullPortletContextAndNonNullPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(null, portletConfig);
    PortletContextAwareBean bean = new PortletContextAwareBean();
    assertNull(bean.getPortletContext());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletContext should have been set", bean.getPortletContext());
View Full Code Here

    assertNull(bean.getPortletConfig());
  }

  public void testPortletConfigAwareWithPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletConfig);
    PortletConfigAwareBean bean = new PortletConfigAwareBean();
    assertNull(bean.getPortletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletConfig should have been set", bean.getPortletConfig());
View Full Code Here

    assertEquals(portletConfig, bean.getPortletConfig());
  }

  public void testPortletConfigAwareWithPortletContextAndPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletContext, portletConfig);
    PortletConfigAwareBean bean = new PortletConfigAwareBean();
    assertNull(bean.getPortletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletConfig should have been set", bean.getPortletConfig());
View Full Code Here

    assertEquals(portletConfig, bean.getPortletConfig());
  }

  public void testPortletConfigAwareWithNullPortletContextAndNonNullPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(null, portletConfig);
    PortletConfigAwareBean bean = new PortletConfigAwareBean();
    assertNull(bean.getPortletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletConfig should have been set", bean.getPortletConfig());
View Full Code Here

  private DispatcherPortlet complexDispatcherPortlet;


  @Override
  protected void setUp() throws PortletException {
    complexPortletConfig = new MockPortletConfig(new MockPortletContext(), "complex");
    complexPortletConfig.addInitParameter("publishContext", "false");

    complexDispatcherPortlet = new DispatcherPortlet();
    complexDispatcherPortlet.setContextClass(ComplexPortletApplicationContext.class);
    complexDispatcherPortlet.setNamespace("test");
View Full Code Here

  public void testNoDetectAllHandlerMappingsWithPortletModeActionRequest() throws Exception {
    DispatcherPortlet complexDispatcherPortlet = new DispatcherPortlet();
    complexDispatcherPortlet.setContextClass(ComplexPortletApplicationContext.class);
    complexDispatcherPortlet.setNamespace("test");
    complexDispatcherPortlet.setDetectAllHandlerMappings(false);
    complexDispatcherPortlet.init(new MockPortletConfig(getPortletContext(), "complex"));
    MockActionRequest request = new MockActionRequest();
    MockActionResponse response = new MockActionResponse();
    request.setPortletMode(PortletMode.EDIT);
    complexDispatcherPortlet.processAction(request, response);
    String exceptionParam = response.getRenderParameter(DispatcherPortlet.ACTION_EXCEPTION_RENDER_PARAMETER);
View Full Code Here

TOP

Related Classes of org.springframework.mock.web.portlet.MockPortletConfig

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.