KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portletcontainer > imp > TestPortletIoCComponent


1 package org.exoplatform.services.portletcontainer.imp;
2
3
4 import javax.portlet.PortletMode;
5 import javax.servlet.http.HttpServletResponse JavaDoc;
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 JavaDoc;
14
15 /**
16  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
17  * Please look at license.txt in info directory for more license detail.
18  **/

19
20 /**
21  * Created by the Exo Development team.
22  * Author : Mestrallet Benjamin
23  * benjmestrallet@users.sourceforge.net
24  * Date: 19 nov. 2003
25  * Time: 14:50:42
26  */

27 public class TestPortletIoCComponent extends BaseTest{
28
29     public TestPortletIoCComponent(String JavaDoc s) {
30         super(s);
31     }
32
33     public void testPortletAsIoCComponent() throws PortletContainerException {
34         MockServletRequest request = new MockServletRequest(new MockHttpSession(), Locale.US, true);
35         HttpServletResponse JavaDoc 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 JavaDoc[])aO.getRenderParameters().get("status"))[0]);
40     }
41 }
42
43
Popular Tags