TeradataTimestampPeriod extends DbStruct { @Override public String toString() { String r = ""; try { Object[] a = super.getAttributes(); for (int i = 0; i < a.length; i++) { if (i > 0) r = r + ","; r = r + a[i].toString(); } } catch (SQLException e){ System.out.println("TeradataTimestampPeriod: toString: caught exception"); } return r; } TeradataTimestampPeriod(Object[] dates); @Override String toString(); @Override boolean equals(Object other);  }
@Test public void toStringTest() { String fromStr = "2012-11-11 01:23:45"; String toStr = "2014-06-02 12:13:14"; java.sql.Timestamp F = null; java.sql.Timestamp T = null; try { F = (java.sql.Timestamp) SqlTimestampParseDelegate.parse(fromStr); T = (java.sql.Timestamp) SqlTimestampParseDelegate.parse(toStr); } catch (Exception e) { throw new Error("Parsing timestamp literals"); } Object[] range = { F, T }; TeradataDatePeriod tdp = new TeradataDatePeriod(range); assertEquals("TimestampPeriod toString() return unexpected value", F.toString() + "," + T.toString(), tdp.toString()); }