Spring Framework ServletContextAwareProcessor - 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 ServletContextAwareProcessor class.

This code example shows how to use the following methods:postProcessBeforeInitialization
	} 
 
	public void testServletContextAwareWithNullServletContextAndNonNullServletConfig() { 
		ServletContext servletContext = new MockServletContext(); 
		ServletConfig servletConfig = new MockServletConfig(servletContext); 
		ServletContextAwareProcessor processor = new ServletContextAwareProcessor(null, servletConfig); 
		ServletContextAwareBean bean = new ServletContextAwareBean(); 
		assertNull(bean.getServletContext()); 
		processor.postProcessBeforeInitialization(bean, "testBean"); 
		assertNotNull("ServletContext should have been set", bean.getServletContext()); 
		assertEquals(servletContext, bean.getServletContext()); 
	} 
 
	public void testServletContextAwareWithNonNullServletContextAndNullServletConfig() { 
		ServletContext servletContext = new MockServletContext(); 
		ServletContextAwareProcessor processor = new ServletContextAwareProcessor(servletContext, null); 
		ServletContextAwareBean bean = new ServletContextAwareBean(); 
		assertNull(bean.getServletContext()); 
		processor.postProcessBeforeInitialization(bean, "testBean"); 
		assertNotNull("ServletContext should have been set", bean.getServletContext()); 
6
CodeRank
See Code Examples for Spring Framework ServletContextAwareProcessor Methods: