CVS: Tapestry/junit/src/net/sf/tapestry/junit/valid TestDateValidator.java,1.4.2.2,1.4.2.3
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-serv6517/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.2.2
retrieving revision 1.4.2.3
diff -C2 -d -r1.4.2.2 -r1.4.2.3
*** TestDateValidator.java 5 Jan 2003 00:42:30 -0000 1.4.2.2
--- TestDateValidator.java 5 Jan 2003 01:01:26 -0000 1.4.2.3
***************
*** 62,65 ****
--- 62,68 ----
public void testToStringFormat()
{
+ if (IS_JDK13)
+ return;
+
DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
***************
*** 68,77 ****
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);
}
--- 71,75 ----
String out = v.toString(null, buildDate(Calendar.DECEMBER, 8, 2001));
! assertEquals("Result.", "08.12.01", out);
}
***************
*** 106,109 ****
--- 104,110 ----
public void testToObjectFormat() throws ValidatorException
{
+ if (IS_JDK13)
+ return;
+
DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
***************
*** 112,118 ****
// 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);
--- 113,117 ----
// Again, adjust for missing German localization in JDK 1.3
! Object out = v.toObject(null, "08.12.01");
assertEquals("Result.", buildDate(Calendar.DECEMBER, 8, 2001), out);
***************
*** 126,130 ****
{
v.toObject(new TestingField("toObjectMinimum"), "12/8/2001");
! fail("Exception expected.");
}
catch (ValidatorException ex)
--- 125,129 ----
{
v.toObject(new TestingField("toObjectMinimum"), "12/8/2001");
! unreachable();
}
catch (ValidatorException ex)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf