public void testDispatcherPortletContextRefresh() throws PortletException {
MockPortletContext portletContext = new MockPortletContext("org/springframework/web/portlet/context");
DispatcherPortlet portlet = new DispatcherPortlet();
portlet.init(new MockPortletConfig(portletContext, "empty"));
PortletContextAwareBean contextBean = (PortletContextAwareBean)
portlet.getPortletApplicationContext().getBean("portletContextAwareBean");
PortletConfigAwareBean configBean = (PortletConfigAwareBean)
portlet.getPortletApplicationContext().getBean("portletConfigAwareBean");
assertSame(portletContext, contextBean.getPortletContext());
assertSame(portlet.getPortletConfig(), configBean.getPortletConfig());
PortletMultipartResolver multipartResolver = portlet.getMultipartResolver();
assertNotNull(multipartResolver);
((ConfigurableApplicationContext) portlet.getPortletApplicationContext()).refresh();
PortletContextAwareBean contextBean2 = (PortletContextAwareBean)
portlet.getPortletApplicationContext().getBean("portletContextAwareBean");
PortletConfigAwareBean configBean2 = (PortletConfigAwareBean)
portlet.getPortletApplicationContext().getBean("portletConfigAwareBean");
assertSame(portletContext, contextBean.getPortletContext());
assertSame(portlet.getPortletConfig(), configBean.getPortletConfig());