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/08/23 03:08:57 UTC

svn commit: rev 36719 - portals/pluto/trunk/testsuite/src/webapp/jsp

Author: ddewolf
Date: Sun Aug 22 18:08:57 2004
New Revision: 36719

Added:
   portals/pluto/trunk/testsuite/src/webapp/jsp/complex_attribute_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/edit.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/ext_app_scoped_attr_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/external_app_scoped_test_ext.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/help.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/introduction.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/misc_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/navigation.inc
   portals/pluto/trunk/testsuite/src/webapp/jsp/portlet_mode_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/security_mapping_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/simple_attribute_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/simple_preference_test.jsp
   portals/pluto/trunk/testsuite/src/webapp/jsp/test_results.inc
   portals/pluto/trunk/testsuite/src/webapp/jsp/window_state_test.jsp
Log:
New JSPs for new Testsuite portlet.  The testsuite portlet has been enhanced.  Testing logic - where possible - has been moved into test classes for less scripting, easier maintenence, and to model best practices a little better.  Additional tests have been added.

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/complex_attribute_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/complex_attribute_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,6 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<%@ include file="test_results.inc" %>
+<%@ include file="navigation.inc" %>
+

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/edit.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/edit.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1 @@
+THIS IS THE EDIT PAGE
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/ext_app_scoped_attr_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/ext_app_scoped_attr_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,36 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+
+<script name="JavaScript">
+function openCompanionWindow() {
+	w = 500;
+	h = 400;
+	x = (screen.width - w) / 2;
+	y = (screen.height - h) / 2;
+	window.open('<HTML><BODY><CENTER><FONT color=red>Testing Session Attributes</FONT></CENTER></BODY></HTML>', 'companionWindow', 'resizable=yes,scrollbars=yes,status=yes,width=' + w + ',height=' + h + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y);
+}
+</script>
+
+<c:choose>
+<c:when test="${results.inQuestion}">
+<TABLE>
+<TR><TH colspan="2" style="background-color:blue;color:white;">MANUAL TEST</TH></TR>
+<TR><TH colspan="2">Application Scoped Session Attributes Test</TH></TR>
+<TR><TD>
+    <P>This test is to validate that application scoped attributes can be viewed
+    by resources outside of the portlet.  Additionally, it tests to make sure that
+    session attributes set by other resources may be viewed by the portlet as an
+    application scoped session attribute.</P>
+    This test requires manual intervention.  Click
+    <A href="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/test/extAppScopedTest?sessionId="+request.getSession().getId())%>" target="companionWindow" onclick="openCompanionWindow()">here</A>
+    </TD></TR>
+<TABLE>
+</c:when>
+<c:otherwise>
+<%@ include file="test_results.inc" %>
+</c:otherwise>
+</c:choose>
+
+<%@ include file="navigation.inc" %>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/external_app_scoped_test_ext.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/external_app_scoped_test_ext.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,65 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+
+
+<HTML>
+<HEAD>
+<STYLE>
+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;
+}
+
+.nav, .nav TD, .nav A:link, .nav A:visited, .nav A:hover {
+    background-color: #DDDDDD;
+    color: #36a;
+}
+
+.small {
+    font-size: -1;
+}
+
+</STYLE>
+</HEAD>
+<TABLE style="font-size: -1">
+<c:choose>
+<c:when test="${passed}">
+<TR><TH colspan="2" style="background-color:green;color:white">PASSED</FONT>
+</c:when>
+<c:otherwise>
+<TR><TH colspan="2" style="background-color:red;color:white">FAILED</TH></TR>
+</c:otherwise>
+</c:choose>
+
+<TR><TD colspan="2">
+    This resource has been requested outside of the portal framework.  It is
+    intended to test application scope attribute functions of the PortletSession.
+    If the PortletSession is functioning as designed the key set in the PortletSession
+    should be readable.  If it were, this test would have passed. This resource has
+    also added a key to it's HttpSession which should be viewable through the PortletSession
+    attribute.</TD></TR>
+<TR><TH colspan="2">Session Id Comparison</TH></TR>
+<TR><TD>This HttpSession Id</TD>
+    <TD><c:out value="${pageContext.request.session.id}"/></TD></TR>
+<TR><TD>Requesting Portlet's Session Id</TD>
+    <TD><%=request.getParameter("sessionId")%></TD></TR>
+    </TABLE>
+</BODY>
+</HTML>
+

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/help.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/help.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,12 @@
+<TABLE style="border-colapse: false;padding: 4px 4px;border-spacing: 3px 4px;">
+<TR><TH colspan="2">Test Portlet Help Page</TH></TR>
+<TR><TD colspan="2">Color Code Key</TH></TR>
+<TR><TD width="20" style="background-color:green;">&nbsp;</TD>
+    <TD style="font-size: 12px">Test has passed!</TH></TR>
+<TR><TD width="20" style="background-color:blue;">&nbsp;</TD>
+    <TD style="font-size: 12px">Manual Judgment Required!</TH></TR>
+<TR><TD width="20" style="background-color:yellow;">&nbsp;</TD>
+    <TD style="font-size: 12px">Warning! Could not determine pass or fail due to an fixable condition.</TH></TR>
+<TR><TD width="20" style="background-color:red;">&nbsp;</TD>
+    <TD style="font-size: 12px">Test has failed!</TH></TR>
+</TABLE>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/introduction.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/introduction.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,29 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+
+<TABLE>
+<TR><TD>
+    <P>
+    This portlet is a portlet specification compatibility test portlet.
+    It provides several tests of verying complexities which will assist
+    in evaluating compliance with the portlet specification. It was originally
+    developed for testing Apache Pluto, however, it does not utilize any
+    proprietary APIs and should work with all compliant portlet containers.
+    </P>
+
+    <P>Please select one of the following tests:
+    <TABLE>
+    <c:forEach var="test" items="${tests}">
+    <TR><TD><%=pageContext.getAttribute("test").toString()%></TD>
+        <portlet:actionURL secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+    	<portlet:param name="testId" value='<%=pageContext.getAttribute("test").toString()%>'/>
+        </portlet:actionURL>
+        <TD><A href="<c:out value="${url}"/>">Test</A></TD>
+    </c:forEach>
+    </TABLE>
+
+    </P>
+    </TD></TR>
+</TABLE>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/misc_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/misc_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,5 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<%@ include file="test_results.inc" %>
+<%@ include file="navigation.inc" %>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/navigation.inc
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/navigation.inc	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,31 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+
+<CENTER>
+<TABLE>
+<TR><TD align="center" nowrap="true">
+<portlet:actionURL secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="nextTestId" value="<%=renderRequest.getParameter("testId") %>"/>
+</portlet:actionURL>
+
+<A href="<%=url%>"><IMG SRC="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/previous.png")%>" border="0"></A>
+
+<portlet:actionURL secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="xx_introduction"/>
+</portlet:actionURL>
+
+<A href="<%=url%>"><IMG SRC="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/return_index.png")%>" border="0"></A>
+
+<portlet:actionURL secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="previousTestId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<A href="<%=url%>"><IMG SRC="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/next.png")%>" border="0"></A>
+</TD></TR>
+</TABLE>
+</CENTER>
+
+
+

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/portlet_mode_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/portlet_mode_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,40 @@
+<%@ page import="javax.portlet.PortletMode"%>
+<%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%>
+
+<portlet:defineObjects/>
+
+<TABLE style="font-size: -1">
+<TR><TH colspan="2" style="background-color:blue;color:white;">MANUAL TEST</TH></TR>
+<TR><TH></TH>
+    <TH>Portlet Mode Test</TH></TR>
+<TR><TD colspan="2">This test requires manual intervention
+        to ensure that it passes.  Click on the links below
+        and make sure that the specified mode is displayed.</TD></TR>
+
+<portlet:actionURL portletMode="<%=PortletMode.HELP.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px" valign="top"><A href="<%=url%>">Help</A></TD>
+    <TD style="font-size: 10px;">The help mode provides help info.  Click to ensure that help info is
+        displayed.</TD></TR>
+
+<portlet:actionURL portletMode="<%=PortletMode.EDIT.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px" valign="top"><A href="<%=url%>">Edit</A></TD>
+    <TD style="font-size: 10px;">The edit mode allows you to edit preferences. Click to view all preferences
+    currently stored in this portlet.</TD></TR>
+
+<portlet:actionURL portletMode="<%=PortletMode.VIEW.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px"><A href="<%=url%>">View</A></TD>
+    <TD style="font-size: 10px;" valign="top">You are currently looking at the view.  Verify that clicking on this link
+    simply refreshes this page.</TD></TR>
+
+</TABLE>
+
+<%@ include file="navigation.inc" %>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/security_mapping_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/security_mapping_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,5 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<%@ include file="test_results.inc" %>
+<%@ include file="navigation.inc" %>

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/simple_attribute_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/simple_attribute_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,6 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<%@ include file="test_results.inc" %>
+<%@ include file="navigation.inc" %>
+

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/simple_preference_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/simple_preference_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,5 @@
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<%@ include file="test_results.inc" %>
+<%@ include file="navigation.inc" %>

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/test_results.inc
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/test_results.inc	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,50 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<%
+    pageContext.setAttribute("passed", "Passed");
+    pageContext.setAttribute("failed", "Failed");
+    pageContext.setAttribute("warning", "Warning");
+%>
+
+<portlet:defineObjects/>
+
+<TABLE style="font-size: -1">
+<c:choose>
+<c:when test="${results.failed}">
+<TR><TH colspan="2" style="background-color:red;color:white">FAILED</TH></TR>
+</c:when>
+<c:when test="${results.inQuestion}">
+<TR><TH colspan="2" style="background-color:yellow">WARNING</TH></TR>
+</c:when>
+<c:otherwise>
+<TR><TH colspan="2" style="background-color:green;color:white">PASSED</FONT></c:otherwise>
+</c:choose>
+
+<TR><TH></TH>
+    <TH><c:out value="${results.name}"/></TH>
+<c:forEach var="result" varStatus="status" items="${results.collection}">
+<TR><TD valign="top">
+    <c:choose>
+    <c:when test="${result.returnCode==passed}">
+    <IMG src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/yes.gif")%>" border="0">
+    </c:when>
+    <c:when test="${result.returnCode==failed}">
+    <IMG src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/no.gif")%>" border="0">
+    </c:when>
+    <c:otherwise>
+    <IMG src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/images/question.gif")%>" border="0">
+    </c:otherwise>
+    </c:choose>
+    </TD>
+    <TD style="font-size:12px;" nowrap="true"><c:out value="${result.name}"/></TD></TR>
+    <c:choose>
+    <c:when test="${result.returnCode==passed}">
+    <TR><TD></TD><TD style="font-size:10px;"><c:out value="${result.desc}"/></TD></TR>
+    </c:when>
+    <c:otherwise>
+    <TR><TD></TD><TD style="font-size:10px;"><c:out value="${result.results}"/></TD></TR>
+    </c:otherwise>
+    </c:choose>
+</c:forEach>
+</TABLE>
\ No newline at end of file

