CVS: Tapestry/junit/src/net/sf/tapestry/junit/valid TestDateValidator.java,1.4,1.4.2.1

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/valid
In directory sc8-pr-cvs1:/tmp/cvs-serv28564/junit/src/net/sf/tapestry/junit/valid

Modified Files:
      Tag: hship-2-3
	TestDateValidator.java 
Log Message:
Fix some of the test cases to work properly under JDK 1.3.

Index: TestDateValidator.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/valid/TestDateValidator.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** TestDateValidator.java	27 Nov 2002 17:58:50 -0000	1.4
--- TestDateValidator.java	5 Jan 2003 00:24:51 -0000	1.4.2.1
***************
*** 7,11 ****
--- 7,15 ----
  import java.util.Locale;
  
+ import com.jrefinery.ui.about.SystemProperties;
+ 
  import junit.framework.TestCase;
+ 
+ import net.sf.tapestry.junit.TapestryTestCase;
  import net.sf.tapestry.valid.DateValidator;
  import net.sf.tapestry.valid.ValidationConstraint;
***************
*** 22,26 ****
   **/
  
! public class TestDateValidator extends TestCase
  {
      private Calendar calendar = new GregorianCalendar();
--- 26,30 ----
   **/
  
! public class TestDateValidator extends TapestryTestCase
  {
      private Calendar calendar = new GregorianCalendar();
***************
*** 66,70 ****
          String out = v.toString(null, buildDate(Calendar.DECEMBER, 8, 2001));
  
!         assertEquals("Result.", "08.12.01", out);
      }
  
--- 70,79 ----
          String out = v.toString(null, buildDate(Calendar.DECEMBER, 8, 2001));
  
!         // JDK 1.3 does not inlcude a german localization, so we'll get the
!         // default, US English, localization of the date format.
! 
!         String expected = IS_JDK13 ? "12/8/01" : "08.12.01";
! 
!         assertEquals("Result.", expected, out);
      }
  
***************
*** 103,107 ****
          v.setFormat(format);
  
!         Object out = v.toObject(null, "08.12.01");
  
          assertEquals("Result.", buildDate(Calendar.DECEMBER, 8, 2001), out);
--- 112,120 ----
          v.setFormat(format);
  
!         // Again, adjust for missing German localization in JDK 1.3
! 
!         String value = IS_JDK13 ? "12/8/2001" : "08.12.01";
! 
!         Object out = v.toObject(null, value);
  
          assertEquals("Result.", buildDate(Calendar.DECEMBER, 8, 2001), out);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.