use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testCompareToDiffEntityType.
@Test
public void testCompareToDiffEntityType() {
EntityEnum val1 = EntityEnum.GROUP;
EntityEnum val2 = EntityEnum.CATEGORY;
JsonEntityBean jeb1 = buildBeanFromEntityGroup();
jeb1.setEntityType(val1);
JsonEntityBean jeb2 = buildBeanFromEntityGroup();
jeb2.setEntityType(val2);
assertEquals(val1.compareTo(val2), jeb1.compareTo(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testConstructFromEntityGroup.
@Test
public void testConstructFromEntityGroup() {
JsonEntityBean jeb = buildBeanFromEntityGroup();
assertEquals(EntityEnum.PORTLET, jeb.getEntityType());
assertEquals(key, jeb.getId());
assertEquals(name, jeb.getName());
assertEquals(cId, jeb.getCreatorId());
assertEquals(desc, jeb.getDescription());
assertEquals(key, jeb.getTargetString());
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testConstructFromPortletCategory.
@Test
public void testConstructFromPortletCategory() {
String id = "local.74";
String name = "testName";
String cId = "testCreatorId";
String desc = "testDesc";
PortletCategory pc = new PortletCategory(id);
pc.setName(name);
pc.setCreatorId(cId);
pc.setDescription(desc);
JsonEntityBean jeb = new JsonEntityBean(pc);
assertEquals(EntityEnum.CATEGORY, jeb.getEntityType());
assertEquals(id, jeb.getId());
assertEquals(name, jeb.getName());
assertEquals(cId, jeb.getCreatorId());
assertEquals(desc, jeb.getDescription());
assertEquals(id, jeb.getTargetString());
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testEqualsDescDiff.
@Test
public void testEqualsDescDiff() {
String d1 = "asdf";
String d2 = "hjkl";
JsonEntityBean jeb1 = buildNullBean();
jeb1.setChildrenInitialized(true);
jeb1.setCreatorId("");
jeb1.setDescription(d1);
JsonEntityBean jeb2 = buildNullBean();
jeb2.setChildrenInitialized(true);
jeb2.setCreatorId("");
jeb2.setDescription(d2);
assertEquals(d1.equals(d2), jeb1.equals(jeb2));
}
use of org.apereo.portal.layout.dlm.remoting.JsonEntityBean in project uPortal by Jasig.
the class JsonEntityBeanTest method testCompareToDiffPrincipalString.
@Test
public void testCompareToDiffPrincipalString() {
String val1 = "asdf";
String val2 = "hjkl";
JsonEntityBean jeb1 = buildBeanFromEntityGroup();
jeb1.setPrincipalString(val1);
JsonEntityBean jeb2 = buildBeanFromEntityGroup();
jeb2.setPrincipalString(val2);
assertEquals(val1.compareTo(val2), jeb1.compareTo(jeb2));
}
Aggregations