Added: portals/pluto/trunk/testsuite/src/webapp/jsp/window_state_test.jsp
==============================================================================
--- (empty file)
+++ portals/pluto/trunk/testsuite/src/webapp/jsp/window_state_test.jsp	Sun Aug 22 18:08:57 2004
@@ -0,0 +1,40 @@
+<%@ page import="javax.portlet.WindowState"%>
+<%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%>
+
+<portlet:defineObjects/>
+
+<TABLE style="font-size: -1">
+<TR><TH colspan="2" style="background-color:blue;color:white;">MANUAL TEST</TH></TR>
+<TR><TH></TH>
+    <TH>Window State Test</TH></TR>
+<TR><TD colspan="2">This test requires manual intervention
+        to ensure that it passes.  Click on the links below
+        and make sure that the specified state is displayed.</TD></TR>
+
+<portlet:actionURL windowState="<%=WindowState.MAXIMIZED.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px" valign="top"><A href="<%=url%>">Max</A></TD>
+    <TD style="font-size: 10px;">The help mode provides help info.  Click to ensure that help info is
+        displayed.</TD></TR>
+
+<portlet:actionURL windowState="<%=WindowState.MINIMIZED.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px" valign="top"><A href="<%=url%>">Min</A></TD>
+    <TD style="font-size: 10px;">The edit mode allows you to edit preferences. Click to view all preferences
+    currently stored in this portlet.</TD></TR>
+
+<portlet:actionURL windowState="<%=WindowState.NORMAL.toString()%>" secure="<%=renderRequest.isSecure()?"True":"False"%>" var="url">
+	<portlet:param name="testId" value="<%=renderRequest.getParameter("testId")%>"/>
+</portlet:actionURL>
+
+<TR><TD style="font-size: 12px" valign="top"><A href="<%=url%>">Nor</A></TD>
+    <TD style="font-size: 10px;">You are currently looking at the view.  Verify that clicking on this link
+    simply refreshes this page.</TD></TR>
+
+</TABLE>
+
+<%@ include file="navigation.inc" %>