Package org.springframework.mock.web.portlet

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


    assertNotNull("PortletContext should have been set", bean.getPortletContext());
    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");
View Full Code Here


    assertNotNull("PortletContext should have been set", bean.getPortletContext());
    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");
View Full Code Here

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

    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNull(bean.getPortletContext());
  }
 
  public void testPortletConfigAwareWithPortletContextOnly() {
    PortletContext portletContext = new MockPortletContext();
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletContext);
    PortletConfigAwareBean bean = new PortletConfigAwareBean();
    assertNull(bean.getPortletConfig());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNull(bean.getPortletConfig());
View Full Code Here

    processor.postProcessBeforeInitialization(bean, "testBean");
    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");
View Full Code Here

    assertNotNull("PortletConfig should have been set", bean.getPortletConfig());
    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");
View Full Code Here

    assertNotNull("PortletConfig should have been set", bean.getPortletConfig());
    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");
View Full Code Here

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

* @author Mark Fisher
*/
public class GenericPortletBeanTests extends TestCase {

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

    assertNotNull(portletBean.getTestParam());
    assertEquals(testValue, portletBean.getTestParam());
  }
 
  public void testInitParameterNotSet() throws Exception {
    PortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);
    TestPortletBean portletBean = new TestPortletBean();
    assertNull(portletBean.getTestParam());
    portletBean.init(portletConfig);
    assertNull(portletBean.getTestParam());
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.