* @throws IOException Signals an error with the XMP processing.
*/
public void testDateList() throws IOException
{
XMPMetadata xmp = new XMPMetadata();
XMPSchema schema = new XMPSchema(xmp, "test", "http://test.com/test");
Calendar c1 = Calendar.getInstance();
c1.set(1999, 11, 31, 0, 0, 0);
c1.set(Calendar.MILLISECOND, 0);
Calendar c2 = Calendar.getInstance();
c2.set(2000, 11, 31, 0, 0, 0);
c2.set(Calendar.MILLISECOND, 0);
// System.out.println( DateConverter.toISO8601(c1));
schema.addSequenceDateValue("test:importantDates", c1);
schema.addSequenceDateValue("test:importantDates", c2);
List<Calendar> l = schema.getSequenceDateList("test:importantDates");
assertEquals(2, l.size());
assertEquals(c1, (Calendar) l.get(0));
assertEquals(c2, (Calendar) l.get(1));
schema.removeSequenceDateValue("test:importantDates", c1);
l = schema.getSequenceDateList("test:importantDates");
assertEquals(1, l.size());
assertEquals(c2, (Calendar) l.get(0));
// Already removed
schema.removeSequenceDateValue("test:importantDates", c1);
l = schema.getSequenceDateList("test:importantDates");
assertEquals(1, l.size());
assertEquals(c2, (Calendar) l.get(0));
// Duplicates Allowed
schema.addSequenceDateValue("test:importantDates", c2);
l = schema.getSequenceDateList("test:importantDates");
assertEquals(2, l.size());
assertEquals(c2, (Calendar) l.get(0));
assertEquals(c2, (Calendar) l.get(1));
// Remvoes all
schema.removeSequenceDateValue("test:importantDates", c2);
l = schema.getSequenceDateList("test:importantDates");
assertEquals(0, l.size());
}