Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/CancelDemo.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/CancelDemo.tml?rev=919693&r1=919692&r2=919693&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/CancelDemo.tml (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/CancelDemo.tml Sat Mar 6 02:59:09 2010 @@ -9,7 +9,7 @@ <br/> - <t:submit mode="cancel" t:id="cancel" text="Cancel Form"/> + <t:submit mode="cancel" t:id="cancel" value="Cancel Form"/> <t:linksubmit mode="cancel" t:id="cancelLink">Cancel Form</t:linksubmit> </t:form>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/SubmitTest.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/SubmitTest.java?rev=919693&r1=919692&r2=919693&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/SubmitTest.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/SubmitTest.java Sat Mar 6 02:59:09 2010 @@ -1,10 +1,10 @@ -// Copyright 2007, 2008 The Apache Software Foundation +// Copyright 2007, 2008, 2010 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 +// 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, @@ -26,7 +26,6 @@ import org.apache.tapestry5.services.FormSupport; import org.apache.tapestry5.services.Heartbeat; import org.apache.tapestry5.services.Request; -import org.easymock.EasyMock; import org.testng.annotations.Test; public class SubmitTest extends InternalBaseTestCase @@ -38,13 +37,14 @@ String elementName = "myname"; + train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null); train_getParameter(request, elementName, null); replay(); Submit submit = new Submit(request); - submit.processSubmission(elementName); + submit.processSubmission("xyz", elementName); verify(); } @@ -58,7 +58,9 @@ String elementName = "myname"; - train_getParameter(request, elementName, "login"); + // Also: test for the alternate, JavaScript oriented way, of determining the + // element/component that triggered the submission. + train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, "xyz"); replay(); @@ -66,7 +68,7 @@ TestBase.set(submit, "resources", resources, "formSupport", support); - submit.processSubmission(elementName); + submit.processSubmission("xyz", elementName); verify(); @@ -89,6 +91,7 @@ String elementName = "myname"; + train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null); train_getParameter(request, elementName, "login"); replay(); @@ -99,7 +102,7 @@ TestBase.set(submit, "resources", resources, "formSupport", support, "heartbeat", heartbeat, "defer", false); - submit.processSubmission(elementName); + submit.processSubmission("xyz", elementName); verify(); @@ -111,7 +114,7 @@ verify(); } - + @Test public void test_imagesubmit_event_fired() { @@ -122,21 +125,22 @@ String elementName = "myname"; + train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null); train_getParameter(request, elementName + ".x", "15"); - + formSupport.defer(isA(Runnable.class)); replay(); Submit submit = new Submit(request); - + TestBase.set(submit, "resources", resources, "formSupport", formSupport, "image", image); - submit.processSubmission(elementName); + submit.processSubmission("xyz", elementName); verify(); } - + @Test public void test_submit_event_fired() { @@ -146,17 +150,18 @@ String elementName = "myname"; + train_getParameter(request, Form.SUBMITTING_ELEMENT_ID, null); train_getParameter(request, elementName, "login"); - + formSupport.defer(isA(Runnable.class)); replay(); Submit submit = new Submit(request); - + TestBase.set(submit, "resources", resources, "formSupport", formSupport); - submit.processSubmission(elementName); + submit.processSubmission("xyz", elementName); verify(); } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java?rev=919693&r1=919692&r2=919693&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Sat Mar 6 02:59:09 2010 @@ -687,10 +687,9 @@ sleep(250); - // click("link=Fred"); - waitForCondition("selenium.browserbot.getCurrentWindow().$('name:errorpopup')", PAGE_LOAD_TIMEOUT); + waitForElementToAppear("name:errorpopup"); assertTextPresent("You must provide a value for Name."); Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForSubmit.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForSubmit.tml?rev=919693&r1=919692&r2=919693&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForSubmit.tml (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app2/pages/TestPageForSubmit.tml Sat Mar 6 02:59:09 2010 @@ -10,7 +10,7 @@ </form></p> <input type="submit" id="orphanedSubmit"/> <t:form t:id="form3"> - <input id="submitImage" t:type="submit" image="prop:spacerImage"/> + <input t:id="submitImage" t:type="submit" image="prop:spacerImage"/> </t:form> <p> Value is: ${value}.
