tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r548131 - in /tapestry/tapestry4/trunk: ./ tapestry-framework/src/test/org/apache/tapestry/ tapestry-framework/src/test/org/apache/tapestry/form/ tapestry-framework/src/test/org/apache/tapestry/valid/
Date Sun, 17 Jun 2007 22:26:32 GMT
Author: jkuhnert
Date: Sun Jun 17 15:26:31 2007
New Revision: 548131

URL: http://svn.apache.org/viewvc?view=rev&rev=548131
Log:
Updated dependency to tapestry-test && fixed resultant errors from redundant mock
calls no longer needed with non strict mock controls.

Modified:
    tapestry/tapestry4/trunk/pom.xml
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/TapestryUtilsTest.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestCheckbox.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestPropertySelection.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextArea.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextField.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/valid/TestValidField.java

Modified: tapestry/tapestry4/trunk/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/pom.xml?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/pom.xml (original)
+++ tapestry/tapestry4/trunk/pom.xml Sun Jun 17 15:26:31 2007
@@ -201,7 +201,7 @@
             <dependency>
                 <groupId>org.apache.tapestry</groupId>
                 <artifactId>tapestry-test</artifactId>
-                <version>4.1.2-SNAPSHOT</version>
+                <version>4.1.2</version>
                 <scope>test</scope>
             </dependency>
             <dependency>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/TapestryUtilsTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/TapestryUtilsTest.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/TapestryUtilsTest.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/TapestryUtilsTest.java
Sun Jun 17 15:26:31 2007
@@ -14,10 +14,9 @@
 
 package org.apache.tapestry;
 
