}
@Test
public void testTimeZoneConversion() throws Exception
{
Device modalityInChina = createDevice("modalityInChina", "modalityInChina");
modalityInChina.setTimeZoneOfDevice(TimeZone.getTimeZone("Asia/Shanghai"));
Device archiveInAustria = createDevice("archiveInAustria", "archiveInAustria");
archiveInAustria.setTimeZoneOfDevice(TimeZone.getTimeZone("Europe/Vienna"));
config.persist(modalityInChina);
config.persist(archiveInAustria);
TimeZone a = modalityInChina.getTimeZoneOfDevice();
TimeZone b = archiveInAustria.getTimeZoneOfDevice();
Attributes attr = new Attributes();
attr.setDefaultTimeZone(a);
attr.setDate(Tag.StudyDateAndTime, new Date(0));
assertEquals("Asia/Shanghai",attr.getTimeZone().getID());
assertEquals("19700101",attr.getString(Tag.StudyDate));