* Set up a quarter equal to Q1 1900. Request the previous quarter, it
* should be null.
*/
public void testClone() {
TimePeriodValues series = new TimePeriodValues("Test Series");
RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
try {
series.add(jan1st2002, new Integer(42));
}
catch (SeriesException e) {
System.err.println("Problem adding to collection.");
}
TimePeriodValues clone = null;
try {
clone = (TimePeriodValues) series.clone();
clone.setKey("Clone Series");
try {
clone.update(0, new Integer(10));
}
catch (SeriesException e) {
System.err.println("Problem updating series.");
}
}
catch (CloneNotSupportedException e) {
assertTrue(false);
}
int seriesValue = series.getValue(0).intValue();
int cloneValue = clone.getValue(0).intValue();
assertEquals(42, seriesValue);
assertEquals(10, cloneValue);
assertEquals("Test Series", series.getKey());
assertEquals("Clone Series", clone.getKey());
}