-import static org.easymock.EasyMock.expect;
-
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.Location;
+import static org.easymock.EasyMock.expect;
 import org.testng.annotations.Test;
 
 /**
@@ -141,16 +140,13 @@
     public void testGetPageRenderSupportFailure()
     {
         IComponent component = newMock(IComponent.class);
-        
         IRequestCycle cycle = newCycle(TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE, null);
         
         expect(component.getExtendedId()).andReturn("Foo/bar").anyTimes();
         
         Location l = newLocation();
         expect(component.getLocation()).andReturn(l);
-        
-        expect(component.getExtendedId()).andReturn("Foo/bar").anyTimes();
-        
+
         replay();
 
         try
@@ -174,12 +170,9 @@
         
         IRequestCycle cycle = newCycle(TapestryUtils.FORM_ATTRIBUTE, null);
         
-        expect(component.getExtendedId()).andReturn("Foo/bar").anyTimes();
-        
+        expect(component.getExtendedId()).andReturn("Foo/bar").anyTimes();        
         expect(component.getLocation()).andReturn(l);
 
-        expect(component.getExtendedId()).andReturn("Foo/bar").anyTimes();
-        
         replay();
 
         try

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestCheckbox.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestCheckbox.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestCheckbox.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestCheckbox.java
Sun Jun 17 15:26:31 2007
@@ -14,9 +14,6 @@
 
 package org.apache.tapestry.form;
 
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-
 import org.apache.tapestry.IBinding;
 import org.apache.tapestry.IForm;
 import org.apache.tapestry.IMarkupWriter;
@@ -25,6 +22,8 @@
 import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.valid.ValidationConstants;
 import org.apache.tapestry.valid.ValidatorException;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
 import org.testng.annotations.Test;
 
 /**
@@ -67,23 +66,13 @@
         expect(cycle.isRewinding()).andReturn(false);
         
         form.setFormFieldUpdating(true);
-        
-        trainGetDelegate(form, delegate);
-        
+
         delegate.writePrefix(writer, cycle, cb, null);
         expect(delegate.isInError()).andReturn(false).anyTimes();
-        
-        trainGetDelegate(form, delegate);
-        expect(delegate.isInError()).andReturn(false);
-        
+
         vfs.renderContributions(cb, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         delegate.writeSuffix(writer, cycle, cb, null);
-        
-        expect(delegate.isInError()).andReturn(false);
-        
+
         delegate.registerForFocus(cb, ValidationConstants.NORMAL_FIELD);
         
         expect(cycle.renderStackPop()).andReturn(cb);
@@ -102,9 +91,8 @@
         IForm form = newMock(IForm.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
         
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "name", "assignedName", "disabled", Boolean.TRUE, 
-            "form",  form, "validatableFieldSupport", vfs});
+        Checkbox cb = newInstance(Checkbox.class, "name", "assignedName", "disabled", Boolean.TRUE,
+                                  "form", form, "validatableFieldSupport", vfs);
         
         IMarkupWriter writer = newBufferWriter();
         IRequestCycle cycle = newCycle();
@@ -114,13 +102,8 @@
         trainGetDelegate(form, delegate);
         delegate.writePrefix(writer, cycle, cb, null);
         
-        trainGetDelegate(form, delegate);
         expect(delegate.isInError()).andReturn(false);
-        
-        vfs.renderContributions(cb, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
+        vfs.renderContributions(cb, writer, cycle);        
         delegate.writeSuffix(writer, cycle, cb, null);
         
         replay();
@@ -137,10 +120,9 @@
         IForm form = newMock(IForm.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
         
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "name", "assignedName", "value", Boolean.TRUE, "specification",
-                new ComponentSpecification(),
-                "form",  form, "validatableFieldSupport", vfs});
+        Checkbox cb = newInstance(Checkbox.class, "name", "assignedName", "value", Boolean.TRUE,
"specification",
+                                  new ComponentSpecification(),
+                                  "form", form, "validatableFieldSupport", vfs);
         
         IMarkupWriter writer = newBufferWriter();
         IRequestCycle cycle = newCycle();
@@ -174,9 +156,13 @@
         IForm form = newMock(IForm.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
         
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "id", "foo", "clientId", "assignedName", "name", "assignedName", "value", Boolean.TRUE,
-            "form",  form, "validatableFieldSupport", vfs});
+        Checkbox cb = newInstance(Checkbox.class,
+                                  "id", "foo",
+                                  "clientId", "assignedName",
+                                  "name", "assignedName",
+                                  "value", Boolean.TRUE,
+                                  "form", form,
+                                  "validatableFieldSupport", vfs);
         
         IMarkupWriter writer = newBufferWriter();
         IRequestCycle cycle = newCycle();
@@ -185,15 +171,9 @@
         trainGetDelegate(form, delegate);
         
         delegate.writePrefix(writer, cycle, cb, null);
-        
-        trainGetDelegate(form, delegate);
-        
+
         expect(delegate.isInError()).andReturn(false).anyTimes();
-        
         vfs.renderContributions(cb, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         delegate.writeSuffix(writer, cycle, cb, null);
         
         replay();
@@ -209,8 +189,10 @@
     {
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
     	
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "value", Boolean.TRUE, "name", "checkbox", "validatableFieldSupport", vfs });
+        Checkbox cb = newInstance(Checkbox.class,
+                                  "value", Boolean.TRUE,
+                                  "name", "checkbox",
+                                  "validatableFieldSupport", vfs);
 
         IMarkupWriter writer = newWriter();
         IRequestCycle cycle = newCycleGetParameter("checkbox", null);
@@ -233,6 +215,7 @@
         assertEquals(false, cb.getValue());
     }
 
+    @SuppressWarnings("ALL")
     public void test_Submit_Validate_Failed()
     {
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
@@ -240,8 +223,11 @@
         
         IValidationDelegate delegate = newDelegate();
         
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "form", form, "value", Boolean.FALSE, "name", "checkbox", "validatableFieldSupport",
vfs });
+        Checkbox cb = newInstance(Checkbox.class,
+                                  "form", form,
+                                  "value", Boolean.FALSE,
+                                  "name", "checkbox",
+                                  "validatableFieldSupport", vfs);
 
         IMarkupWriter writer = newWriter();
         IRequestCycle cycle = newCycleGetParameter("checkbox", "foo");
@@ -277,8 +263,10 @@
     {
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
         
-        Checkbox cb = newInstance(Checkbox.class, new Object[]
-        { "value", Boolean.FALSE, "name", "checkbox", "validatableFieldSupport", vfs });
+        Checkbox cb = newInstance(Checkbox.class,
+                                  "value", Boolean.FALSE,
+                                  "name", "checkbox",
+                                  "validatableFieldSupport", vfs);
 
         IMarkupWriter writer = newWriter();
         IRequestCycle cycle = newCycleGetParameter("checkbox", "foo");

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestPropertySelection.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestPropertySelection.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestPropertySelection.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestPropertySelection.java
Sun Jun 17 15:26:31 2007
@@ -13,13 +13,12 @@
 // limitations under the License.
 package org.apache.tapestry.form;
 
-import static org.easymock.EasyMock.expect;
-
 import org.apache.tapestry.IForm;
 import org.apache.tapestry.IMarkupWriter;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.valid.ValidatorException;
+import static org.easymock.EasyMock.expect;
 import org.testng.annotations.Test;
 
 /**
@@ -99,14 +98,12 @@
         IPropertySelectionModel model = new StringPropertySelectionModel(new String[] { "One",
"Two", "Three" }, 
                 new boolean[] {false, false, true});
         
-        PropertySelection component = newInstance(PropertySelection.class, 
-                new Object[]  { 
-            "id", "hannah",
-            "validatableFieldSupport", vfs,
-            "model", model,
-            "value", "One",
-            "optionRenderer", DefaultOptionRenderer.DEFAULT_INSTANCE
-        });
+        PropertySelection component = newInstance(PropertySelection.class,
+                                                  "id", "hannah",
+                                                  "validatableFieldSupport", vfs,
+                                                  "model", model,
+                                                  "value", "One",
+                                                  "optionRenderer", DefaultOptionRenderer.DEFAULT_INSTANCE);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -123,12 +120,7 @@
         form.setFormFieldUpdating(true);
         
         delegate.setFormComponent(component);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextArea.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextArea.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextArea.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextArea.java
Sun Jun 17 15:26:31 2007
@@ -14,9 +14,6 @@
 
 package org.apache.tapestry.form;
 
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-
 import org.apache.tapestry.IBinding;
 import org.apache.tapestry.IForm;
 import org.apache.tapestry.IMarkupWriter;
@@ -24,6 +21,8 @@
 import org.apache.tapestry.spec.ComponentSpecification;
 import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.valid.ValidatorException;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
 import org.testng.annotations.Test;
 
 /**
@@ -85,13 +84,13 @@
         assertEquals("text area value", component.getValue());
     }
 
+    @SuppressWarnings("ALL")
     public void testRewindTranslateFailed()
     {
         TranslatedFieldSupport tfs = newMock(TranslatedFieldSupport.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextArea component = newInstance(TextArea.class, "translatedFieldSupport", tfs, "validatableFieldSupport",
vfs);
         
         IRequestCycle cycle = newCycle();
         IForm form = newMock(IForm.class);
@@ -124,7 +123,6 @@
             unreachable();
         }
         
-        trainGetDelegate(form, delegate);
         delegate.record(exception);
         
         expect(cycle.renderStackPop()).andReturn(component);
@@ -138,13 +136,13 @@
         assertNull(component.getValue());
     }
 
+    @SuppressWarnings("ALL")
     public void testRewindValidateFailed()
     {
         TranslatedFieldSupport tfs = newMock(TranslatedFieldSupport.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextArea component = newInstance(TextArea.class, "translatedFieldSupport", tfs, "validatableFieldSupport",
vfs);
         
         IRequestCycle cycle = newCycle();
         IForm form = newMock(IForm.class);
@@ -180,7 +178,6 @@
             unreachable();
         }
         
-        trainGetDelegate(form, delegate);
         delegate.record(exception);
         
         expect(cycle.renderStackPop()).andReturn(component);
@@ -291,8 +288,11 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs,
"value", " text area value " });
+        TextArea component = newInstance(TextArea.class,
+                                         "name", "fred",
+                                         "translatedFieldSupport", tfs,
+                                         "validatableFieldSupport", vfs,
+                                         "value", " text area value ");
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -307,22 +307,11 @@
         trainIsRewinding(cycle, false);
 
         form.setFormFieldUpdating(true);
-        
         delegate.setFormComponent(component);
 
-        trainGetDelegate(form, delegate);
-
         expect(tfs.format(component, " text area value ")).andReturn("text area value");
-        
-        trainGetDelegate(form, delegate);
-        
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -347,8 +336,12 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs,
"value", " text area value ", "disabled", Boolean.TRUE });
+        TextArea component = newInstance(TextArea.class,
+                                         "name", "fred",
+                                         "translatedFieldSupport", tfs,
+                                         "validatableFieldSupport", vfs,
+                                         "value", " text area value ",
+                                         "disabled", Boolean.TRUE);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -367,16 +360,8 @@
         delegate.setFormComponent(component);
         
         expect(tfs.format(component, " text area value ")).andReturn("text area value");
-        
-        trainGetDelegate(form, delegate);
-        
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -403,8 +388,12 @@
 
         IBinding binding = newBinding("informal-value");
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs,
"value", " text area value ", "specification", new ComponentSpecification() });
+        TextArea component = newInstance(TextArea.class,
+                                         "name", "fred",
+                                         "translatedFieldSupport", tfs,
+                                         "validatableFieldSupport", vfs,
+                                         "value", " text area value ",
+                                         "specification", new ComponentSpecification());
 
         component.setBinding("informal", binding);
         
@@ -452,8 +441,10 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextArea component = newInstance(TextArea.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextArea component = newInstance(TextArea.class,
+                                         "name", "fred",
+                                         "translatedFieldSupport", tfs,
+                                         "validatableFieldSupport", vfs);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -471,17 +462,9 @@
         
         delegate.setFormComponent(component);
 
-        expect(tfs.format(component, null)).andReturn("");
-        
-        trainGetDelegate(form, delegate);
-        
+        expect(tfs.format(component, null)).andReturn("");        
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextField.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextField.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/form/TestTextField.java
Sun Jun 17 15:26:31 2007
@@ -14,9 +14,6 @@
 
 package org.apache.tapestry.form;
 
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-
 import org.apache.hivemind.util.PropertyUtils;
 import org.apache.tapestry.IBinding;
 import org.apache.tapestry.IForm;
@@ -25,6 +22,8 @@
 import org.apache.tapestry.spec.ComponentSpecification;
 import org.apache.tapestry.valid.IValidationDelegate;
 import org.apache.tapestry.valid.ValidatorException;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
 import org.testng.annotations.Test;
 
 /**
@@ -89,13 +88,13 @@
         assertEquals(value, component.getValue());
     }
 
+    @SuppressWarnings("ALL")
     public void testRewindTranslateFailed()
     {
         TranslatedFieldSupport tfs = newMock(TranslatedFieldSupport.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextField component = newInstance(TextField.class, "translatedFieldSupport", tfs,
"validatableFieldSupport", vfs);
 
         IRequestCycle cycle = newCycle();
         
@@ -129,7 +128,6 @@
             unreachable();
         }
         
-        trainGetDelegate(form, delegate);
         delegate.record(exception);
         
         expect(cycle.renderStackPop()).andReturn(component);
@@ -143,33 +141,28 @@
         assertNull(component.getValue());
     }
 
+    @SuppressWarnings("ALL")
     public void testRewindValidateFailed()
     {
         TranslatedFieldSupport tfs = newMock(TranslatedFieldSupport.class);
         ValidatableFieldSupport vfs = newMock(ValidatableFieldSupport.class);
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextField component = newInstance(TextField.class, "translatedFieldSupport", tfs,
"validatableFieldSupport", vfs);
 
         IRequestCycle cycle = newCycle();
-        
         IForm form = newMock(IForm.class);
-
         IMarkupWriter writer = newWriter();
-
         IValidationDelegate delegate = newDelegate();
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
         trainGetForm(cycle, form);
         trainWasPrerendered(form, writer, component, false);
-        trainGetDelegate(form, delegate);
 
         delegate.setFormComponent(component);
 
         trainGetElementId(form, component, "barney");
         trainIsRewinding(form, true);
-
         trainGetParameter(cycle, "barney", "10");
 
         ValidatorException exception = new ValidatorException("test");
@@ -188,8 +181,8 @@
             unreachable();
         }
         
-        trainGetDelegate(form, delegate);
         delegate.record(exception);
+        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -306,8 +299,11 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "id", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs, "value",
new Integer(10) });
+        TextField component = newInstance(TextField.class,
+                                          "id", "fred",
+                                          "translatedFieldSupport", tfs,
+                                          "validatableFieldSupport", vfs,
+                                          "value", 10);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -325,17 +321,10 @@
         
         delegate.setFormComponent(component);
         
-        expect(tfs.format(component, new Integer(10))).andReturn("10");
-        
-        trainGetDelegate(form, delegate);
-        
+        expect(tfs.format(component, 10)).andReturn("10");
+
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -362,10 +351,9 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, 
-            "validatableFieldSupport", vfs, "value", 
-            new Integer(10), "hidden", Boolean.TRUE });
+        TextField component = newInstance(TextField.class, "name", "fred", "translatedFieldSupport",
tfs,
+                                          "validatableFieldSupport", vfs, "value",
+                                          10, "hidden", Boolean.TRUE);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -380,22 +368,11 @@
         trainIsRewinding(cycle, false);
 
         form.setFormFieldUpdating(true);
-        
         delegate.setFormComponent(component);
 
-        trainGetDelegate(form, delegate);
-
-        expect(tfs.format(component, new Integer(10))).andReturn("10");
-        
-        trainGetDelegate(form, delegate);
-        
+        expect(tfs.format(component, 10)).andReturn("10");
         tfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -422,10 +399,9 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, 
-            "validatableFieldSupport", vfs, "value", new Integer(10), 
-            "disabled", Boolean.TRUE });
+        TextField component = newInstance(TextField.class, "name", "fred", "translatedFieldSupport",
tfs,
+                                          "validatableFieldSupport", vfs, "value", new Integer(10),
+                                          "disabled", Boolean.TRUE);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -440,22 +416,12 @@
         trainIsRewinding(cycle, false);
 
         form.setFormFieldUpdating(true);
-        
         delegate.setFormComponent(component);
 
-        trainGetDelegate(form, delegate);
-
-        expect(tfs.format(component, new Integer(10))).andReturn("10");
-        
-        trainGetDelegate(form, delegate);
+        expect(tfs.format(component, 10)).andReturn("10");
         
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         
@@ -535,8 +501,10 @@
 
         MockDelegate delegate = new MockDelegate();
 
-        TextField component = newInstance(TextField.class, new Object[]
-        { "name", "fred", "translatedFieldSupport", tfs, "validatableFieldSupport", vfs });
+        TextField component = newInstance(TextField.class,
+                                          "name", "fred",
+                                          "translatedFieldSupport", tfs,
+                                          "validatableFieldSupport", vfs);
         
         expect(cycle.renderStackPush(component)).andReturn(component);
         
@@ -553,18 +521,10 @@
         form.setFormFieldUpdating(true);
         
         delegate.setFormComponent(component);
-
         expect(tfs.format(component, null)).andReturn("");
-        
-        trainGetDelegate(form, delegate);
-        
+
         tfs.renderContributions(component, writer, cycle);
-        
-        trainGetDelegate(form, delegate);
-        
         vfs.renderContributions(component, writer, cycle);
-
-        trainGetDelegate(form, delegate);
         
         expect(cycle.renderStackPop()).andReturn(component);
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/valid/TestValidField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/valid/TestValidField.java?view=diff&rev=548131&r1=548130&r2=548131
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/valid/TestValidField.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/valid/TestValidField.java
Sun Jun 17 15:26:31 2007
@@ -14,21 +14,15 @@
 
 package org.apache.tapestry.valid;
 
-import static org.easymock.EasyMock.checkOrder;
-import static org.easymock.EasyMock.expect;
-
 import org.apache.hivemind.Location;
 import org.apache.hivemind.util.PropertyUtils;
-import org.apache.tapestry.BindingException;
-import org.apache.tapestry.IBinding;
-import org.apache.tapestry.IForm;
-import org.apache.tapestry.IMarkupWriter;
-import org.apache.tapestry.IPage;
-import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.*;
 import org.apache.tapestry.form.BaseFormComponentTestCase;
 import org.apache.tapestry.form.IFormComponent;
 import org.apache.tapestry.form.MockDelegate;
 import org.apache.tapestry.html.BasePage;
+import static org.easymock.EasyMock.checkOrder;
+import static org.easymock.EasyMock.expect;
 import org.testng.annotations.Test;
 
 /**
@@ -134,8 +128,6 @@
         trainIsRewinding(form, true);
 
         trainGetParameter(cycle, "fred", "fred-value");
-
-        trainGetDelegate(form, delegate);
 
         delegate.recordFieldInputValue("fred-value");
 



Mime
View raw message