1 5 6 package org.exoplatform.services.wsrp.testConsumer; 7 8 import org.exoplatform.services.wsrp.consumer.WSRPPortlet; 9 import org.exoplatform.services.wsrp.exceptions.WSRPException; 10 import org.exoplatform.services.wsrp.type.PortletContext; 11 12 18 19 public class TestPortletRegistry extends BaseTest{ 20 21 public void testAddPortlet() throws WSRPException { 22 PortletContext portletContext = new PortletContext(); 23 portletContext.setPortletHandle("hello/AppletClient"); 24 WSRPPortlet p = createPortlet("hello/AppletClient", null, portletContext); 25 portletRegistry.addPortlet(p); 26 assertTrue(portletRegistry.existsPortlet(p.getPortletKey())); 27 assertTrue(portletRegistry.getAllPortlets().hasNext()); 28 portletRegistry.removePortlet(p.getPortletKey()); 29 assertFalse(portletRegistry.getAllPortlets().hasNext()); 30 } 31 32 public void testRemoveAll() throws WSRPException { 33 PortletContext portletContext = new PortletContext(); 34 portletContext.setPortletHandle("hello/AppletClient"); 35 WSRPPortlet p = createPortlet("hello/AppletClient", null, portletContext); 36 portletRegistry.addPortlet(p); 37 portletRegistry.removeAllPortlets(); 38 assertFalse(portletRegistry.getAllPortlets().hasNext()); 39 } 40 41 } | Popular Tags |