Package javax.portlet

Examples of javax.portlet.PortletConfig


        return newMock(ApplicationGlobals.class);
    }

    public void testFoundInSubdir() throws Exception
    {
        PortletConfig config = newConfig("myportlet");
       
        WebContext context = newMock(WebContext.class);

        IApplicationSpecification specification = newSpecification();
View Full Code Here


        verify();
    }

    public void testFoundInRootDir() throws Exception
    {
        PortletConfig config = newConfig("myportlet");

        WebContext context = newMock(WebContext.class);

        IApplicationSpecification specification = newSpecification();
View Full Code Here

        verify();
    }

    public void testNotFound() throws Exception
    {
        PortletConfig config = newConfig("myportlet");

        WebContext context = newMock(WebContext.class);

        expect(context.getResource("/WEB-INF/myportlet/myportlet.application")).andReturn(null);
       
View Full Code Here

@Test
public class TestPortletWebActivator extends BasePortletWebTestCase
{
    public void testGetActivatorName()
    {
        PortletConfig config = newMock(PortletConfig.class);

        expect(config.getPortletName()).andReturn("portlet");
       
        replay();
       
        PortletWebActivator pwa = new PortletWebActivator(config);
       
View Full Code Here

        verify();
    }

    public void testGetInitParameterNames()
    {
        PortletConfig config = newMock(PortletConfig.class);

        expect(config.getInitParameterNames()).andReturn(newEnumeration());
       
        replay();

        PortletWebActivator pwa = new PortletWebActivator(config);
View Full Code Here

    public void testGetInitParameterValue()
    {
        String value = "William Orbit";
       
        PortletConfig config = newMock(PortletConfig.class);

        expect(config.getInitParameter("artist")).andReturn(value);
       
        replay();

        PortletWebActivator pwa = new PortletWebActivator(config);
View Full Code Here

        if (action instanceof PortletContextAware) {
            PortletContext portletContext = (PortletContext) context.get(STRUTS_PORTLET_CONTEXT);
            ((PortletContextAware) action).setPortletContext(portletContext);
        }
        if (action instanceof PortletConfigAware) {
          PortletConfig portletConfig = (PortletConfig)context.get(PORTLET_CONFIG);
          ((PortletConfigAware) action).setPortletConfig(portletConfig);
        }
        if (action instanceof PortletPreferencesAware) {
          PortletRequest request = (PortletRequest) context.get(REQUEST);
           
View Full Code Here

        Mock mockRd = mock(PortletRequestDispatcher.class);

        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
        ActionInvocation inv = (ActionInvocation)mockInvocation.proxy();

        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
View Full Code Here

        Mock mockRd = mock(PortletRequestDispatcher.class);

        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();

        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
        mockCtx.expects(once()).method("getRequestDispatcher").with(eq("/WEB-INF/pages/testPage.jsp")).will(returnValue(rd));
View Full Code Here

  }

  private Map<String, String> calculateDefaultViewIdMap() {
    Map<String, String> viewIdMap = new HashMap<String, String>();
    PortletConfig portletConfig = getPortletConfig();
    Enumeration<?> configNames = portletConfig.getInitParameterNames();
    while (configNames.hasMoreElements()) {
      String name = (String) configNames.nextElement();
      if (name.startsWith(DEFAULT_VIEWID)) {
        // Put viewId with mode name as key.
        viewIdMap.put(name.substring(DEFAULT_VIEW_ID_LENGTH),
            portletConfig.getInitParameter(name));
      }
    }
    return viewIdMap;
  }
View Full Code Here

TOP

Related Classes of javax.portlet.PortletConfig

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.