* test of {@link PathDatePreofixQueryRequestParser}.
*/
public void testDatePrefix() throws Exception {
// less-than-14-digit timestamp with "*": narrowed time range, highlight
// the latest within the range.
WaybackRequest wbr1 = parse("/web/20100101*/http://www.yahoo.com/?p=2");
assertNotNull(wbr1);
assertTrue(wbr1.isCaptureQueryRequest());
assertEquals("20100101000000", wbr1.getStartTimestamp());
assertEquals("20100101235959", wbr1.getEndTimestamp());
assertEquals("20100101235959", wbr1.getReplayTimestamp());
assertEquals("http://www.yahoo.com/?p=2", wbr1.getRequestUrl());
// just "*": entire time range, replay the latest.
WaybackRequest wbr2 = parse("/web/*/http://www.yahoo.com/");
assertNotNull(wbr2);
assertTrue(wbr2.isCaptureQueryRequest());
assertEquals(EXPECTED_START_TIMESTAMP, wbr2.getStartTimestamp());
assertEquals(EXPECTED_END_TIMESTAMP, wbr2.getEndTimestamp());
assertEquals(null, wbr2.getReplayTimestamp());
// full 14-digit timestamp with "*": entire time range, highlight the
// closest to the specified date.
WaybackRequest wbr3 = parse("/web/20100101000000*/http://www.yahoo.com/");
assertNotNull(wbr3);
assertTrue(wbr3.isCaptureQueryRequest());
assertEquals(EXPECTED_START_TIMESTAMP, wbr3.getStartTimestamp());
assertEquals(EXPECTED_END_TIMESTAMP, wbr3.getEndTimestamp());
assertEquals("20100101000000", wbr3.getReplayTimestamp());
}