Package org.springframework.mock.web.portlet

Examples of org.springframework.mock.web.portlet.MockPortletConfig.addInitParameter()


    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testValue = "testValue";
    String anotherValue = "anotherValue";
    portletConfig.addInitParameter("testParam", testValue);
    portletConfig.addInitParameter("anotherParam", anotherValue);
    portletConfig.addInitParameter("unknownParam", "unknownValue");
    TestPortletBean portletBean = new TestPortletBean();
    assertNull(portletBean.getTestParam());
    assertNull(portletBean.getAnotherParam());
    portletBean.init(portletConfig);
View Full Code Here


    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testValue = "testValue";
    String anotherValue = "anotherValue";
    portletConfig.addInitParameter("testParam", testValue);
    portletConfig.addInitParameter("anotherParam", anotherValue);
    portletConfig.addInitParameter("unknownParam", "unknownValue");
    TestPortletBean portletBean = new TestPortletBean();
    assertNull(portletBean.getTestParam());
    assertNull(portletBean.getAnotherParam());
    portletBean.init(portletConfig);
    assertNotNull(portletBean.getTestParam());
View Full Code Here

  public void testMultipleInitParametersOnlyOneSet() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testValue = "testValue";
    portletConfig.addInitParameter("testParam", testValue);
    portletConfig.addInitParameter("unknownParam", "unknownValue");
    TestPortletBean portletBean = new TestPortletBean();
    assertNull(portletBean.getTestParam());
    assertNull(portletBean.getAnotherParam());
    portletBean.init(portletConfig);
View Full Code Here

  public void testMultipleInitParametersOnlyOneSet() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testValue = "testValue";
    portletConfig.addInitParameter("testParam", testValue);
    portletConfig.addInitParameter("unknownParam", "unknownValue");
    TestPortletBean portletBean = new TestPortletBean();
    assertNull(portletBean.getTestParam());
    assertNull(portletBean.getAnotherParam());
    portletBean.init(portletConfig);
    assertNotNull(portletBean.getTestParam());
View Full Code Here

  public void testRequiredInitParameterSet() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testParam = "testParam";
    String testValue = "testValue";
    portletConfig.addInitParameter(testParam, testValue);
    TestPortletBean portletBean = new TestPortletBean();
    portletBean.addRequiredProperty(testParam);
    assertNull(portletBean.getTestParam());
    portletBean.init(portletConfig);
    assertNotNull(portletBean.getTestParam());
View Full Code Here

  public void testRequiredInitParameterNotSetOtherParameterNotSet() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testParam = "testParam";
    String testValue = "testValue";
    portletConfig.addInitParameter(testParam, testValue);
    TestPortletBean portletBean = new TestPortletBean();
    portletBean.addRequiredProperty("anotherParam");
    assertNull(portletBean.getTestParam());
    try {
      portletBean.init(portletConfig);
View Full Code Here

  public void testUnknownRequiredInitParameter() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    String testParam = "testParam";
    String testValue = "testValue";
    portletConfig.addInitParameter(testParam, testValue);
    TestPortletBean portletBean = new TestPortletBean();
    portletBean.addRequiredProperty("unknownParam");
    assertNull(portletBean.getTestParam());
    try {
      portletBean.init(portletConfig);
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.