Package org.springframework.mock.web.portlet

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


            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

        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

  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

    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

    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

    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

        }
      }
    };
    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

  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

  private MockPortletContext context;

  protected void setUp() throws Exception {
    super.setUp();
    context = new MockPortletContext();
    // a fresh MockPortletContext seems to already contain an element;
    // that's confusing, so we remove it
    context.removeAttribute("javax.servlet.context.tempdir");
    tested = new PortletContextMap(context);
    tested.put("SomeKey", "SomeValue");
View Full Code Here

TOP

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

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.