You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/08/24 19:28:13 UTC

svn commit: r569460 - /wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java

Author: ehillenius
Date: Fri Aug 24 10:28:13 2007
New Revision: 569460

URL: http://svn.apache.org/viewvc?rev=569460&view=rev
Log:
fixed test so that it runs from e.g. eclipse as well. I'm not crazy about having to use a base dir btw, but I hope there was a good reason to introduce that.

Modified:
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java

Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java?rev=569460&r1=569459&r2=569460&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java Fri Aug 24 10:28:13 2007
@@ -69,35 +69,35 @@
 
 	/**
 	 * Test that the user can use
-	 * {@link FormTester#setFile(String, org.apache.wicket.util.file.File, String)} to test
-	 * that upload to a FileUploadField works.
+	 * {@link FormTester#setFile(String, org.apache.wicket.util.file.File, String)} to test that
+	 * upload to a FileUploadField works.
 	 */
 	public void testAddFile()
 	{
 		tester.startPage(MockFormFileUploadPage.class);
 		MockFormFileUploadPage page = (MockFormFileUploadPage)tester.getLastRenderedPage();
 		MockDomainObjectFileUpload domainObject = page.getDomainObject();
-	
+
 		tester.createRequestCycle();
-	
+
 		assertNull(page.getFileUpload());
 		assertNotNull(domainObject);
 		assertNull(domainObject.getText());
-	
-	
+
+
 		FormTester formTester = tester.newFormTester("form");
 		formTester.setFile("file", new File("pom.xml"), "text/xml");
 		formTester.setValue("text", "Mock value");
 		formTester.submit();
-	
-	
+
+
 		assertNotNull(domainObject);
 		assertNotNull(domainObject.getText());
 		assertEquals("Mock value", domainObject.getText());
-	
+
 		FileUpload fileUpload = page.getFileUpload();
 		assertNotNull(fileUpload);
-	
+
 		assertTrue("setFile failed, no upload content detected.", fileUpload.getBytes().length > 0);
 		assertEquals("pom.xml", fileUpload.getClientFileName());
 		assertEquals("text/xml", fileUpload.getContentType());
@@ -105,8 +105,8 @@
 
 	/**
 	 * Test that the user can use
-	 * {@link FormTester#setFile(String, org.apache.wicket.util.file.File, String)} to test
-	 * that upload to a FileUploadField works.
+	 * {@link FormTester#setFile(String, org.apache.wicket.util.file.File, String)} to test that
+	 * upload to a FileUploadField works.
 	 */
 	public void testAddBinaryFile()
 	{
@@ -122,7 +122,8 @@
 
 
 		FormTester formTester = tester.newFormTester("form");
-		formTester.setFile("file", new File(getBasedir() + "src/test/java/org/apache/wicket/util/tester/bg.jpg"), "image/jpeg");
+		formTester.setFile("file", new File(getBasedir() +
+				"src/test/java/org/apache/wicket/util/tester/bg.jpg"), "image/jpeg");
 		formTester.setValue("text", "Mock value");
 		formTester.submit();
 
@@ -134,14 +135,14 @@
 		FileUpload fileUpload = page.getFileUpload();
 		assertNotNull(fileUpload);
 
-		assertTrue("uploaded content does not have the right size, expected 428, got " + fileUpload.getBytes().length, fileUpload.getBytes().length == 428);
+		assertTrue("uploaded content does not have the right size, expected 428, got " +
+				fileUpload.getBytes().length, fileUpload.getBytes().length == 428);
 		assertEquals("bg.jpg", fileUpload.getClientFileName());
 		assertEquals("image/jpeg", fileUpload.getContentType());
 	}
 
 	/**
-	 * Test that formTester deal with Multipart form correctly when no actual
-	 * upload
+	 * Test that formTester deal with Multipart form correctly when no actual upload
 	 */
 	public void testSubmitWithoutUploadFile()
 	{



Re: svn commit: r569460 - /wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
* ehillenius@apache.org:
> Author: ehillenius
> Date: Fri Aug 24 10:28:13 2007
> New Revision: 569460
> 
> URL: http://svn.apache.org/viewvc?rev=569460&view=rev
> Log:
> fixed test so that it runs from e.g. eclipse as well. I'm not crazy about having to use a base dir btw, but I hope there was a good reason to introduce that.
> 
> Modified:
>     wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java
> 
> Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java
> URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java?rev=569460&r1=569459&r2=569460&view=diff
> ==============================================================================
> --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java (original)
> +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/util/tester/FormTesterTest.java Fri Aug 24 10:28:13 2007

(Hundred lines of diff snipped)

Hi Eelco,

Do you remember what you had to change?  I don't see any
difference.
-- 
     Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/