Author: jason.greene(a)jboss.com
Date: 2007-01-31 17:40:49 -0500 (Wed, 31 Jan 2007)
New Revision: 2227
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
Log:
MFT
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2007-01-31
22:36:40 UTC (rev 2226)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2007-01-31
22:40:49 UTC (rev 2227)
@@ -24,6 +24,7 @@
import java.io.StringWriter;
import java.util.Date;
import java.util.GregorianCalendar;
+import java.util.TimeZone;
import javax.xml.namespace.QName;
@@ -83,18 +84,27 @@
public void testMarshallSimpleUserTypeWithDate() throws Exception
{
- GregorianCalendar cal = new GregorianCalendar(1968, 11, 16);
- SimpleUserType obj = new SimpleUserType(1, 2, cal.getTime());
+ TimeZone tz = TimeZone.getDefault();
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ try
+ {
+ GregorianCalendar cal = new GregorianCalendar(1968, 11, 16);
+ SimpleUserType obj = new SimpleUserType(1, 2, cal.getTime());
- String exp =
- "<ns1:SimpleUser xmlns:ns1='" + TARGET_NAMESPACE + "'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
- " <a>1</a>" +
- " <b>2</b>" +
- " <d>1968-12-15T23:00:00.000Z</d>" +
- "</ns1:SimpleUser>";
+ String exp =
+ "<ns1:SimpleUser xmlns:ns1='" + TARGET_NAMESPACE +
"'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
+ " <a>1</a>" +
+ " <b>2</b>" +
+ " <d>1968-12-16T00:00:00.000Z</d>" +
+ "</ns1:SimpleUser>";
- String was = marshalSimpleType(obj);
- assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
+ String was = marshalSimpleType(obj);
+ assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
+ }
+ finally
+ {
+ TimeZone.setDefault(tz);
+ }
}
public void testMarshallSimpleUserTypeWithUserDate() throws Exception
@@ -106,21 +116,29 @@
super(date);
}
}
-
- GregorianCalendar cal = new GregorianCalendar(1968, 11, 16);
- UserDate userDate = new UserDate(cal.getTime().getTime());
- SimpleUserType obj = new SimpleUserType(1, 2, userDate);
+ TimeZone tz = TimeZone.getDefault();
+ TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
+ try
+ {
+ GregorianCalendar cal = new GregorianCalendar(1968, 11, 16);
+ UserDate userDate = new UserDate(cal.getTime().getTime());
+ SimpleUserType obj = new SimpleUserType(1, 2, userDate);
- String exp =
- "<ns1:SimpleUser xmlns:ns1='" + TARGET_NAMESPACE + "'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
- " <a>1</a>" +
- " <b>2</b>" +
- " <d>1968-12-15T23:00:00.000Z</d>" +
- "</ns1:SimpleUser>";
-
- System.out.println("FIXME: [JBWS-800] ClassCastException when trying to
marshal a SybaseTimestamp");
- //String was = marshalSimpleType(obj);
- //assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
+ String exp =
+ "<ns1:SimpleUser xmlns:ns1='" + TARGET_NAMESPACE +
"'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
+ " <a>1</a>" +
+ " <b>2</b>" +
+ " <d>1968-12-16T00:00:00.000Z</d>" +
+ "</ns1:SimpleUser>";
+
+ System.out.println("FIXME: [JBWS-800] ClassCastException when trying to
marshal a SybaseTimestamp");
+ //String was = marshalSimpleType(obj);
+ //assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
+ }
+ finally
+ {
+ TimeZone.setDefault(tz);
+ }
}
private String marshalSimpleType(SimpleUserType obj) throws Exception,
MarshalException