portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r226395 [12/14] - in /portals/pluto/branches/pluto-1.1: ./ binding/ binding/src/java/org/apache/pluto/binding/ binding/src/java/org/apache/pluto/binding/impl/digester/ binding/src/java/org/apache/pluto/binding/util/ binding/src/resources/or...
Date Fri, 29 Jul 2005 16:43:41 GMT
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/pluto-portal-driver-config.xml Fri Jul 29 09:40:51 2005
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+
+<pluto-portal-driver
+  xmlns="http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://portals.apache.org/pluto/xsd/pluto-portal-driver.config.xsd
+                      http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd"
+  version="1.1">
+
+    <portal-name>pluto-portal-driver</portal-name>
+    <portal-version>1.1-ALPHA</portal-version>
+    <container-name>Pluto Portal Driver</container-name>
+
+    <supports>
+        <portlet-mode>view</portlet-mode>
+        <portlet-mode>edit</portlet-mode>
+        <portlet-mode>help</portlet-mode>
+        <portlet-mode>config</portlet-mode>
+
+        <window-state>normal</window-state>
+        <window-state>maximized</window-state>
+        <window-state>minimized</window-state>
+    </supports>
+
+    <portlet-app>
+        <context-path>/testsuite</context-path>
+        <portlets>
+            <portlet name="TestPortlet1"/>
+            <portlet name="TestPortlet2"/>
+        </portlets>
+    </portlet-app>
+
+    <render-config default="Test Page">
+        <page name="Test Page" uri="/WEB-INF/fragments/portlet.jsp">
+            <portlet context="/testsuite" name="TestPortlet1"/>
+            <portlet context="/testsuite" name="TestPortlet2"/>
+        </page>
+        <page name="Secondary Page" uri="/WEB-INF/fragments/portlet.jsp">
+            <portlet context="/testsuite" name="TestPortlet1"/>
+            <portlet context="/testsuite" name="TestPortlet2"/>
+        </page>
+        <page name="About Pluto" uri="/WEB-INF/fragments/about.jsp"/>
+    </render-config>
+</pluto-portal-driver>
\ No newline at end of file

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/pluto.tld
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/pluto.tld?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/pluto.tld (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/pluto.tld Fri Jul 29 09:40:51 2005
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!-- 
+Copyright 2004 The Apache Software Foundation.
+Licensed  under the  Apache License,  Version 2.0  (the "License");
+you may not use  this file  except in  compliance with the License.
+You may obtain a copy of the License at 
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<taglib>
+    <tlibversion>1.0</tlibversion>
+    <jspversion>1.1</jspversion>
+    <shortname>pluto</shortname>
+    <uri>http://portals.apache.org/pluto</uri>
+
+    <!-- Insert the rendering of a portlet -->
+    <tag>
+        <name>portlet</name>
+        <tagclass>org.apache.pluto.driver.tags.PortletTag</tagclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>portletId</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+
+    <tag>
+        <name>title</name>
+        <tagclass>org.apache.pluto.driver.tags.PortletTitleTag</tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+
+    <tag>
+        <name>window</name>
+        <tagclass>org.apache.pluto.driver.tags.PortletWindowControlTag</tagclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>portletMode</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>windowState</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+    </tag>
+
+    <tag>
+        <name>render</name>
+        <tagclass>org.apache.pluto.driver.tags.PortletRenderTag</tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+
+
+</taglib>
\ No newline at end of file

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/portlet.tld
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/portlet.tld?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/portlet.tld (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/tld/portlet.tld Fri Jul 29 09:40:51 2005
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!-- 
+Copyright 2004 The Apache Software Foundation.
+Licensed  under the  Apache License,  Version 2.0  (the "License");
+you may not use  this file  except in  compliance with the License.
+You may obtain a copy of the License at 
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<taglib>
+    <tlibversion>1.0</tlibversion>
+    <jspversion>1.1</jspversion>
+    <shortname>portlet</shortname>
+    <uri>http://java.sun.com/portlet</uri>
+    <tag>
+        <name>defineObjects</name>
+        <tagclass>org.apache.pluto.tags.DefineObjectsTag</tagclass>
+        <teiclass>org.apache.pluto.tags.DefineObjectsTag$TEI</teiclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+    <tag>
+        <name>param</name>
+        <tagclass>org.apache.pluto.tags.ParamTag</tagclass>
+        <bodycontent>empty</bodycontent>
+        <attribute>
+            <name>name</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>value</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>actionURL</name>
+        <tagclass>org.apache.pluto.tags.ActionURLTag</tagclass>
+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>windowState</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>portletMode</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>secure</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>var</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>renderURL</name>
+        <tagclass>org.apache.pluto.tags.RenderURLTag</tagclass>
+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>windowState</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>portletMode</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>secure</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>var</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>namespace</name>
+        <tagclass>org.apache.pluto.tags.NamespaceTag</tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+</taglib>
\ No newline at end of file

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/web.xml?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/web.xml (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/WEB-INF/web.xml Fri Jul 29 09:40:51 2005
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+           "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!-- 
+Copyright 2004 The Apache Software Foundation.
+Licensed  under the  Apache License,  Version 2.0  (the "License");
+you may not use  this file  except in  compliance with the License.
+You may obtain a copy of the License at 
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<web-app>
+
+    <display-name>Pluto Reference Implementation</display-name>
+
+    <servlet>
+        <servlet-name>plutoPortalDriver</servlet-name>
+        <display-name>Pluto Portal Driver</display-name>
+        <description>Pluto Portal Driver Controller</description>
+        <servlet-class>org.apache.pluto.driver.PortalDriverServlet</servlet-class>
+    </servlet>
+
+    <servlet>
+        <servlet-name>tckDriver</servlet-name>
+        <display-name>Pluto TCK Driver</display-name>
+        <description>Pluto TCK Driver Controller</description>
+        <servlet-class>org.apache.pluto.driver.TCKDriverServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>plutoPortalDriver</servlet-name>
+        <url-pattern>/portal/*</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>tckDriver</servlet-name>
+        <url-pattern>/tck/*</url-pattern>
+    </servlet-mapping>
+
+    <listener>
+        <listener-class>org.apache.pluto.driver.PortalStartupListener</listener-class>
+    </listener>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name></web-resource-name>
+            <url-pattern>/login_success.jsp</url-pattern>
+            <http-method>GET</http-method>
+            <http-method>POST</http-method>
+            <http-method>PUT</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>tomcat</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <login-config>
+        <auth-method>BASIC</auth-method>
+    </login-config>
+
+    <security-role>
+        <role-name>tomcat</role-name>
+    </security-role>
+
+    <taglib>
+        <taglib-uri>http://java.sun.com/portlet</taglib-uri>
+        <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>
+    </taglib>
+
+    <taglib>
+        <taglib-uri>http://portals.apache.org/pluto</taglib-uri>
+        <taglib-location>/WEB-INF/tld/pluto.tld</taglib-location>
+    </taglib>
+
+</web-app>
+

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/images/pluto.png
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/images/pluto.png?rev=226395&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/images/pluto.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/index.jsp?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/index.jsp (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/index.jsp Fri Jul 29 09:40:51 2005
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/login_success.jsp
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/login_success.jsp?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/login_success.jsp (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/login_success.jsp Fri Jul 29 09:40:51 2005
@@ -0,0 +1,6 @@
+<HTML>
+<HEAD><TITLE>Login Successful</TITLE></HEAD>
+<BODY>
+Login Successfull. <a href="<%=request.getContextPath()%>/portal/test"> Click here to return to the portal tests.</A>
+</BODY>
+</HTML>
\ No newline at end of file

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/pluto_style.css
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/pluto_style.css?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/pluto_style.css (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/pluto_style.css Fri Jul 29 09:40:51 2005
@@ -0,0 +1,48 @@
+BODY, P, TH, TD {
+    font-family: arial, helvetica, sans-serif;
+    text-align: left;
+}
+
+.BODY, .P, .TD {
+    font-size: 12px;
+}
+
+TABLE {
+    width: 100%;
+    padding: 2px 3px;
+    border-collapse:collapse;
+    border-spacing: 3px 3px;
+}
+
+
+.banner, .banner TD, .banner A:link, .banner A:visited, .banner A:hover {
+    background-color: #DDDDDD;
+    color: #36a;
+}
+
+.banner-highlight, .banner-highlight TD {
+    background-color: #003366;
+    color: #ffffff;
+    height: 2px;
+}
+
+.tab TD, .tab A:link, .tab A:visited, .tab A:hover {
+    background-color: #DDDDDD;
+    color: #36a;
+}
+
+.tab-selected, .tab-selected TD, .tab-selected A:link, .tab-selected A:visited, .tab-selected A:hover {
+    background-color: #003366;
+    color: ffffff#;
+}
+
+TABLE.portlet {
+    border-collapse: seperated;
+    border-width: 2px;
+    border-color: #DDDDDD;
+}
+
+.small {
+    font-size: -1;
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/test_session.jsp
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/test_session.jsp?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/test_session.jsp (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/webapp/test_session.jsp Fri Jul 29 09:40:51 2005
@@ -0,0 +1,4 @@
+<%
+    RequestDispatcher rd = application.getContext("/testsuite").getRequestDispatcher("/test_session.jsp");
+    rd.forward(request, response);
+%>
\ No newline at end of file

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/pom.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/pom.xml?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/pom.xml (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/pom.xml Fri Jul 29 09:40:51 2005
@@ -0,0 +1,65 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.pluto</groupId>
+  <artifactId>pluto-testsuite</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>Pluto Testsuite Portlet</name>
+  <url>http://portals.apache.org/pluto</url>
+  <parent>
+    <groupId>org.apache.pluto</groupId>
+	<artifactId>pluto</artifactId>
+	<version>1.1-SNAPSHOT</version>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+	<dependency>
+      <groupId>commons-digester</groupId>
+	  <artifactId>commons-digester</artifactId>
+	  <version>1.7</version>
+	  <scope>compile</scope>
+    </dependency>
+	<dependency>
+      <groupId>portlet-api</groupId>
+	  <artifactId>portlet-api</artifactId>
+	  <version>1.0</version>
+	  <scope>provided</scope>
+    </dependency>
+	<dependency>
+      <groupId>servletapi</groupId>
+	  <artifactId>servletapi</artifactId>
+	  <version>2.3</version>
+	  <scope>provided</scope>
+    </dependency>
+	<dependency>
+      <groupId>jstl</groupId>
+	  <artifactId>jstl</artifactId>
+	  <version>1.1.2</version>
+	  <scope>compile</scope>
+    </dependency>
+	<dependency>
+      <groupId>taglibs</groupId>
+	  <artifactId>standard</artifactId>
+	  <version>1.0.4</version>
+	  <scope>compile</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <finalName>pluto-testsuite</finalName>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <configuration>
+          <descriptor>src/assemble/bin.xml</descriptor>
+          <finalName>pluto-testsuite-1.1-SNAPSHOT</finalName>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/assemble/bin.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/assemble/bin.xml?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/assemble/bin.xml (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/assemble/bin.xml Fri Jul 29 09:40:51 2005
@@ -0,0 +1,28 @@
+<assembly>
+  <id>bin</id>
+  <formats>
+    <format>tar.gz</format>
+    <format>tar.bz2</format>
+    <format>zip</format>
+  </formats>
+  <fileSets>
+    <fileSet>
+      <includes>
+        <include>README*</include>
+        <include>LICENSE*</include>
+        <include>NOTICE*</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>target</directory>
+      <outputDirectory></outputDirectory>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+  <dependencySets>
+
+  </dependencySets>
+</assembly>
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/core/impl/PreferencesValidatorImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/core/impl/PreferencesValidatorImpl.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/core/impl/PreferencesValidatorImpl.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/core/impl/PreferencesValidatorImpl.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* 
+
+ */
+
+package org.apache.pluto.core.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ValidatorException;
+
+public class PreferencesValidatorImpl implements PreferencesValidator
+{
+
+    public PreferencesValidatorImpl()
+    {
+    }
+
+    public void validate(PortletPreferences preferences)
+        throws ValidatorException
+    {
+      Collection failedKeys = new ArrayList();
+      Enumeration names = preferences.getNames();
+
+      String[] defValues = {"no values"};
+      String[] values = null;
+      String key = null;
+
+      while (names.hasMoreElements())
+      {
+          key = names.nextElement().toString();
+          values = preferences.getValues(key, defValues);
+
+          if (values != null) // null values are allowed
+          {
+              for (int i=0; i<values.length;i++)
+              {
+                  if (values[i] != null) // null values are allowed
+                  {
+                      //validates that the preferences do not start or end with white space
+                      if (!values[i].equalsIgnoreCase(values[i].trim()))
+                      {
+                          failedKeys.add(key);
+                          i=values.length;
+                      }
+                  }
+              }
+          }
+      }
+
+      if (!failedKeys.isEmpty())
+      {
+          throw new ValidatorException("One or more preferences do not comply with the validation criteria",failedKeys);
+      }
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfig.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfig.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfig.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfig.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * TestPortlet Configuration.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Sep 15, 2004
+ */
+public class TestConfig {
+
+    private String testClassName;
+    private String name;
+    private String displayURI;
+    private Map initParams = new java.util.HashMap();
+    private Map actionParameters = new java.util.HashMap();
+    private Map renderParameters = new java.util.HashMap();
+
+    public TestConfig() {
+
+    }
+
+    public String getTestClassName() {
+        return testClassName;
+    }
+
+    public void setTestClassName(String testClassName) {
+        this.testClassName = testClassName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String testName) {
+        this.name = testName;
+    }
+
+    public String getDisplayURI() {
+        return displayURI;
+    }
+
+    public void setDisplayURI(String displayURI) {
+        this.displayURI = displayURI;
+    }
+
+    public void addInitParameter(String parameter, String value) {
+        this.initParams.put(parameter, value);
+    }
+
+    public Map getInitParameters() {
+        return Collections.unmodifiableMap(initParams);
+    }
+
+    public void addActionParameter(String parameter, String value) {
+        this.actionParameters.put(parameter, value);
+    }
+
+    public Map getActionParameters() {
+        return Collections.unmodifiableMap(actionParameters);
+    }
+
+    public void addRenderParameter(String parameter, String value) {
+        this.renderParameters.put(parameter, value);
+    }
+
+    public Map getRenderParameters() {
+        return Collections.unmodifiableMap(renderParameters);
+    }
+
+    public String toString() {
+        return super.toString()+"<"+getName()+">";
+    }
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfigFactory.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfigFactory.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfigFactory.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestConfigFactory.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.commons.digester.Digester;
+import org.xml.sax.SAXException;
+
+/**
+ * @author <a href="ddewolf@apache.com">David H. DeWolf</a>
+ *
+ */
+public class TestConfigFactory {
+
+    private Digester digester = new Digester();
+
+    public TestConfigFactory() {
+        digester = new Digester();
+        digester.addObjectCreate("testportlet-config",
+                                 java.util.ArrayList.class);
+
+
+        digester.addObjectCreate("testportlet-config/testsuite-config",
+                                 TestConfig.class);
+
+        digester.addBeanPropertySetter("testportlet-config/testsuite-config/name",
+                                       "name");
+
+        digester.addBeanPropertySetter("testportlet-config/testsuite-config/class",
+                                       "testClassName");
+
+        digester.addBeanPropertySetter("testportlet-config/testsuite-config/display-uri",
+                                       "displayURI");
+
+        digester.addCallMethod("testportlet-config/testsuite-config/init-param", "addInitParameter", 2);
+        digester.addCallParam("testportlet-config/testsuite-config/init-param/name", 0);
+        digester.addCallParam("testportlet-config/testsuite-config/init-param/value", 1);
+
+        digester.addCallMethod("testportlet-config/testsuite-config/action-param", "addActionParameter", 2);
+        digester.addCallParam("testportlet-config/testsuite-config/action-param/name", 0);
+        digester.addCallParam("testportlet-config/testsuite-config/action-param/value", 1);
+
+        digester.addCallMethod("testportlet-config/testsuite-config/render-param", "addRenderParameter", 2);
+        digester.addCallParam("testportlet-config/testsuite-config/render-param/name", 0);
+        digester.addCallParam("testportlet-config/testsuite-config/render-param/value", 1);
+
+        digester.addSetRoot("testportlet-config/testsuite-config",
+                            "add");
+
+    }
+
+    public List createTests(InputStream in)
+    throws SAXException, IOException {
+        return (List)digester.parse(in);
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/TestPortlet.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* 
+
+ */
+
+package org.apache.pluto.portalImpl.portlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.pluto.portalImpl.portlet.test.ActionTest;
+import org.apache.pluto.portalImpl.portlet.test.NoOpTest;
+import org.apache.pluto.portalImpl.portlet.test.PortletTest;
+import org.apache.pluto.portalImpl.portlet.test.TestResults;
+
+public class TestPortlet extends GenericPortlet {
+
+    private List configs;
+    private Map tests;
+
+    public void init() throws PortletException {
+        String configFile = getInitParameter("config");
+        if(configFile==null) {
+            configFile = "/WEB-INF/testsuite-config.xml";
+        }
+
+        InputStream in = getPortletContext().getResourceAsStream(configFile);
+        if( in !=null ) {
+            TestConfigFactory fact = new TestConfigFactory();
+            try {
+                configs = fact.createTests(in);
+                tests = new HashMap();
+                Iterator it = configs.iterator();
+                int i = 0;
+                while(it.hasNext()) {
+                    TestConfig config = (TestConfig)it.next();
+                    String name=  config.getTestClassName();
+                    PortletTest test = null;
+                    if(name != null) {
+                        Class cl = Class.forName(config.getTestClassName());
+                        test = (PortletTest)cl.newInstance();
+                    }
+                    else {
+                        test = new NoOpTest();
+                    }
+                    test.init(config);
+                    tests.put(String.valueOf(i++), test);
+                }
+            }
+            catch (Throwable t) {
+                throw new PortletException("Unable to read configuration", t);
+            }
+        }
+        else {
+            throw new IllegalStateException("Configuration File Not Found");
+        }
+    }
+
+
+    public void processAction (ActionRequest request,
+                               ActionResponse response)
+    throws PortletException, java.io.IOException {
+
+        String testId = getTestId(request);
+        PortletTest test = (PortletTest)tests.get(testId);
+
+        if(test!=null && test instanceof ActionTest) {
+            TestResults results = test.doTest(getPortletConfig(),
+                                              getPortletContext(),
+                                              request, response);
+            request.getPortletSession().setAttribute(test.getClass().getName(), results);
+        }
+        Map renderParameters = null;
+
+        if(test!=null) {
+            renderParameters = test.getRenderParameters(request);
+        }
+
+        if(renderParameters==null) {
+            renderParameters = new java.util.HashMap();
+        }
+
+        renderParameters.put("testId", new String[] {testId});
+        response.setRenderParameters(renderParameters);
+    }
+
+    public void doView(RenderRequest request,
+                       RenderResponse response)
+    throws PortletException, IOException {
+
+        String testId = getTestId(request);
+
+        TestConfig config = null;
+        if(testId != null) {
+            config = (TestConfig)configs.get(Integer.parseInt(testId));
+        }
+
+        PortletTest test = (PortletTest)tests.get(testId);
+
+        WindowState state = request.getWindowState();
+        if (!state.equals(WindowState.MINIMIZED)) {
+        	response.setContentType("text/html");
+
+            if(test != null && !(test instanceof ActionTest) ) {
+                TestResults results = test.doTest(getPortletConfig(),
+                                                  getPortletContext(),
+                                                  request, response);
+                request.setAttribute("results", results);
+            }
+            else if(test != null) {
+                PortletSession session = request.getPortletSession();
+                TestResults results = (TestResults)session.getAttribute(test.getClass().getName());
+                request.setAttribute("results", results);
+            }
+
+            if(testId == null) {
+                request.setAttribute("tests", configs);
+            }
+            else {
+                TestConfig next = null;
+                TestConfig prev = null;
+                int index = configs.indexOf(test.getConfig());
+                if(index==0) {
+                    prev = (TestConfig)configs.get(configs.size()-1);
+                    next = (TestConfig)configs.get(index+1);
+                }
+                else if(index == configs.size()-1) {
+                    prev = (TestConfig)configs.get(index-1);
+                    next = (TestConfig)configs.get(0);
+                }
+                else {
+                    prev = (TestConfig)configs.get(index-1);
+                    next = (TestConfig)configs.get(index+1);
+                }
+                request.setAttribute("prevTest", prev);
+                request.setAttribute("nextTest", next);
+            }
+
+            PortletContext context = getPortletContext();
+            PortletRequestDispatcher rd = null;
+            if(config != null) {
+                rd = context.getRequestDispatcher(config.getDisplayURI());
+            }
+            else {
+                rd = context.getRequestDispatcher("/jsp/introduction.jsp");
+            }
+            rd.include(request,response);
+        }
+    }
+
+
+    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(req,res);
+        }
+    }
+
+    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(req,res);
+        }
+    }
+
+    private String getTestId(PortletRequest req) {
+        String testId =   req.getParameter("testId");
+        String previous = req.getParameter("previousTestId");
+        String next     = req.getParameter("nextTestId");
+
+        if((testId == null || testId.trim().length()==0)
+           && next == null && previous == null && tests.size() > 0) {
+            return null;
+        }
+        // Retrieve the test which is next to the previous
+        else if(testId == null && previous !=null) {
+            int pId = Integer.parseInt(previous);
+            if(pId >= configs.size()-1) {
+                testId = "0";
+            }
+            else {
+                testId = String.valueOf(pId+1);
+            }
+        }
+        // Retrieve the test which is previous to the next
+        else if(testId == null && next !=null) {
+            int nId = Integer.parseInt(next);
+            if(nId <= 0) {
+                testId = String.valueOf(configs.size()-1);
+            }
+            else {
+                testId = String.valueOf(nId - 1);
+            }
+        }
+
+        return testId;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/AbstractReflectivePortletTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/AbstractReflectivePortletTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/AbstractReflectivePortletTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/AbstractReflectivePortletTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletSession;
+
+import org.apache.pluto.portalImpl.portlet.TestConfig;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public abstract class AbstractReflectivePortletTest implements PortletTest {
+
+    private Map initParameters;
+    private TestConfig config;
+
+    public TestResults doTest(PortletConfig config,
+                              PortletContext context,
+                              PortletRequest req,
+                              PortletResponse res) {
+        TestResults results = new TestResults(getTestSuiteName());
+        
+        Class klass = getClass();
+        Method[] methods = klass.getDeclaredMethods();
+
+        for(int i = 0; i<methods.length;i++) {
+            if(methods[i].getName().startsWith("check")) {
+                try {
+                    results.add(invoke(methods[i], config, context, req, res));
+                }
+                catch(Exception e) {
+                    e.printStackTrace();
+                    TestResult result = new TestResult();
+                    result.setName(methods[i].getName());
+                    result.setDesc("Unknown");
+                    result.setReturnCode(TestResult.FAILED);
+                    result.setResults(e.getMessage());
+                    results.add(result);
+                }
+            }
+        }
+        return results;
+    }
+
+    public void init(TestConfig config) {
+        this.initParameters = config.getInitParameters();
+        this.config = config;
+    }
+
+    private TestResult invoke(Method method, PortletConfig config,
+                             PortletContext context,
+                             PortletRequest req, PortletResponse res)
+    throws IllegalAccessException, InvocationTargetException {
+
+        TestResult result = null;
+        Class[] paramTypes= method.getParameterTypes();
+        Object[] paramValues = new Object[paramTypes.length];
+
+        for(int i=0;i<paramTypes.length;i++) {
+            if(paramTypes[i].equals(PortletContext.class)) {
+                paramValues[i] = context;
+            }
+            if(paramTypes[i].equals(PortletRequest.class)) {
+                paramValues[i] = req;
+            }
+            if(paramTypes[i].equals(PortletResponse.class)) {
+                paramValues[i] = res;
+            }
+            if(paramTypes[i].equals(PortletSession.class)) {
+                paramValues[i] = req.getPortletSession();
+            }
+            if(paramTypes[i].equals(PortletConfig.class)) {
+                paramValues[i] = config;
+            }
+        }
+        result = (TestResult)method.invoke(this, paramValues);
+        return result;
+    }
+
+    public Map getRenderParameters(PortletRequest req) {
+        Map map = new java.util.HashMap();
+        return map;
+    }
+
+    public Map getInitParameters() {
+        return initParameters;
+    }
+
+    public TestConfig getConfig() {
+        return config;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionAbstractReflectivePortletTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionAbstractReflectivePortletTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionAbstractReflectivePortletTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionAbstractReflectivePortletTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public abstract class ActionAbstractReflectivePortletTest
+ extends AbstractReflectivePortletTest
+ implements ActionTest {
+
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ActionTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.portalImpl.portlet.test;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public interface ActionTest extends PortletTest {
+
+
+
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ComplexAttributeTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ComplexAttributeTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ComplexAttributeTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ComplexAttributeTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.Map;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class ComplexAttributeTest extends AbstractReflectivePortletTest {
+
+    private static final String BOGUS_KEY = "org.apache.pluto.testsuite.BOGUS_KEY";
+    private static final String KEY = "org.apache.pluto.testsuite.KEY";
+    private static final String VAL = "VALUE";
+
+    public String getTestSuiteName() {
+        return "Complex Attribute Test";
+    }
+
+    public Map doPrerequisiteAction(PortletContext context, ActionRequest req,
+                                    ActionResponse res) {
+        return new java.util.HashMap();
+    }
+
+    protected TestResult checkGetEmptyApplicationScopedAttribute(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("Get Empty Application Scoped Attribute Test");
+        res.setDesc("Retrieve an attribute that has not been set in the session's application scope and ensure it's value is null.");
+
+        Object val = session.getAttribute(BOGUS_KEY, PortletSession.APPLICATION_SCOPE);
+        if(val == null) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Retrieved attribute value '"+val+"'; expected null.");
+        }
+        return res;
+    }
+
+    protected TestResult checkSetApplicationScopedAttribute(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("Set Application Scoped Attribute Test");
+        res.setDesc("Set an application scoped session attribute and ensure it's retrievable");
+
+        session.setAttribute(KEY, VAL, PortletSession.APPLICATION_SCOPE);
+
+        Object val = session.getAttribute(KEY, PortletSession.APPLICATION_SCOPE);
+        if(VAL.equals(val)) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Retrieved attribute value '"+val+"'; expected '"+VAL+"'");
+        }
+        return res;
+    }
+
+    protected TestResult checkRemoveApplicationScopedAttribute(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("Remove Application Scoped Attribute Test");
+        res.setDesc("Remove an application scoped session attribute and ensure it's null.");
+
+        session.setAttribute(KEY, VAL, PortletSession.APPLICATION_SCOPE);
+        session.removeAttribute(KEY, PortletSession.APPLICATION_SCOPE);
+        Object val = session.getAttribute(KEY, PortletSession.APPLICATION_SCOPE);
+        if(null == val) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Retrieved attribute value '"+val+"'; expected null.");
+        }
+        return res;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ContextInitParameterTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ContextInitParameterTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ContextInitParameterTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ContextInitParameterTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.Enumeration;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Sep 15, 2004
+ */
+public class ContextInitParameterTest extends AbstractReflectivePortletTest  {
+    private static final String TEST_PARAM_NAME = "test-parameter-name";
+    private static final String TEST_PARAM_VAL = "test-parameter-val";
+
+    public ContextInitParameterTest() {
+
+    }
+
+    public String getTestSuiteName() {
+        return "Context Init Parameter Test";
+    }
+
+    protected TestResult checkEnumerationContainsElements(PortletContext ctx) {
+        TestResult res = new TestResult();
+        res.setName("Get Init Parameter Enumeration Test");
+        res.setDesc("Test the initialization parameter enumeration.");
+
+        Enumeration enumerator= ctx.getInitParameterNames();
+        if (enumerator.hasMoreElements()) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("No init parameters found.");
+        }
+        return res;
+    }
+
+    protected TestResult checkEnumerationContainsNames(PortletContext ctx) {
+        TestResult res = new TestResult();
+        res.setName("Init Parameter Names in Enumeration Test");
+        res.setDesc("Test to make sure that the expected init parameters exist.");
+
+        boolean found = false;
+        Enumeration enumerator= ctx.getInitParameterNames();
+        while(enumerator.hasMoreElements()) {
+            String name = (String)enumerator.nextElement();
+            if(TEST_PARAM_NAME.equals(name)) {
+                found = true;
+            }
+        }
+
+        if(found) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected init parameter '"+TEST_PARAM_NAME+"' no found.");
+        }
+
+        return res;
+    }
+
+    protected TestResult checkGetInitParameter(PortletContext context) {
+        TestResult res = new TestResult();
+        res.setName("Init Parameter Retrieved Test");
+        res.setDesc("Test to make sure that init parameters are successfully retrieved.");
+
+        String val = context.getInitParameter(TEST_PARAM_NAME);
+        if(TEST_PARAM_VAL.equals(val)) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected value not found for key '"+TEST_PARAM_NAME+"'.  Found '"+TEST_PARAM_VAL+"'");
+        }
+        return res;
+    }
+
+    protected TestResult checkGetContextFromSession(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("PortletContext Retrieved From Session Test");
+        res.setDesc("Test ensures that the PortletContext can be retrieved from the session.");
+
+        PortletContext ctx = session.getPortletContext();
+        if(ctx != null) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Portlet Context is Null");
+        }
+        return res;
+    }
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.io.IOException;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 9, 2005
+ */
+public class DispatcherRenderParameterTest 
+    extends AbstractReflectivePortletTest  {
+
+    public static final String KEY_A = "includedTestKey";
+    public static final String VAL_A = "includedTestVal";
+    public static final String KEY_B = "bTestKey";
+    public static final String VAL_B = "bTestVal";
+    public static final String RESULT_KEY = "org.apache.pluto.testsuite.RESULTKEY";
+    
+
+    public DispatcherRenderParameterTest() {
+
+    }
+
+    public String getTestSuiteName() {
+        return "Dispatcher Render Parameter Test";
+    }
+    
+    protected TestResult checkIncludedParameterTest(PortletContext ctx,
+                                                    PortletRequest req,
+                                                    PortletResponse res)
+    throws IOException, PortletException {
+        PortletRequestDispatcher disp =
+            ctx.getRequestDispatcher("/tests/include?"+KEY_A+"="+VAL_A+"&"+KEY_B+"="+VAL_B);
+        
+        disp.include((RenderRequest)req, (RenderResponse)res);
+
+        TestResult result = new TestResult();
+        result.setName("Dispatcher Render Parameter Test");
+        result.setDesc("Ensure query parameters added during dispatching are attached to the request.");
+        if(req.getAttribute(RESULT_KEY)!=null && Boolean.TRUE.equals(req.getAttribute(RESULT_KEY))) {
+            result.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            result.setReturnCode(TestResult.FAILED);
+            result.setResults("Unable to find expected parameter");
+        }
+        return result;
+    }
+    
+
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTestServlet.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTestServlet.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTestServlet.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/DispatcherRenderParameterTestServlet.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.io.IOException;
+
+import javax.servlet.GenericServlet;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+/**
+ * <B>TODO</B>: Document
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 9, 2005
+ */
+public class DispatcherRenderParameterTestServlet extends GenericServlet {
+
+    public DispatcherRenderParameterTestServlet() {
+
+    }
+
+    public void service(ServletRequest req, ServletResponse res)
+    throws ServletException, IOException {
+        String valA = req.getParameter(DispatcherRenderParameterTest.KEY_A);
+        String valB = req.getParameter(DispatcherRenderParameterTest.KEY_B);
+        if(DispatcherRenderParameterTest.VAL_A.equals(valA) && DispatcherRenderParameterTest.VAL_B.equals(valB)) {
+            req.setAttribute(DispatcherRenderParameterTest.RESULT_KEY, Boolean.TRUE);
+        }
+    }
+
+    public String getServletInfo() {
+        return "Dispather Render Parameter Include Servlet";
+    }
+
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.portalImpl.portlet.test;
+
+import javax.portlet.PortletSession;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class ExternalAppScopedAttributeTest extends AbstractReflectivePortletTest {
+
+    public static final String INT_KEY = "org.apache.pluto.testsuite.INTERNALLY_SET_APP_SCOPED_SESSION_TEST_KEY";
+    public static final String EXT_KEY = "org.apache.pluto.testsuite.EXTERNALLY_SET_APP_SCOPED_SESSION_TEST_KEY";
+    public static final String VALUE = "Should be visible to all Portlets and Web Resources.";
+
+    public String getTestSuiteName() {
+        return "External Application Scoped Attribute Test";
+    }
+
+    public TestResult checkSetHereSeenElsewhere(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("Session Visibility Test");
+        res.setDesc("Ensure application scoped attributes set here can be seen elsewhere.");
+        res.setReturnCode(TestResult.WARNING);
+        res.setResults("Click the provided link to validate test.");
+
+        session.setAttribute(INT_KEY, VALUE, PortletSession.APPLICATION_SCOPE);
+        return res;
+    }
+
+    public TestResult checkSetElsewhereSeenHere(PortletSession session) {
+        TestResult res = new TestResult();
+        res.setName("Session Visibility Test");
+        res.setDesc("Ensure application scoped attributes set elsewhere can be seen here.");
+
+        Object val = session.getAttribute(EXT_KEY, PortletSession.APPLICATION_SCOPE);
+        if(VALUE.equals(val)) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.WARNING);
+            res.setResults("This test will not pass until you have opened the external resource using the link provided below.");
+        }
+        return res;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTestCompanionServlet.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTestCompanionServlet.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTestCompanionServlet.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ExternalAppScopedAttributeTestCompanionServlet.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class ExternalAppScopedAttributeTestCompanionServlet extends HttpServlet {
+
+    public void doGet(HttpServletRequest req, HttpServletResponse res)
+    throws ServletException, IOException {
+
+        HttpSession session = req.getSession();
+        String val = (String)
+            session.getAttribute(ExternalAppScopedAttributeTest.INT_KEY);
+
+        if(ExternalAppScopedAttributeTest.VALUE.equals(val)) {
+            req.setAttribute("passed", new Boolean(true));
+
+            session.setAttribute(
+                ExternalAppScopedAttributeTest.EXT_KEY,
+                ExternalAppScopedAttributeTest.VALUE
+            );
+        }
+
+        RequestDispatcher dis = req.getRequestDispatcher("/jsp/external_app_scoped_test_ext.jsp");
+        dis.forward(req, res);
+
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/MiscTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/MiscTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/MiscTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/MiscTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.Enumeration;
+import java.util.Properties;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.WindowState;
+
+import org.apache.pluto.testsuite.ExpectedResults;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class MiscTest extends AbstractReflectivePortletTest {
+
+
+    public String getTestSuiteName() {
+        return "Misc Test";
+    }
+
+    protected TestResult checkContextMajorVersion(PortletContext ctx) {
+        TestResult res = new TestResult();
+        res.setName("Major Version Test");
+        res.setDesc("Make sure that the expected major version number is returned.");
+        Properties props = ExpectedResults.getExpectedProperties();
+        String major = String.valueOf(ctx.getMajorVersion());
+        if(major.equals(props.getProperty("expected.version.major"))) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Major Version: "+major+". Expected: "+props.getProperty("expected.version.major"));
+        }
+        return res;
+    }
+
+    protected TestResult checkContextMinorVersion(PortletContext ctx) {
+        TestResult res = new TestResult();
+        res.setName("Minor Version Test");
+        res.setDesc("Make sure that the expected minor version number is returned.");
+        Properties props = ExpectedResults.getExpectedProperties();
+        String minor = String.valueOf(ctx.getMinorVersion());
+        if(minor.equals(props.getProperty("expected.version.minor"))) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Minor Version: "+minor+". Expected: "+props.getProperty("expected.version.minor"));
+        }
+        return res;
+    }
+
+
+
+    protected TestResult checkContextServerInfo(PortletContext ctx) {
+        TestResult res = new TestResult();
+        res.setName("Server Info Test");
+        res.setDesc("Make sure that the expected server info is returned.");
+        Properties props = ExpectedResults.getExpectedProperties();
+        if(ctx.getServerInfo().equals(props.getProperty("expected.serverInfo"))) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Server info: "+ctx.getServerInfo()+". Expected: "+props.getProperty("expected.serverInfo"));
+        }
+        return res;
+    }
+
+    protected TestResult checkPortalInfo(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Portal Info Test");
+        res.setDesc("Make sure that the expected portal info is returned.");
+        Properties props = ExpectedResults.getExpectedProperties();
+        if(req.getPortalContext().getPortalInfo().equals(props.getProperty("expected.portalInfo"))) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Portal info: "+req.getPortalContext().getPortalInfo()+". Expected: "+props.getProperty("expected.portalInfo"));
+        }
+        return res;
+    }
+
+    /**
+     * Test to ensure that the basic modes are supported.
+     * @todo Enhance to check for custom modes.
+     * @param req
+     * @return
+     */
+    protected TestResult checkSupportedModes(PortletRequest req)  {
+        TestResult res = new TestResult();
+        res.setName("Supported Modes Test");
+        res.setDesc("Make sure that the expected modes are returned.");
+
+        boolean hasView = false;
+        boolean hasEdit = false;
+        boolean hasHelp = false;
+
+        Enumeration enumerator= req.getPortalContext().getSupportedPortletModes();
+        while(enumerator.hasMoreElements()) {
+            PortletMode mode = (PortletMode)enumerator.nextElement();
+            if(mode.equals(PortletMode.VIEW)) {
+                hasView  = true;
+            }
+            else if(mode.equals(PortletMode.EDIT)) {
+                hasEdit  = true;
+            }
+            else if(mode.equals(PortletMode.HELP)) {
+                hasHelp  = true;
+            }
+        }
+
+        if(hasView && hasEdit &&  hasHelp) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            StringBuffer sb = new StringBuffer();
+            if(!hasView) {
+                sb.append("'View' mode not found. ");
+            }
+            if(!hasEdit) {
+                sb.append("'Edit' mode not found. ");
+            }
+            if(!hasHelp) {
+                sb.append("'Help' mode not found. ");
+            }
+        }
+        return res;
+    }
+
+    protected TestResult checkSupportedWindowSates(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Supported Window States Test");
+        res.setDesc("Make sure that the expected states are returned.");
+
+        boolean hasMin = false;
+        boolean hasMax = false;
+        boolean hasNor = false;
+
+        Enumeration enumerator= req.getPortalContext().getSupportedWindowStates();
+        while(enumerator.hasMoreElements()) {
+            WindowState mode = (WindowState)enumerator.nextElement();
+            if(mode.equals(WindowState.MINIMIZED)) {
+                hasMin  = true;
+            }
+            else if(mode.equals(WindowState.MAXIMIZED)) {
+                hasMax  = true;
+            }
+            else if(mode.equals(WindowState.NORMAL)) {
+                hasNor  = true;
+            }
+        }
+
+        if(hasMin && hasMax &&  hasNor) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            StringBuffer sb = new StringBuffer();
+            if(!hasMin) {
+                sb.append("'Minimized' state not found. ");
+            }
+            if(!hasMax) {
+                sb.append("'Maximized' state not found. ");
+            }
+            if(!hasNor) {
+                sb.append("'Normal' state not found. ");
+            }
+        }
+        return res;
+    }
+
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/NoOpTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/NoOpTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/NoOpTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/NoOpTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.Map;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+
+import org.apache.pluto.portalImpl.portlet.TestConfig;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Mar 9, 2005
+ */
+public class NoOpTest implements PortletTest {
+    private TestConfig config;
+
+    public NoOpTest() {
+
+    }
+
+    public String getTestSuiteName() {
+        return "NoOpTest";
+    }
+
+    public Map getRenderParameters(PortletRequest req) {
+        return new java.util.HashMap();
+    }
+
+    public TestResults doTest(PortletConfig config, PortletContext context,
+                              PortletRequest req, PortletResponse res) {
+        return new TestResults("None");
+    }
+
+    public void init(TestConfig config) {
+        this.config = config;
+    }
+
+    public TestConfig getConfig() {
+        return config;
+    }
+}
+

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/PortletTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/PortletTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/PortletTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/PortletTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.Map;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+
+import org.apache.pluto.portalImpl.portlet.TestConfig;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public interface PortletTest {
+
+    String getTestSuiteName();
+    
+    Map getRenderParameters(PortletRequest req);
+
+    TestResults doTest(PortletConfig config,
+                       PortletContext context,
+                       PortletRequest req,
+                       PortletResponse res);
+
+    void init(TestConfig config);
+
+    TestConfig getConfig();
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java?rev=226395&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/portlet/test/ResourceBundleTest.java Fri Jul 29 09:40:51 2005
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.portalImpl.portlet.test;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+
+/**
+ * Tests basic attribute retrieval and storage functions within
+ * the portlet request, session, and context objects.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class ResourceBundleTest extends AbstractReflectivePortletTest {
+
+    public String getTestSuiteName() {
+        return "Resource Bundle Test";
+    }
+
+    public Map doPrerequisiteAction(PortletContext context, ActionRequest req,
+                                    ActionResponse res) {
+        return new HashMap();
+
+    }
+//
+// Begin Request Tests
+//
+    protected TestResult checkResourceBundleExists(PortletConfig config,
+                                                   PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Get ResourceBundle Test");
+        res.setDesc("Retrieves the resource bundle and ensures it's not null.");
+
+        ResourceBundle rb = config.getResourceBundle(req.getLocale());
+        if(rb != null) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults(TestResult.FAILED);
+        }
+        return res;
+    }
+    protected TestResult checkGetNames(PortletConfig config, PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Get Property Keys Test");
+        res.setDesc("Retrieve the property names and ensure that the required keys are present.");
+
+        ArrayList keys = new ArrayList();
+        keys.add("javax.portlet.title");
+        keys.add("javax.portlet.short-title");
+        keys.add("javax.portlet.keywords");
+
+        ResourceBundle rb = config.getResourceBundle(req.getLocale());
+        Enumeration enumerator= rb.getKeys();
+        while(enumerator.hasMoreElements()) {
+            String key = enumerator.nextElement().toString();
+            keys.remove(key);
+        }
+
+        if(keys.size() < 1) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            StringBuffer sb = new StringBuffer();
+            Iterator it = keys.iterator();
+            while(it.hasNext()) {
+                sb.append(it.next()+", ");
+            }
+
+            res.setResults("Keys: "+sb.toString()+" are not defined.");
+        }
+
+        return res;
+    }
+
+    protected TestResult checkGetGermanBundle(PortletConfig config,
+                                             PortletRequest req) {
+        return doGenericLocaleRequiredFields(config, req, Locale.GERMAN);
+    }
+
+    protected TestResult checkGetEnglishBundle(PortletConfig config,
+                                              PortletRequest req) {
+        return doGenericLocaleRequiredFields(config, req, Locale.ENGLISH);
+    }
+
+    /*
+    protected TestResult checkGetDfltBundle(PortletConfig config,
+                                            PortletRequest req) {
+        return doGenericLocaleRequiredFields(config, req, new Locale("dflt"));
+    }
+    */
+
+    private TestResult doGenericLocaleRequiredFields(PortletConfig config,
+                                          PortletRequest req,
+                                          Locale locale) {
+
+        TestResult res = new TestResult();
+        res.setName("Get Portlet Info for "+locale.getLanguage());
+        res.setDesc("Retrieve the title and ensure it's set properly");
+
+        String prefix = "_"+locale.getLanguage();
+
+        if(!isBundleDeclared()) {
+            prefix = "";
+        }
+        Map params = getInitParameters();
+        ResourceBundle rb = config.getResourceBundle(locale);
+
+        String eTitle = (String)params.get("title"+prefix);
+        String eSTitle = (String)params.get("shorttitle"+prefix);
+        String eKeywds = (String)params.get("keywords"+prefix);
+
+        String title = rb.getString("javax.portlet.title");
+        String sTitle = rb.getString("javax.portlet.short-title");
+        String keywds = rb.getString("javax.portlet.keywords");
+
+        StringBuffer sb = new StringBuffer();
+        if(title==null || !title.trim().equals(eTitle.trim())) {
+            sb.append("Title :'"+title+"' != '"+eTitle+"';");
+        }
+        if(sTitle==null || !sTitle.trim().equals(eSTitle.trim())) {
+            sb.append("Short Title :'"+sTitle+"' != '"+eSTitle+"';");
+        }
+        if(keywds==null || !keywds.trim().equals(eKeywds.trim())) {
+            sb.append("Keywords :'"+keywds+"' != '"+eKeywds+"' ");
+        }
+
+        if(sb.length() < 1) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            sb.insert(0, "The following information is not correct: ");
+            res.setResults(sb.toString());
+        }
+        return res;
+    }
+
+    private boolean isBundleDeclared() {
+        String param = (String)getInitParameters().get("resource-bundle");
+        if(Boolean.TRUE.toString().equals(param)) {
+            return true;
+        }
+        return false;
+    }
+
+
+
+
+
+}



Mime
View raw message