1 package org.exoplatform.services.portletcontainer.imp; 2 3 4 import javax.portlet.PortletMode; 5 import javax.servlet.http.HttpServletResponse ; 6 import org.exoplatform.services.portletcontainer.PortletContainerException; 7 import org.exoplatform.services.portletcontainer.impl.portletAPIImp.pool.EmptyResponse; 8 import org.exoplatform.services.portletcontainer.pci.ActionOutput; 9 import org.exoplatform.services.portletcontainer.pci.ExoWindowID; 10 import org.exoplatform.test.mocks.servlet.MockHttpSession; 11 import org.exoplatform.test.mocks.servlet.MockServletRequest; 12 import org.exoplatform.test.mocks.servlet.MockServletResponse; 13 import java.util.Locale ; 14 15 19 20 27 public class TestPortletIoCComponent extends BaseTest{ 28 29 public TestPortletIoCComponent(String s) { 30 super(s); 31 } 32 33 public void testPortletAsIoCComponent() throws PortletContainerException { 34 MockServletRequest request = new MockServletRequest(new MockHttpSession(), Locale.US, true); 35 HttpServletResponse response = new MockServletResponse(new EmptyResponse()); 36 ((ExoWindowID)actionInput.getWindowID()).setPortletName("PortletToTestIoC"); 37 actionInput.setPortletMode(new PortletMode("config")); 38 ActionOutput aO = portletContainer.processAction(request, response, actionInput); 39 assertEquals("Everything is ok", ((String [])aO.getRenderParameters().get("status"))[0]); 40 } 41 } 42 43 | Popular Tags |