summaryrefslogtreecommitdiff
blob: 5dac1832afee093f3e27bdddd1911d0c161016d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Only in jvyaml-0.2.1-patched/: build
Files jvyaml-0.2.1/lib/jvyaml.jar and jvyaml-0.2.1-patched/lib/jvyaml.jar differ
diff -ru jvyaml-0.2.1/src/test/org/jvyaml/YAMLDumpTest.java jvyaml-0.2.1-patched/src/test/org/jvyaml/YAMLDumpTest.java
--- jvyaml-0.2.1/src/test/org/jvyaml/YAMLDumpTest.java	2006-09-24 13:07:19.000000000 -0400
+++ jvyaml-0.2.1-patched/src/test/org/jvyaml/YAMLDumpTest.java	2007-03-08 00:39:04.000000000 -0500
@@ -28,6 +28,8 @@
 import java.util.List;
 import java.util.HashMap;
 import java.util.ArrayList;
+import java.util.TimeZone;
+import java.text.DecimalFormat;
 
 import junit.framework.TestCase;
 
@@ -71,9 +73,18 @@
         final java.util.Calendar cal = java.util.Calendar.getInstance();
         cal.clear();
         cal.set(1982,5-1,3); // Java's months are zero-based...
+
+		// Nasty hack to figure out timezone so we can figure out what to
+		// expect when we do YAML#dump
+		TimeZone tz = cal.getTimeZone();
+		int offset = tz.getOffset(cal.getTimeInMillis()) / 3600000;
+		DecimalFormat format = new DecimalFormat("00");
+		String offsetString = format.format(offset);
+		offsetString = ( offset >= 0 ? "+" : "") + offsetString;
         
         final TestBean toDump = new TestBean("Ola Bini", 24, cal.getTime());
-        assertEquals("--- !java/object:org.jvyaml.TestBean\nname: Ola Bini\nage: 24\nborn: 1982-05-03 00:00:00 +02:00\n", YAML.dump(toDump));
+//		assertEquals("--- !java/object:org.jvyaml.TestBean\nname: Ola Bini\nage: 24\nborn: 1982-05-03 00:00:00 +02:00\n", YAML.dump(toDump));
+        assertEquals("--- !java/object:org.jvyaml.TestBean\nname: Ola Bini\nage: 24\nborn: 1982-05-03 00:00:00 " + offsetString + ":00\n", YAML.dump(toDump));
        
     }
 }// YAMLDumpTest