Examples of MockPortletContext


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

  public void testTypeLevelParameterDispatchingController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
      protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
        StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
        wac.setPortletContext(new MockPortletContext());
        RootBeanDefinition bd = new RootBeanDefinition(MyTypeLevelParameterDispatchingController.class);
        bd.setScope(WebApplicationContext.SCOPE_REQUEST);
        wac.registerBeanDefinition("controller", bd);
        RootBeanDefinition bd2 = new RootBeanDefinition(MySpecialParameterDispatchingController.class);
        bd2.setScope(WebApplicationContext.SCOPE_REQUEST);
View Full Code Here

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

        mockInvocation.stubs().method("getStack").will(returnValue(stack));

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

      portletConfig.addInitParameter("viewNamespace", "/view");
      portletConfig.addInitParameter("defaultViewAction", "index!input");
     
View Full Code Here

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

            fail("Error occured");
        }
    }
   
    public void testMultipartRequest_parametersAreCopiedToActionInvocation() throws Exception {
      MockPortletContext ctx = new MockPortletContext();
      ctx.setAttribute("javax.servlet.context.tempdir", new File("target").getAbsoluteFile());
      MockActionRequest request = new MockActionRequest(ctx);
      request.setContent(MULTIPART_REQUEST.getBytes("US-ASCII"));
      request.setContentType("multipart/form-data; boundary=---------------------------4827543632391");
      request.setProperty("Content-Length", "" + MULTIPART_REQUEST.length());
      MockActionResponse response = new MockActionResponse();
View Full Code Here

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

        catch (ServletException e)
        {
            fail("Failed to initialize spring init servlet: " + e);
        }
       
        portletContext = new MockPortletContext(new DefaultResourceLoader());
        portletConfig = new MockPortletConfig(portletContext);
        ((MockPortletConfig) portletConfig).addInitParameter("stylesheet", "/test-rss.xsl");
        ResourceBundle bundle = new ListResourceBundle()
        {
            protected Object[][] getContents()
View Full Code Here

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

  ValueStack stack;

  public void setUp() throws Exception {
    super.setUp();
    renderer = new PortletUrlRenderer();
    context = new MockPortletContext();
    renderUrl = new MockPortletURL(
        new MockPortalContext(), "render");
    actionUrl = new MockPortletURL(
        new MockPortalContext(), "action");
    request = new MockRenderRequest();
View Full Code Here

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

    mockInvocation.stubs().method("getStack").will(returnValue(stack));

  }

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

    portletConfig.addInitParameter("viewNamespace", "/view");
    portletConfig.addInitParameter("defaultViewAction", "index!input");
View Full Code Here

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

    dispatcher.init((PortletConfig) mockConfig.proxy());
    dispatcher.render((RenderRequest) mockRequest.proxy(), (RenderResponse) mockResponse.proxy());
  }

  public void testMultipartRequest_parametersAreCopiedToActionInvocation() throws Exception {
    MockPortletContext ctx = new MockPortletContext();
    ctx.setAttribute("javax.servlet.context.tempdir", new File("target").getAbsoluteFile());
    MockActionRequest request = new MockActionRequest(ctx);
    request.setContent(MULTIPART_REQUEST.getBytes("US-ASCII"));
    request.setContentType("multipart/form-data; boundary=---------------------------4827543632391");
    request.setProperty("Content-Length", "" + MULTIPART_REQUEST.length());
    MockActionResponse response = new MockActionResponse();
View Full Code Here

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

    mockInvocation.stubs().method("getStack").will(returnValue(stack));

  }

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

    portletConfig.addInitParameter("viewNamespace", "/view");
    portletConfig.addInitParameter("defaultViewAction", "index!input");
View Full Code Here

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

        }
      }
    };
    controller.setFlowExecutor(flowExecutor);
    controller.setApplicationContext(new StaticWebApplicationContext());
    portletContext = new MockPortletContext();
    controller.setPortletContext(portletContext);
    controller.afterPropertiesSet();

    actionRequest = new MockActionRequest();
    actionResponse = new MockActionResponse();
View Full Code Here

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

  private MockRenderResponse renderResponse;

  private PortletExternalContext renderContext;

  protected void setUp() {
    portletContext = new MockPortletContext();
    request = new MockActionRequest();
    response = new MockActionResponse();
    context = new PortletExternalContext(portletContext, request, response);
    renderRequest = new MockRenderRequest();
    renderResponse = new MockRenderResponse();
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.