Package org.springframework.mock.web.portlet

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


  }
 
  public void testRenderRequestWithoutCacheSetting() throws Exception {
    TestController tc = new TestController();
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    tc.handleRenderRequest(request, response);
    String cacheProperty = response.getProperty(RenderResponse.EXPIRATION_CACHE);
    assertNull("Expiration-cache should be null", cacheProperty);
  }
View Full Code Here


  public void testRenderRequestWithNegativeCacheSetting() throws Exception {
    TestController tc = new TestController();
    tc.setCacheSeconds(-99);
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    tc.handleRenderRequest(request, response);   
    String cacheProperty = response.getProperty(RenderResponse.EXPIRATION_CACHE);
    assertNull("Expiration-cache should be null", cacheProperty);
  }
View Full Code Here

 
  public void testRenderRequestWithZeroCacheSetting() throws Exception {
    TestController tc = new TestController();
    tc.setCacheSeconds(0);
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    tc.handleRenderRequest(request, response);   
    String cacheProperty = response.getProperty(RenderResponse.EXPIRATION_CACHE);
    assertEquals("Expiration-cache should be set to 0 seconds", "0", cacheProperty);
  }
View Full Code Here

  public void testRenderRequestWithPositiveCacheSetting() throws Exception {
    TestController tc = new TestController();
    tc.setCacheSeconds(30);
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    tc.handleRenderRequest(request, response);   
    String cacheProperty = response.getProperty(RenderResponse.EXPIRATION_CACHE);
    assertEquals("Expiration-cache should be set to 30 seconds", "30", cacheProperty);
  }
View Full Code Here

      protected boolean suppressBinding(PortletRequest request) {
        return true;
      }
    };
    MockRenderRequest request = new MockRenderRequest();   
    MockRenderResponse response = new MockRenderResponse();
    String name = "test";
    int age = 30;
    request.addParameter("name", name);
    request.addParameter("age", "" + age);
    request.setContextPath("test");
View Full Code Here

      protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) {
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
      }
    };
    MockRenderRequest request = new MockRenderRequest();   
    MockRenderResponse response = new MockRenderResponse();
    String name = "test";
    int age = 30;
    request.addParameter("name", name);
    request.addParameter("age", "" + age);
    String dateString = "07-03-2006";
View Full Code Here

      protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) {
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
      }
    };
    MockRenderRequest request = new MockRenderRequest();   
    MockRenderResponse response = new MockRenderResponse();
    String name = "test";
    int age = 30;
    request.addParameter("name", name);
    request.addParameter("age", "" + age);
    String emptyString = "";
View Full Code Here

      protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) {
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
      }
    };
    MockRenderRequest request = new MockRenderRequest();   
    MockRenderResponse response = new MockRenderResponse();
    String name = "test";
    int age = 30;
    request.addParameter("name", name);
    request.addParameter("age", "" + age);
    String dateString = "";
View Full Code Here

          }
        });
      }
    };
    MockRenderRequest request = new MockRenderRequest();   
    MockRenderResponse response = new MockRenderResponse();
    String name = "test";
    String spouseName = "testSpouse";
    int age = 30;
    int spouseAge = 31;
    request.addParameter("name", name);
View Full Code Here

      public void validate(Object o, Errors e) {}
    };
    TestController tc = new TestController();
    tc.setValidator(v);
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    try {
      tc.handleRenderRequest(request, response);
      fail("Should have thrown IllegalArgumentException");
    }
    catch(IllegalArgumentException e) {
View Full Code Here

TOP

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

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.