Author: husted Date: Fri Dec 2 09:52:55 2005 New Revision: 351781 URL: http://svn.apache.org/viewcvs?rev=351781&view=rev Log: * Registration.jsp - Give submit and reset buttons names so that they can be invoked by automatic tests.
Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties struts/apps/trunk/mailreader/src/webapp/Registration.jsp struts/apps/trunk/mailreader/src/webapp/WEB-INF/entities/register-hermes.xml struts/apps/trunk/mailreader/src/webapp/WEB-INF/webtest.xml Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties?rev=351781&r1=351780&r2=351781&view=diff ============================================================================== --- struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties (original) +++ struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties Fri Dec 2 09:52:55 2005 @@ -1,5 +1,8 @@ button.cancel=Cancel button.confirm=Confirm +button.doSubmit=DO_SUBMIT +button.doReset=DO_RESULT +button.doCancel=org.apache.struts.taglib.html.CANCEL button.reset=Reset button.save=Save change.message=Your password has expired. Please ask the system administrator to change it. Modified: struts/apps/trunk/mailreader/src/webapp/Registration.jsp URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/Registration.jsp?rev=351781&r1=351780&r2=351781&view=diff ============================================================================== --- struts/apps/trunk/mailreader/src/webapp/Registration.jsp (original) +++ struts/apps/trunk/mailreader/src/webapp/Registration.jsp Fri Dec 2 09:52:55 2005 @@ -21,6 +21,7 @@ <html:base/> </head> <body bgcolor="white"> +<p>x</p> <html:errors/> @@ -96,12 +97,12 @@ <tr> <td align="right"> - <html:submit property="Submit"> + <html:submit property="DO_SUBMIT"> <bean:message key="button.save"/> </html:submit> </td> <td align="left"> - <html:reset property="Reset"> + <html:reset property="DO_RESET"> <bean:message key="button.reset"/> </html:reset> Modified: struts/apps/trunk/mailreader/src/webapp/WEB-INF/entities/register-hermes.xml URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/WEB-INF/entities/register-hermes.xml?rev=351781&r1=351780&r2=351781&view=diff ============================================================================== --- struts/apps/trunk/mailreader/src/webapp/WEB-INF/entities/register-hermes.xml (original) +++ struts/apps/trunk/mailreader/src/webapp/WEB-INF/entities/register-hermes.xml Fri Dec 2 09:52:55 2005 @@ -18,6 +18,4 @@ description="fromAddress" name="fromAddress" value="[EMAIL PROTECTED]" /> -<clickButton - description="Save" - name="${button.save}"/> +&save-click; \ No newline at end of file Modified: struts/apps/trunk/mailreader/src/webapp/WEB-INF/webtest.xml URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/WEB-INF/webtest.xml?rev=351781&r1=351780&r2=351781&view=diff ============================================================================== --- struts/apps/trunk/mailreader/src/webapp/WEB-INF/webtest.xml (original) +++ struts/apps/trunk/mailreader/src/webapp/WEB-INF/webtest.xml Fri Dec 2 09:52:55 2005 @@ -9,6 +9,7 @@ <!ENTITY register-hermes SYSTEM "file:./entities/register-hermes.xml"> <!ENTITY register-open SYSTEM "file:./entities/register-open.xml"> <!ENTITY register-page SYSTEM "file:./entities/register-page.xml"> + <!ENTITY save-click SYSTEM "file:./entities/save-click.xml"> <!ENTITY welcome-click SYSTEM "file:./entities/welcome-click.xml"> <!ENTITY welcome-open SYSTEM "file:./entities/welcome-open.xml"> ]> @@ -55,6 +56,17 @@ MailReader war, deploy it to your container, and use Ant to run the webtest.xml. + The "clean" target can be run to test everything, but will fail if run again, + since the test-user will already be registered. + The "default" target skips registeration and can be run as often as needed + after "clean" is run once. + + To reset the XML "database", either redeploy the application so that the + WEB-INF/database.xml is overwritten, + or use the "clean-database" target to overwrite the file. + Only use "clean-database" when the server is stopped, + and then start it again before running other targets. + The tests are based on a set of MailReader Use Cases maintained at the Struts University site [http://opensource2.atlassian.com/confluence/oss/display/STRUTS/MailReader]. @@ -81,6 +93,9 @@ <property name="resource.home" location="../../java/org/apache/struts/apps/mailreader/resources/ApplicationResources.properties" /> + <property name="webapps.home" + location="/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/" /> + <!-- Load application resources --> <property file="${resource.home}"/> @@ -93,7 +108,11 @@ <target name="default" depends="Browse,Logon" /> - <!-- FIXME: target name="clean" depends="Browse,Register,Logon" / --> + <target name="clean" depends="Browse,Register,Logon" /> + + <target name="clean-database" description="Sets database.xml to default. Stop server, run target, and Start server."> + <copy file="database.xml" tofile="${webapps.home}/${basepath}/WEB-INF/database.xml"/> + </target> <target name="Browse" description=" Visitors can browse the Welcome, Login, and Register @@ -146,33 +165,6 @@ </steps> </webtest> - <webtest name="Register Hermes (again)"> - &config; - <steps> - ®ister-open; - <setInputField - description="username" - name="username" - value="hermes" /> - <setInputField - description="password" - name="m3dus4" /> - <setInputField - description="password" - name="m3dus4" /> - <setInputField - description="password" - name="Hermes Katsopolis" /> - <setInputField - description="password" - name="[EMAIL PROTECTED]" /> - <clickButton - description="Submit" - name="Submit"/> - ®ister-page; - </steps> - </webtest> - </target> <target name="Logon" @@ -213,7 +205,7 @@ <clickButton description="Submit" name="Submit"/> - <!-- FIXME: &menu-page; --> + &menu-page; </steps> </webtest> @@ -232,7 +224,6 @@ &logon-fail; </steps> </webtest> - </target> <webtest name="Logon - No Account"> &config; @@ -249,5 +240,7 @@ &logon-fail; </steps> </webtest> + + </target> </project> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]