tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r418649 - in /tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry: dojo/form/ form/ valid/
Date Sun, 02 Jul 2006 21:20:30 GMT
Author: jkuhnert
Date: Sun Jul  2 14:20:30 2006
New Revision: 418649

URL: http://svn.apache.org/viewvc?rev=418649&view=rev
Log:
Fixed unit tests

Modified:
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/dojo/form/TestAutocompleter.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestImageSubmit.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestSubmit.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextArea.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextField.java
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/valid/TestValidField.java

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/dojo/form/TestAutocompleter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/dojo/form/TestAutocompleter.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/dojo/form/TestAutocompleter.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/dojo/form/TestAutocompleter.java
Sun Jul  2 14:20:30 2006
@@ -134,6 +134,8 @@
         
         expect(form.getName()).andReturn("testform").anyTimes();
         
+        form.setFormFieldUpdating(true);
+        
         IMarkupWriter writer = newBufferWriter();
         
         MockDelegate delegate = new MockDelegate();

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/FormSupportTest.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
Sun Jul  2 14:20:30 2006
@@ -197,7 +197,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "barney,wilma,barney_0");
+        trainHiddenBlock(writer, form, "fred", "barney,wilma,barney_0");
 
         nested.close();
 
@@ -319,7 +319,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "");
+        trainHiddenBlock(writer, form, "fred", "");
 
         nested.close();
 
@@ -389,7 +389,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "");
+        trainHiddenBlock(writer, form, "fred", "");
 
         nested.close();
 
@@ -506,7 +506,7 @@
 
         writer.println();
 
-        trainDiv(writer);
+        trainDiv(writer, form);
 
         trainHidden(writer, "formids", "");
         trainHidden(writer, "service", "fred");
@@ -680,7 +680,7 @@
 
         writer.println();
 
-        trainDiv(writer);
+        trainDiv(writer, form);
 
         trainHidden(writer, "formids", "action_0");
         trainHidden(writer, "action", "fred");
@@ -760,7 +760,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "");
+        trainHiddenBlock(writer, form, "fred", "");
 
         nested.close();
 
@@ -1038,7 +1038,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "barney");
+        trainHiddenBlock(writer, form, "fred", "barney");
 
         nested.close();
 
@@ -1123,7 +1123,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "");
+        trainHiddenBlock(writer, form, "fred", "");
         
         nested.close();
 
@@ -1189,7 +1189,7 @@
 
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "barney");
+        trainHiddenBlock(writer, form, "fred", "barney");
 
         nested.close();
 
@@ -1361,7 +1361,7 @@
         
         writer.println();
 
-        trainHiddenBlock(writer, "fred", "");
+        trainHiddenBlock(writer, form, "fred", "");
 
         nested.close();
 
@@ -1389,10 +1389,11 @@
         trainGetParameter(cycle, FormSupportImpl.RESERVED_FORM_IDS, reservedIds);
     }
 
-    protected void trainDiv(IMarkupWriter writer)
+    protected void trainDiv(IMarkupWriter writer, IForm form)
     {
         writer.begin("div");
         writer.attribute("style", "display:none;");
+        writer.attribute("id", form.getName() + "hidden");
     }
 
     private void trainFocus(PageRenderSupport support, IForm form)
@@ -1441,10 +1442,10 @@
         writer.println();
     }
 
-    protected void trainHiddenBlock(IMarkupWriter writer, String serviceName, String formIds)
+    protected void trainHiddenBlock(IMarkupWriter writer, IForm form, String serviceName,
String formIds)
     {
-        trainDiv(writer);
-
+        trainDiv(writer, form);
+        
         trainHidden(writer, "formids", formIds);
         trainHidden(writer, "service", serviceName);
         trainHidden(writer, "submitmode", "");

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestImageSubmit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestImageSubmit.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestImageSubmit.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestImageSubmit.java
Sun Jul  2 14:20:30 2006
@@ -96,6 +96,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "image");
         writer.attribute("name", "fred");
@@ -141,6 +143,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "image");
         writer.attribute("name", "fred");
@@ -183,6 +187,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "image");
         writer.attribute("name", "fred");
@@ -225,6 +231,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "image");
         writer.attribute("name", "barney$0");

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestSubmit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestSubmit.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestSubmit.java (original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestSubmit.java Sun
Jul  2 14:20:30 2006
@@ -86,6 +86,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "submit");
         writer.attribute("name", "fred");
@@ -127,6 +129,8 @@
 
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "submit");
         writer.attribute("name", "fred");
@@ -158,13 +162,15 @@
         trainGetDelegate(form, delegate);
 
         delegate.setFormComponent(submit);
-
+        
         trainGetElementId(form, submit, "fred");
 
         trainIsRewinding(form, false);
-
+        
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         writer.beginEmpty("input");
         writer.attribute("type", "submit");
         writer.attribute("name", "fred");

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextArea.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextArea.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextArea.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextArea.java
Sun Jul  2 14:20:30 2006
@@ -282,6 +282,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         trainGetDelegate(form, delegate);
@@ -332,6 +334,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
         
         expect(tfs.format(component, " text area value ")).andReturn("text area value");
@@ -384,6 +388,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         expect(tfs.format(component, " text area value ")).andReturn("text area value");
@@ -425,6 +431,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         expect(tfs.format(component, null)).andReturn("");

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextField.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextField.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/form/TestTextField.java
Sun Jul  2 14:20:30 2006
@@ -296,6 +296,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
         
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
         
         expect(tfs.format(component, new Integer(10))).andReturn("10");
@@ -345,6 +347,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         trainGetDelegate(form, delegate);
@@ -396,6 +400,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         trainGetDelegate(form, delegate);
@@ -451,6 +457,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
         
+        form.setFormFieldUpdating(true);
+        
         expect(tfs.format(component, new Integer(10))).andReturn("10");
         
         tfs.renderContributions(component, writer, cycle);
@@ -491,6 +499,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         delegate.setFormComponent(component);
 
         expect(tfs.format(component, null)).andReturn("");

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/valid/TestValidField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/valid/TestValidField.java?rev=418649&r1=418648&r2=418649&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/valid/TestValidField.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/valid/TestValidField.java
Sun Jul  2 14:20:30 2006
@@ -216,6 +216,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         trainToString(validator, component, value, "fred value");
 
         expect(validator.isRequired()).andReturn(false);
@@ -267,6 +269,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
         
+        form.setFormFieldUpdating(true);
+        
         trainToString(validator, component, null, null);
 
         expect(validator.isRequired()).andReturn(false);
@@ -314,6 +318,8 @@
         trainIsRewinding(form, false);
         trainIsRewinding(cycle, false);
 
+        form.setFormFieldUpdating(true);
+        
         expect(validator.isRequired()).andReturn(true);
 
         // Would be nice to have this do something so we could check the timing, but ...



Mime
View raw message