}
}
public void testTypeRoundTrips() throws Exception {
String URI = "commonj.sdo";
TypeHelper types = TypeHelper.INSTANCE;
List list = new ArrayList();
list.add("foo");
list.add("bar");
list.add("test");
Test[] tests = {
new Test(types.getType(URI, "Boolean"), "true", new Boolean(true)),
new Test(types.getType(URI, "Byte"), "49", new Byte((byte)49)),
new Test(types.getType(URI, "Bytes"), "Zm9v", "foo", new BytesComparator()),
new Test(types.getType(URI, "Character"), "a", new Character('a')),
new Test(types.getType(URI, "Date"), "2005-12-12Z", "2005-12-12Z", new DateComparator()),
new Test(types.getType(URI, "DateTime"), "2005-12-12T12:12:12Z", "2005-12-12T12:12:12Z"),
new Test(types.getType(URI, "Day"), "---12", "---12"),
new Test(types.getType(URI, "Decimal"), "12.12", new BigDecimal("12.12")),
new Test(types.getType(URI, "Double"), "12.12", new Double(12.12)),
new Test(types.getType(URI, "Duration"), "P5Y2M10D", "P5Y2M10D"),
new Test(types.getType(URI, "Float"), "12.12", new Float(12.12f)),
new Test(types.getType(URI, "Int"), "12", new Integer(12)),
new Test(types.getType(URI, "Integer"), "12", new BigInteger("12")),
new Test(types.getType(URI, "Long"), "12", new Long(12l)),
new Test(types.getType(URI, "Month"), "--12", "--12"),
new Test(types.getType(URI, "MonthDay"), "--12-12", "--12-12"),
new Test(types.getType(URI, "Object"), "test", "test"),
new Test(types.getType(URI, "Short"), "12", new Short((short)12)),
new Test(types.getType(URI, "String"), "test", "test"),
new Test(types.getType(URI, "Strings"), "foo bar test", list, new ListComparator()),
new Test(types.getType(URI, "Time"), "12:12:12.12", "12:12:12.12"),
new Test(types.getType(URI, "URI"), "http://example.org", "http://example.org"),
new Test(types.getType(URI, "Year"), "2005", "2005"),
new Test(types.getType(URI, "YearMonth"), "2005-12", "2005-12"),
new Test(types.getType(URI, "YearMonthDay"), "2005-12-12", "2005-12-12")
};
for (int n = 0; n < tests.length; n++) {
assertEquals(
SDOUtil.convertToString(tests[n].type, SDOUtil.createFromString(tests[n].type, tests[n].value)),