}
@Test
public void testAddSubtractDuration() throws Exception {
AddDuration func1 = new AddDuration();
SubtractDuration func2 = new SubtractDuration();
Tuple t1 = TupleFactory.getInstance().newTuple(2);
t1.set(0, new DateTime("2009-01-07T01:07:01.000Z"));
t1.set(1, "PT1S");
Tuple t2 = TupleFactory.getInstance().newTuple(2);
t2.set(0, new DateTime("2008-02-06T02:06:02.000Z"));
t2.set(1, "PT1M");
Tuple t3 = TupleFactory.getInstance().newTuple(2);
t3.set(0, new DateTime("2007-03-05T03:05:03.000Z"));
t3.set(1, "P1D");
assertEquals(func1.exec(t1), new DateTime("2009-01-07T01:07:02.000Z"));
assertEquals(func1.exec(t2), new DateTime("2008-02-06T02:07:02.000Z"));
assertEquals(func1.exec(t3), new DateTime("2007-03-06T03:05:03.000Z"));
assertEquals(func2.exec(t1), new DateTime("2009-01-07T01:07:00.000Z"));
assertEquals(func2.exec(t2), new DateTime("2008-02-06T02:05:02.000Z"));
assertEquals(func2.exec(t3), new DateTime("2007-03-04T03:05:03.000Z"));
}