Package org.springframework.web.portlet.context

Examples of org.springframework.web.portlet.context.PortletContextAwareBean


  public void testDispatcherPortletRefresh() 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);

    portlet.refresh();

    PortletContextAwareBean contextBean2 = (PortletContextAwareBean)
        portlet.getPortletApplicationContext().getBean("portletContextAwareBean");
    PortletConfigAwareBean configBean2 = (PortletConfigAwareBean)
        portlet.getPortletApplicationContext().getBean("portletConfigAwareBean");
    assertSame(portletContext, contextBean.getPortletContext());
    assertSame(portlet.getPortletConfig(), configBean.getPortletConfig());
View Full Code Here


  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());
View Full Code Here

  public void testDispatcherPortletRefresh() 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);

    portlet.refresh();

    PortletContextAwareBean contextBean2 = (PortletContextAwareBean)
        portlet.getPortletApplicationContext().getBean("portletContextAwareBean");
    PortletConfigAwareBean configBean2 = (PortletConfigAwareBean)
        portlet.getPortletApplicationContext().getBean("portletConfigAwareBean");
    assertSame(portletContext, contextBean.getPortletContext());
    assertSame(portlet.getPortletConfig(), configBean.getPortletConfig());
View Full Code Here

  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());
View Full Code Here

TOP

Related Classes of org.springframework.web.portlet.context.PortletContextAwareBean

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.