Search in sources :

Example 16 with IPortletType

use of org.apereo.portal.portlet.om.IPortletType in project uPortal by Jasig.

the class PortletAdministrationHelperTest method updateFormForSinglePortletTypeNoOpWhenMultiplePortletTypes.

/**
 * When there are multiple available portlet types, the method
 * updateFormForSinglePortletType(...) is a no-op returning null.
 *
 * <p>This test case verifies that the method returns null in this case.
 */
@Test
public void updateFormForSinglePortletTypeNoOpWhenMultiplePortletTypes() {
    PortletAdministrationHelper helper = new PortletAdministrationHelper();
    Map<IPortletType, PortletPublishingDefinition> portletDefinitions = new HashMap<>();
    IPortletType someType = new PortletTypeImpl("someType", "someUri");
    IPortletType someOtherType = new PortletTypeImpl("someOtherType", "someOtherUri");
    PortletPublishingDefinition someDefinition = new PortletPublishingDefinition();
    PortletPublishingDefinition someOtherDefinition = new PortletPublishingDefinition();
    portletDefinitions.put(someType, someDefinition);
    portletDefinitions.put(someOtherType, someOtherDefinition);
    PortletDefinitionForm form = new PortletDefinitionForm();
    assertNull(helper.updateFormForSinglePortletType(portletDefinitions, form));
}
Also used : PortletTypeImpl(org.apereo.portal.portlet.dao.jpa.PortletTypeImpl) IPortletType(org.apereo.portal.portlet.om.IPortletType) HashMap(java.util.HashMap) PortletPublishingDefinition(org.apereo.portal.portletpublishing.xml.PortletPublishingDefinition) Test(org.junit.Test)

Aggregations

IPortletType (org.apereo.portal.portlet.om.IPortletType)16 PortletPublishingDefinition (org.apereo.portal.portletpublishing.xml.PortletPublishingDefinition)7 Test (org.junit.Test)6 PortletDefinitionImpl (org.apereo.portal.portlet.dao.jpa.PortletDefinitionImpl)5 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)5 PortletTypeImpl (org.apereo.portal.portlet.dao.jpa.PortletTypeImpl)4 ArrayList (java.util.ArrayList)3 IPortletPreference (org.apereo.portal.portlet.om.IPortletPreference)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 PortletPreferenceImpl (org.apereo.portal.portlet.dao.jpa.PortletPreferenceImpl)2 IPortletDefinitionId (org.apereo.portal.portlet.om.IPortletDefinitionId)2 BasePortalJpaDaoTest (org.apereo.portal.test.BasePortalJpaDaoTest)2 PortletDescriptor (org.apereo.portal.xml.PortletDescriptor)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 BigInteger (java.math.BigInteger)1 Calendar (java.util.Calendar)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1