@Test
public void DeserializeDates()
{
OSD theSD = null;
OSDArray array = null;
OSDDate tempDate = null;
Date[] testDate = new Date[1];
String testSD = "<?xml version='1.0' encoding='UTF-8'?> \n" +
"<llsd> \n" +
"<array> \n" +
"<date>2006-02-01T14:29:53Z</date> \n" +
"<date>1999-01-01T00:00:00Z</date> \n" +
"<date/> \n" +
"</array> \n" +
"</llsd>";
//Deserialize the string
byte[] bytes = Utils.stringToBytes(testSD);
theSD =XmlLLSDOSDParser.DeserializeLLSDXml(bytes);
Assert.assertTrue(theSD instanceof OSDArray);
array = (OSDArray)theSD;
Assert.assertEquals(OSDType.Date, array.get(0).getType());
tempDate = (OSDDate)array.get(0);
Utils.tryParseDate("2006-02-01T14:29:53Z", testDate);
Assert.assertEquals(testDate[0], tempDate.asDate());
Assert.assertEquals(OSDType.Date, array.get(1).getType());
tempDate = (OSDDate)array.get(1);
Utils.tryParseDate("1999-01-01T00:00:00Z", testDate);
Assert.assertEquals(testDate[0], tempDate.asDate());
Assert.assertEquals(OSDType.Date, array.get(2).getType());
tempDate = (OSDDate)array.get(2);
Assert.assertEquals(Utils.Epoch, tempDate.asDate());
}