Search in sources :

Example 11 with PortletCategoryBean

use of org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean in project uPortal by Jasig.

the class PortletCategoryBeanTest method testHashCode.

@Test
public void testHashCode() {
    String id = "id_test";
    String name = "name_test";
    String desc = "desc_test";
    PortletCategoryBean pcb1 = buildTestPortletCategoryBean(id, name, desc);
    PortletCategoryBean pcb2 = buildTestPortletCategoryBean(id, name, desc);
    assertEquals(pcb1.hashCode(), pcb2.hashCode());
}
Also used : PortletCategoryBean(org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean) Test(org.junit.Test)

Example 12 with PortletCategoryBean

use of org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean in project uPortal by Jasig.

the class PortletCategoryBeanTest method testEqualsSelf.

@Test
public void testEqualsSelf() {
    PortletCategoryBean pcb1 = buildTestPortletCategoryBean("id1", "name1", "desc");
    assertTrue(pcb1.equals(pcb1));
}
Also used : PortletCategoryBean(org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean) Test(org.junit.Test)

Example 13 with PortletCategoryBean

use of org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean in project uPortal by Jasig.

the class PortletCategoryBeanTest method buildTestCategorySet.

private Set<PortletCategoryBean> buildTestCategorySet(String id, String name, String desc) {
    PortletCategory pc = new PortletCategory(id);
    pc.setName(name);
    pc.setDescription(desc);
    PortletCategoryBean pcb = PortletCategoryBean.fromPortletCategory(pc, null, null);
    Set<PortletCategoryBean> testCategorySet = new TreeSet<>();
    testCategorySet.add(pcb);
    return testCategorySet;
}
Also used : PortletCategoryBean(org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean) TreeSet(java.util.TreeSet) PortletCategory(org.apereo.portal.portlet.om.PortletCategory)

Example 14 with PortletCategoryBean

use of org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean in project uPortal by Jasig.

the class PortletCategoryBeanTest method testEqualsOtherObject.

@Test
public void testEqualsOtherObject() {
    PortletCategoryBean pcb1 = buildTestPortletCategoryBean("id1", "name1", "desc");
    assertFalse(pcb1.equals("id1"));
}
Also used : PortletCategoryBean(org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean) Test(org.junit.Test)

Example 15 with PortletCategoryBean

use of org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean in project uPortal by Jasig.

the class PortletCategoryBeanTest method testfromPortletCategoryNullSubCatsAndPortlets.

@Test
public void testfromPortletCategoryNullSubCatsAndPortlets() {
    String id = "id_test";
    String name = "id_test";
    String desc = "desc_test";
    PortletCategory pc = new PortletCategory(id);
    pc.setName(name);
    pc.setDescription(desc);
    PortletCategoryBean pcb = PortletCategoryBean.fromPortletCategory(pc, null, null);
    assertEquals(id, pcb.getId());
    assertEquals(name, pcb.getName());
    assertEquals(desc, pcb.getDescription());
    assertEquals(Collections.emptySet(), pcb.getPortlets());
    assertEquals(Collections.emptySet(), pcb.getSubcategories());
}
Also used : PortletCategoryBean(org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean) PortletCategory(org.apereo.portal.portlet.om.PortletCategory) Test(org.junit.Test)

Aggregations

PortletCategoryBean (org.apereo.portal.layout.dlm.remoting.registry.v43.PortletCategoryBean)16 Test (org.junit.Test)10 PortletCategory (org.apereo.portal.portlet.om.PortletCategory)5 HashSet (java.util.HashSet)4 TreeSet (java.util.TreeSet)4 PortletDefinitionBean (org.apereo.portal.layout.dlm.remoting.registry.v43.PortletDefinitionBean)4 SortedSet (java.util.SortedSet)3 TreeMap (java.util.TreeMap)3 EntityIdentifier (org.apereo.portal.EntityIdentifier)3 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)3 IAuthorizationPrincipal (org.apereo.portal.security.IAuthorizationPrincipal)3 Locale (java.util.Locale)2