Search in sources :

Example 1 with Param

use of com.liferay.ide.portlet.core.model.Param in project liferay-ide by liferay.

the class PortletXmlTests method portletXmlRead.

@Test
public void portletXmlRead() throws Exception {
    final PortletApp portletApp = portletApp(PORTLET_XML);
    assertNotNull(portletApp);
    final ElementList<Portlet> portlets = portletApp.getPortlets();
    assertNotNull(portlets);
    assertEquals(1, portlets.size());
    final Portlet portlet = portlets.get(0);
    assertNotNull(portlet);
    assertEquals("1", portlet.getPortletName().content());
    assertEquals("Sample JSP", portlet.getDisplayName().content());
    assertEquals("com.liferay.samplejsp.portlet.JSPPortlet", portlet.getPortletClass().text());
    final Param param = portlet.getInitParams().get(0);
    assertNotNull(param);
    assertEquals("view-jsp", param.getName().content());
    assertEquals("/view.jsp", param.getValue().content());
    assertEquals(new Integer(0), portlet.getExpirationCache().content());
    final Supports supports = portlet.getSupports();
    assertNotNull(supports);
    assertEquals("text/html", supports.getMimeType().content());
    final PortletInfo info = portlet.getPortletInfo();
    assertEquals("Sample JSP", info.getTitle().content());
    assertEquals("Sample JSP", info.getShortTitle().content());
    assertEquals("Sample JSP", info.getKeywords().content());
    final ElementList<SecurityRoleRef> roles = portlet.getSecurityRoleRefs();
    assertEquals(4, roles.size());
    final SecurityRoleRef role = roles.get(1);
    assertNotNull(role);
    assertEquals("guest", role.getRoleName().content());
}
Also used : Portlet(com.liferay.ide.portlet.core.model.Portlet) Supports(com.liferay.ide.portlet.core.model.Supports) Param(com.liferay.ide.portlet.core.model.Param) PortletInfo(com.liferay.ide.portlet.core.model.PortletInfo) SecurityRoleRef(com.liferay.ide.portlet.core.model.SecurityRoleRef) PortletApp(com.liferay.ide.portlet.core.model.PortletApp) Test(org.junit.Test)

Aggregations

Param (com.liferay.ide.portlet.core.model.Param)1 Portlet (com.liferay.ide.portlet.core.model.Portlet)1 PortletApp (com.liferay.ide.portlet.core.model.PortletApp)1 PortletInfo (com.liferay.ide.portlet.core.model.PortletInfo)1 SecurityRoleRef (com.liferay.ide.portlet.core.model.SecurityRoleRef)1 Supports (com.liferay.ide.portlet.core.model.Supports)1 Test (org.junit.Test)1