[kaffe] CVS kaffe (kaz): test/regression/DateFormatTest.java: Corrected a comment.
Kaffe CVS
cvs-commits at kaffe.org
Mon Dec 24 07:50:52 PST 2007
PatchSet 7620
Date: 2007/12/24 15:49:31
Author: kaz
Branch: HEAD
Tag: (none)
Log:
2007-12-24 Ito Kazumitsu <kaz at maczuka.gcd.org>
* test/regression/DateFormatTest.java: Corrected a comment.
Members:
ChangeLog:1.5118->1.5119
test/regression/DateFormatTest.java:INITIAL->1.4
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5118 kaffe/ChangeLog:1.5119
--- kaffe/ChangeLog:1.5118 Mon Dec 24 00:43:37 2007
+++ kaffe/ChangeLog Mon Dec 24 15:49:31 2007
@@ -1,3 +1,7 @@
+2007-12-24 Ito Kazumitsu <kaz at maczuka.gcd.org>
+
+ * test/regression/DateFormatTest.java: Corrected a comment.
+
2007-12-24 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/systems/unix-jthreads/jthread.c (start_this_sucker_on_a_new_frame):
===================================================================
Checking out kaffe/test/regression/DateFormatTest.java
RCS: /home/cvs/kaffe/kaffe/test/regression/DateFormatTest.java,v
VERS: 1.4
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/test/regression/DateFormatTest.java Mon Dec 24 15:50:51 2007
@@ -0,0 +1,64 @@
+
+import java.util.Date;
+import java.util.SimpleTimeZone;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+public class DateFormatTest
+{
+ public static void main(String args[])
+ throws Exception
+ {
+ SimpleDateFormat sdf;
+ String str;
+ Date date;
+
+ System.out.println("Same time zone");
+ sdf = new SimpleDateFormat("yyMMddHHmmssSSS");
+ date = new Date(1098968427000L); // 04-10-28 13:00:27 GMT+00:00
+ str = sdf.format(date);
+
+ try {
+ if( !date.equals(sdf.parse(str)) )
+ {
+ System.out.println("Dates don't match? "
+ + date
+ + " != "
+ + sdf.parse(str));
+ }
+ }
+ catch (ParseException e) {
+ System.err.println("Parse error at position " + e.getErrorOffset());
+ e.printStackTrace();
+ }
+
+ SimpleTimeZone tz = new SimpleTimeZone(0, "Z");
+ SimpleDateFormat sdf2;
+
+ System.out.println("Different time zone");
+ sdf.setTimeZone(tz);
+ str = sdf.format(date);
+ str += "GMT+00:00";
+ sdf2 = new SimpleDateFormat("yyMMddHHmmssSSSz");
+
+ try {
+ if( !date.equals(sdf2.parse(str)) )
+ {
+ System.out.println("Dates don't match? "
+ + date
+ + " != "
+ + sdf2.parse(str));
+ }
+ }
+ catch (ParseException e) {
+ System.err.println("Parse error at position " + e.getErrorOffset());
+ e.printStackTrace();
+ }
+ }
+}
+
+/* Expected Output:
+Same time zone
+Different time zone
+*/
More information about the kaffe
mailing list