01: /*
02: * Copyright (C) 2005 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 14. May 2005 by Mauro Talevi
11: */
12: package com.thoughtworks.xstream.converters.extended;
13:
14: import com.thoughtworks.xstream.XStream;
15:
16: import junit.framework.TestCase;
17:
18: import java.util.Calendar;
19: import java.util.TimeZone;
20:
21: /**
22: * @author Jörg Schaible
23: */
24: public class GregorianCalendarConverterTest extends TestCase {
25:
26: public void testCalendar() {
27: final Calendar cal = Calendar.getInstance(TimeZone
28: .getTimeZone("UTC"));
29: final XStream xstream = new XStream();
30: final String xml = xstream.toXML(cal);
31: final Calendar serialized = (Calendar) xstream.fromXML(xml);
32: assertEquals(cal, serialized);
33: }
34:
35: }
|