use of com.liferay.ide.portlet.core.model.Supports 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());
}
Aggregations