jmitchell 2003/02/26 18:18:45 Added: web/test/test/org/apache/struts/taglib/html TestBaseTag.jsp TestButtonTag.jsp TestButtonTag2.jsp Log: Initial checkin. Many more will follow. Revision Changes Path 1.1 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp Index: TestBaseTag.jsp =================================================================== <%@ page contentType="text/html;charset=UTF-8" language="java" %> <[EMAIL PROTECTED] import="junit.framework.Assert"%> <%@ 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" %> <% String server = request.getServerName(); int port = request.getServerPort(); %> <logic:equal name="runTest" value="testBase"> <bean:define id="TEST_RESULTS" toScope="page"> <html:base/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <base href="http://<%=server%>:<%=port%>/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testBaseTarget"> <bean:define id="TEST_RESULTS" toScope="page"> <html:base target="My-Other-Frame"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <base href="http://<%=server%>:<%=port%>/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp" target="My-Other-Frame"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testBaseServer"> <bean:define id="TEST_RESULTS" toScope="page"> <html:base server="www.my-server-name.com"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <base href="http://www.my-server-name.com:<%=port%>/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testBaseServerTarget"> <bean:define id="TEST_RESULTS" toScope="page"> <html:base server="www.my-server-name.com" target="My-Other-Frame"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <base href="http://www.my-server-name.com:<%=port%>/test/test/org/apache/struts/taglib/html/TestBaseTag.jsp" target="My-Other-Frame"> </bean:define> </logic:equal> <% Assert.assertEquals( pageContext.getAttribute("TEST_RESULTS").toString(), pageContext.getAttribute("EXPECTED_RESULTS").toString() ); %> 1.1 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag.jsp Index: TestButtonTag.jsp =================================================================== <%@ page contentType="text/html;charset=UTF-8" language="java" %> <[EMAIL PROTECTED] import="junit.framework.Assert"%> <%@ 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="testButtonProperty"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAccesskey"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" accesskey="a"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" accesskey="a" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAlt"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" alt="Testing alt attribute"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" alt="Testing alt attribute"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAltKey1"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" altKey="default.bundle.message"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" alt="Testing Message"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAltKey2"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" altKey="no.such.key"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAltKey1_fr"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" altKey="default.bundle.message"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" alt="Message D'Essai"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyAltKey2_fr"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" altKey="no.such.key"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyDisabled_True"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" disabled="true"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" disabled="disabled"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyDisabled_False1"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" disabled="false"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyDisabled_False2"> <!-- This was changed recently by overwhelming consensus. The prior functionality was very counter-intuitive. It used to be that putting disabled="false" was the same as putting disabled="true". Craig sited the confusion is due to the HTML spec. --> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" disabled="anything but true"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnblur"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onblur="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onblur="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnchange"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onchange="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onchange="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnclick"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onclick="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onclick="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOndblclick"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" ondblclick="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" ondblclick="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnfocus"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onfocus="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onfocus="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnkeydown"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onkeydown="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onkeydown="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnkeypress"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onkeypress="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onkeypress="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnkeyup"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onkeyup="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onkeyup="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnmousedown"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onmousedown="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onmousedown="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnmousemove"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onmousemove="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onmousemove="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnmouseout"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onmouseout="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onmouseout="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnmouseover"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onmouseover="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onmouseover="Put script here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyOnmouseup"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" onmouseup="Put script here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" onmouseup="Put script here"> </bean:define> </logic:equal> <% Assert.assertEquals( pageContext.getAttribute("TEST_RESULTS").toString(), pageContext.getAttribute("EXPECTED_RESULTS").toString() ); %> 1.1 jakarta-struts/web/test/test/org/apache/struts/taglib/html/TestButtonTag2.jsp Index: TestButtonTag2.jsp =================================================================== <%@ page contentType="text/html;charset=UTF-8" language="java" %> <[EMAIL PROTECTED] import="junit.framework.Assert"%> <%@ 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="testButtonPropertyStyle"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" style="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" style="Put something here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyStyleClass"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" styleClass="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" class="Put something here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyStyleId"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" styleId="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" id="Put something here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyTabindex"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" tabindex="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" tabindex="Put something here" value="Click"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyTitle"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" title="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" title="Put something here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyTitleKey"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" titleKey="default.bundle.message"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" title="Testing Message"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyTitleKey_fr"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" titleKey="default.bundle.message"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Click" title="Message D'Essai"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyValue"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName" value ="Put something here"/> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Put something here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyBodyContent"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName">Button Value Here</html:button> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Button Value Here"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyBodyContentMessageKey"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName"> <bean:message key="default.bundle.message"/> </html:button> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Testing Message"> </bean:define> </logic:equal> <logic:equal name="runTest" value="testButtonPropertyBodyContentMessageKey_fr"> <bean:define id="TEST_RESULTS" toScope="page"> <html:button property="propertyName"> <bean:message key="default.bundle.message"/> </html:button> </bean:define> <bean:define id="EXPECTED_RESULTS" toScope="page"> <input type="button" name="propertyName" value="Message D'Essai"> </bean:define> </logic:equal> <% Assert.assertEquals( pageContext.getAttribute("TEST_RESULTS").toString(), pageContext.getAttribute("EXPECTED_RESULTS").toString() ); %>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]