Spring Framework MockPortletConfig - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework MockPortletConfig class.

This code example shows how to use the following methods:addInitParameter
		assertNull(portletBean.getTestParam()); 
	} 
 
	public void testMultipleInitParametersSet() throws Exception { 
		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); 
		assertNotNull(portletBean.getTestParam()); 
		assertNotNull(portletBean.getAnotherParam()); 
		assertEquals(testValue, portletBean.getTestParam()); 
		assertEquals(anotherValue, portletBean.getAnotherParam()); 
	} 
8
CodeRank
This code example shows how to use the following methods:
		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"); 
		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()); 
6
CodeRank