You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2004/10/22 02:50:08 UTC

svn commit: rev 55291 - in portals/pluto/trunk/testsuite/src: java/org/apache/pluto/portalImpl/portlet java/org/apache/pluto/portalImpl/portlet/test webapp/WEB-INF

Author: ddewolf
Date: Thu Oct 21 17:50:07 2004
New Revision: 55291

Modified:
   portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java
   portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java
   portals/pluto/trunk/testsuite/src/webapp/WEB-INF/portlet.xml
Log:
Update Testsuite:
-- Levergage GenericPortlet for view,help, and edit rendering.  This allows the appropriate title to be used (per the resource bundle)


Modified: portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java
==============================================================================
--- portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java	(original)
+++ portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java	Thu Oct 21 17:50:07 2004
@@ -43,17 +43,10 @@
 
 public class TestPortlet extends GenericPortlet {
 
-    private String portletName;
-
     private List configs;
     private Map tests;
 
     public void init() throws PortletException {
-        portletName = getInitParameter("display-name");
-        if(portletName==null) {
-            portletName = "Test Portlet";
-        }
-
         String configFile = getInitParameter("config");
         if(configFile==null) {
             configFile = "/WEB-INF/testsuite-config.xml";
@@ -119,8 +112,8 @@
         response.setRenderParameters(renderParameters);
     }
 
-    public void doDispatch(RenderRequest request,
-                           RenderResponse response)
+    public void doView(RenderRequest request,
+                       RenderResponse response)
     throws PortletException, IOException {
 
         String testId = getTestId(request);
@@ -131,11 +124,9 @@
         }
 
         PortletTest test = (PortletTest)tests.get(testId);
-        response.setTitle(portletName);
 
-        PortletMode mode = request.getPortletMode();
         WindowState state = request.getWindowState();
-        if (!state.equals(WindowState.MINIMIZED) && PortletMode.VIEW.equals(mode)) {
+        if (!state.equals(WindowState.MINIMIZED)) {
         	response.setContentType("text/html");
 
             if(test != null && !(test instanceof ActionTest) ) {
@@ -164,17 +155,26 @@
             }
             rd.include(request,response);
         }
+    }
+
 
-        else if(!state.equals(WindowState.MINIMIZED) && PortletMode.EDIT.equals(mode)) {
+    protected void doEdit(RenderRequest req, RenderResponse res)
+    throws PortletException, IOException {
+        WindowState state = req.getWindowState();
+        if(!state.equals(WindowState.MINIMIZED)) {
             PortletContext context = getPortletContext();
             PortletRequestDispatcher rd = context.getRequestDispatcher("/jsp/edit.jsp");
-            rd.include(request,response);
+            rd.include(req,res);
         }
+    }
 
-        else if(!state.equals(WindowState.MINIMIZED) && PortletMode.HELP.equals(mode)) {
+    protected void doHelp(RenderRequest req, RenderResponse res)
+    throws PortletException, IOException {
+        WindowState state = req.getWindowState();
+        if(!state.equals(WindowState.MINIMIZED)) {
             PortletContext context = getPortletContext();
             PortletRequestDispatcher rd = context.getRequestDispatcher("/jsp/help.jsp");
-            rd.include(request,response);
+            rd.include(req,res);
         }
     }
 

Modified: portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java
==============================================================================
--- portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java	(original)
+++ portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java	Thu Oct 21 17:50:07 2004
@@ -55,9 +55,6 @@
         res.setName("Get ResourceBundle Test");
         res.setDesc("Retrieves the resource bundle and ensures it's not null.");
 
-        System.out.println("req: "+req);
-        System.out.println("config: "+config);
-        System.out.println("locale: "+req.getLocale());
         ResourceBundle rb = config.getResourceBundle(req.getLocale());
         if(rb != null) {
             res.setReturnCode(TestResult.PASSED);

Modified: portals/pluto/trunk/testsuite/src/webapp/WEB-INF/portlet.xml
==============================================================================
--- portals/pluto/trunk/testsuite/src/webapp/WEB-INF/portlet.xml	(original)
+++ portals/pluto/trunk/testsuite/src/webapp/WEB-INF/portlet.xml	Thu Oct 21 17:50:07 2004
@@ -34,11 +34,6 @@
         </init-param>
 
         <init-param>
-            <name>display-name</name>
-            <value>Test Portlet #1</value>
-        </init-param>
-
-        <init-param>
 			<name>dummyName</name>
 			<value>dummyValue</value>
 		</init-param>
@@ -92,10 +87,6 @@
         <init-param>
             <name>config</name>
             <value>/WEB-INF/testsuite-2-config.xml</value>
-        </init-param>
-        <init-param>
-            <name>display-name</name>
-            <value>Test Portlet #2</value>
         </init-param>
         <init-param>
 			<name>dummyName</name>