Revision: 658
          http://stripes.svn.sourceforge.net/stripes/?rev=658&view=rev
Author:   bengunter
Date:     2007-12-10 08:43:30 -0800 (Mon, 10 Dec 2007)

Log Message:
-----------
Intermittent failure in testSaveByCopy() was caused because 
testSaveIntoDirectoryThatDoesNotExistYet() was leaving behind a directory with 
the same name that testSaveByCopy() was trying to create as a text file. Fixed.

Modified Paths:
--------------
    trunk/tests/src/net/sourceforge/stripes/action/FileBeanTests.java

Modified: trunk/tests/src/net/sourceforge/stripes/action/FileBeanTests.java
===================================================================
--- trunk/tests/src/net/sourceforge/stripes/action/FileBeanTests.java   
2007-12-10 15:33:01 UTC (rev 657)
+++ trunk/tests/src/net/sourceforge/stripes/action/FileBeanTests.java   
2007-12-10 16:43:30 UTC (rev 658)
@@ -171,11 +171,17 @@
     @Test(groups="fast")
     public void testIntoDirectoryThatDoesNotExistYet() throws Exception {
         FileBean bean = new FileBean(from, "text/plain", "somefile.txt");
+        File realTo = this.to;
         this.to = new File(this.to, "somechild.txt");
-
-        bean.save(this.to);
-        Assert.assertTrue(this.to.exists());
-        Assert.assertFalse(this.from.exists());
-        assertContents(this.to);
+        try {
+            bean.save(this.to);
+            Assert.assertTrue(this.to.exists());
+            Assert.assertFalse(this.from.exists());
+            assertContents(this.to);
+        }
+        finally {
+            this.to.delete();
+            this.to = realTo;
+        }
     }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to