Thank you Erik.  I've applied your patch, worked great.
-t

On Jan 2, 2007, at 6:14 PM, Erik Lumpkin wrote:

Tim,
I was looking at some of the Stripes code and running the tests to learn a bit about some of the inner workings and found a bug that appears to be related to the fact that it's now 2007. It's not a hard fix, but I figured I'd pass along the patch to save you 5 seconds of your life.

I've never shared a patch, so I could be doing this the most inefficient way possible. It's listed below and is for the class net.sourceforge.stripes.validation.DateTypeConverterTest in the 'tests' project.

-Erik

Index: .
===================================================================
--- .    (revision 815)
+++ .    (working copy)
@@ -7,6 +7,7 @@
 import java.util.Collection;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.Calendar;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;

@@ -153,7 +154,8 @@
         Date date = converter.convert("Jan 31", Date.class, errors);
         Assert.assertNotNull(date);
         Assert.assertEquals(0, errors.size());
-        Assert.assertEquals(format.format(date), "01/31/2006");
+        Assert.assertEquals(format.format(date), "01/31/"
+                + Calendar.getInstance().get( Calendar.YEAR ) );

         date = converter.convert("February 28", Date.class, errors);
         Assert.assertNotNull(date);
@@ -158,7 +160,8 @@
         date = converter.convert("February 28", Date.class, errors);
         Assert.assertNotNull(date);
         Assert.assertEquals(0, errors.size());
-        Assert.assertEquals(format.format(date), "02/28/2006");
+        Assert.assertEquals(format.format(date), "02/28/"
+                + Calendar.getInstance().get( Calendar.YEAR ) );

         date = converter.convert("03/01", Date.class, errors);
         Assert.assertNotNull(date);
@@ -163,7 +166,8 @@
         date = converter.convert("03/01", Date.class, errors);
         Assert.assertNotNull(date);
         Assert.assertEquals(0, errors.size());
-        Assert.assertEquals(format.format(date), "03/01/2006");
+        Assert.assertEquals(format.format(date), "03/01/"
+                + Calendar.getInstance().get( Calendar.YEAR ) );
     }

     @Test(groups="fast")



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------- ---
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php? page=join.php&p=sourceforge&CID=DEVDEV________________________________ _______________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to