Author: thrantal
Date: Sat Sep  6 13:48:21 2008
New Revision: 692733

URL: http://svn.apache.org/viewvc?rev=692733&view=rev
Log:
Added missing models to FileUpload fields. This should fix the build (see 
http://wicketstuff.org/teamcity/viewLog.html?tab=buildResultsDiv&buildTypeId=bt2&buildId=1448
 ).
However, I'm not sure how FileUploadField should work exactly. Should the 
constructor without a model throw an exception? Maybe not, because the model 
can be added after construction as well with setModel, and the code like the 
previous versions of these files should crash like it did.

- also added some missing Java 5 and Wicket 1.4 features in 
MockPageWithFormAndUploadField

Modified:
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/form/upload/MockPageWithFormAndUploadField.java
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java

Modified: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/form/upload/MockPageWithFormAndUploadField.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/form/upload/MockPageWithFormAndUploadField.java?rev=692733&r1=692732&r2=692733&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/form/upload/MockPageWithFormAndUploadField.java
 (original)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/form/upload/MockPageWithFormAndUploadField.java
 Sat Sep  6 13:48:21 2008
@@ -18,6 +18,7 @@
 
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.Model;
 
 /**
  * Mock page for use in the FileUploadFieldTest
@@ -50,7 +51,7 @@
                                fileUpload = fileUploadField.getFileUpload();
                        }
                };
-               fileUploadField = new FileUploadField("upload");
+               fileUploadField = new FileUploadField("upload", new 
Model<FileUpload>());
                form.add(fileUploadField);
                add(form);
        }

Modified: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java?rev=692733&r1=692732&r2=692733&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java
 (original)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/util/tester/MockFormFileUploadPage.java
 Sat Sep  6 13:48:21 2008
@@ -24,6 +24,7 @@
 import org.apache.wicket.markup.html.form.upload.FileUpload;
 import org.apache.wicket.markup.html.form.upload.FileUploadField;
 import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
 import org.apache.wicket.util.lang.Bytes;
 
 /**
@@ -75,11 +76,12 @@
        public MockFormFileUploadPage()
        {
                domainObject = new MockDomainObjectFileUpload();
-               Form form = new Form("form", new 
CompoundPropertyModel(domainObject))
+               Form<MockDomainObjectFileUpload> form = new 
Form<MockDomainObjectFileUpload>("form", new 
CompoundPropertyModel<MockDomainObjectFileUpload>(domainObject))
                {
                        private static final long serialVersionUID = 1L;
 
-                       protected void onSubmit()
+                       @Override
+            protected void onSubmit()
                        {
                                fileUpload = fileUploadField.getFileUpload();
                        }
@@ -87,8 +89,8 @@
                add(form);
                form.setMultiPart(true);
                form.setMaxSize(Bytes.kilobytes(100));
-               form.add(new TextField("text"));
-               fileUploadField = new FileUploadField("file");
+               form.add(new TextField<String>("text"));
+               fileUploadField = new FileUploadField("file", new 
Model<FileUpload>());
                fileUploadField.setRequired(true);
                form.add(fileUploadField);
        }


Reply via email to