You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by jm...@apache.org on 2003/03/14 02:20:19 UTC

cvs commit: jakarta-struts/web/test/test/org/apache/struts/taglib/html TestLinkTag1.jsp TestLinkTag2.jsp

jmitchell    2003/03/13 17:20:19

  Added:       web/test/test/org/apache/struts/taglib/html TestLinkTag1.jsp
                        TestLinkTag2.jsp
  Log:
  New tests
  
  Revision  Changes    Path
  1.1                  jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestLinkTag1.jsp
  
  Index: TestLinkTag1.jsp
  ===================================================================
  <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  <%@page import="junit.framework.Assert"%>
  <%@page import="java.util.HashMap"%>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  
  <!-- --------Testing attributes using forward------ -->
  <logic:equal name="runTest" value="testLinkForward">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardAccesskey">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" accesskey="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" accesskey="XXX">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardAnchor">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" anchor="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp#XXX")%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardIndexedArray">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedArrayProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst" property="list">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedMap">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedMapProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst" property="map">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedEnumeration">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	<logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	</logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=1")%>">Test Link</a>
  	
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedEnumerationProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	<logic:iterate id="indivItem" name="lst" property="enumeration">
  		<html:link forward="simpleForward" indexed="true">Test Link</html:link>
  	</logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=0")%>">Test Link</a>
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?index=1")%>">Test Link</a>
  	
  	</bean:define>
  </logic:equal>
  
  
  
  
  
  
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdArray">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdArrayProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst" property="list">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdMap">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdMapProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	  <logic:iterate id="indivItem" name="lst" property="map">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	  </logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  		
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdEnumeration">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	<logic:iterate id="indivItem" name="lst">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	</logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=1")%>">Test Link</a>
  	
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardIndexedAlternateIdEnumerationProperty">
  	<bean:define id="EXPECTED_RESULTS" toScope="page">
  	<logic:iterate id="indivItem" name="lst" property="enumeration">
  		<html:link forward="simpleForward" indexed="true" indexId="alternateId">Test Link</html:link>
  	</logic:iterate>
  	</bean:define>
  	<bean:define id="TEST_RESULTS" toScope="page">
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=0")%>">Test Link</a>
  	
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp?alternateId=1")%>">Test Link</a>
  	
  	</bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardLinkName">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link linkName="linkName">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a name="linkName">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  
  
  
  <logic:equal name="runTest" value="testLinkForwardNameNoScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramMap">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramMap" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNamePropertyNoScope">
     <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramPropertyMap" property="map">Test Link</html:link>
     </bean:define>
     <bean:define id="thisMap" name="paramPropertyMap" property="map" type="java.util.Map"/>
     <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNameApplicationScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramMap" scope="application">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramMap" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNamePropertyApplicationScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramPropertyMap" property="map" scope="application">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramPropertyMap" property="map" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNameSessionScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramMap" scope="session">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramMap" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNamePropertySessionScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramPropertyMap" property="map" scope="session">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramPropertyMap" property="map" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNameRequestScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramMap" scope="request">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramMap" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardNamePropertyRequestScope">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" name="paramPropertyMap" property="map" scope="request">Test Link</html:link>
      </bean:define>
      <bean:define id="thisMap" name="paramPropertyMap" property="map" type="java.util.Map"/>
      <bean:define id="TEST_RESULTS" toScope="page">
  		<a href="<%=org.apache.struts.util.RequestUtils.computeURL(pageContext, "simpleForward", null, null, null, thisMap, null, false)%>">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <% 
  String expected  = (String) pageContext.getAttribute("EXPECTED_RESULTS");
  String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
  
  if ((expected == null) || (expected == null)){
      Assert.fail("An invalid (or mispelled) test on this page was called.  Please verify that you've setup the tests (and spellings) correctly.");
  }
  	
  Assert.assertEquals(compareTo, expected);
  %>
  
  
  1.1                  jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestLinkTag2.jsp
  
  Index: TestLinkTag2.jsp
  ===================================================================
  <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  <%@page import="junit.framework.Assert"%>
  <%@page import="java.util.HashMap"%>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  
  <logic:equal name="runTest" value="testLinkForwardOnblur">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onblur="onblur">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onblur="onblur">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnclick">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onclick="onclick">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onclick="onclick">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOndblclick">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" ondblclick="ondblclick">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" ondblclick="ondblclick">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnfocus">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onfocus="onfocus">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onfocus="onfocus">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnkeydown">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onkeydown="onkeydown">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onkeydown="onkeydown">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnkeypress">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onkeypress="onkeypress">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onkeypress="onkeypress">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnkeyup">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onkeyup="onkeyup">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onkeyup="onkeyup">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnmousedown">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onmousedown="onmousedown">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onmousedown="onmousedown">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnmousemove">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onmousemove="onmousemove">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onmousemove="onmousemove">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnmouseout">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onmouseout="onmouseout">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onmouseout="onmouseout">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnmouseover">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onmouseover="onmouseover">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onmouseover="onmouseover">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardOnmouseup">
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <html:link forward="simpleForward" onmouseup="onmouseup">Test Link</html:link>
      </bean:define>
      <bean:define id="TEST_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" onmouseup="onmouseup">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  
  
  
  
  
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameNoScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" paramName="paramName">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameParamPropertyNoScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" 
  			paramName="testingParamProperty" paramProperty="string">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramPropertyValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameApplicationScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" paramName="paramName">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameParamPropertyApplicationScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" 
  			paramName="testingParamProperty" paramProperty="string">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramPropertyValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameSessionScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" paramName="paramName">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameParamPropertySessionScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" 
  			paramName="testingParamProperty" paramProperty="string">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramPropertyValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameRequestScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" paramName="paramName">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  <logic:equal name="runTest" value="testLinkForwardParamIdParamNameParamPropertyRequestScope">
      <bean:define id="TEST_RESULTS" toScope="page">
  		<html:link forward="simpleForward" paramId="myParam" 
  			paramName="testingParamProperty" paramProperty="string">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
  		<a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?myParam=paramPropertyValue">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  
  <logic:equal name="runTest" value="testLinkForwardStyle">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" style="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" style="XXX">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardStyleClass">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" styleClass="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" class="XXX">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardStyleId">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" styleId="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" id="XXX">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardTabIndex">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" tabindex="4">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" tabindex="4">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardTarget">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" target="_new">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" target="_new">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardTitle">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" title="XXX">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" title="XXX">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardTitleKey">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" titleKey="default.bundle.message">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>" title="Testing Message">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  <logic:equal name="runTest" value="testLinkForwardTransaction">
      <bean:define id="TEST_RESULTS" toScope="page">
          <html:link forward="simpleForward" transaction="true">Test Link</html:link>
      </bean:define>
      <bean:define id="EXPECTED_RESULTS" toScope="page">
          <a href="<%=response.encodeURL("/test/path/to/non/existing/jsp.jsp")%>?org.apache.struts.taglib.html.TOKEN=Some_Token_Here">Test Link</a>
      </bean:define>
  </logic:equal>
  
  
  
  
  
  <% 
  String expected  = (String) pageContext.getAttribute("EXPECTED_RESULTS");
  String compareTo = (String) pageContext.getAttribute("TEST_RESULTS");
  
  if ((expected == null) || (expected == null)){
      Assert.fail("An invalid (or mispelled) test on this page was called.  Please verify that you've setup the tests (and spellings) correctly.");
  }
  	
  Assert.assertEquals(compareTo, expected);
  %>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org