Examples of WaybackRequest


Examples of org.archive.wayback.core.WaybackRequest

   * @throws Exception
   */
  public void testNoBodyInsertForFrameContent() throws Exception {
    delegator.setHeadInsertJsp("head.jsp");
    delegator.setJspInsertPath("body-insert.jsp");
    WaybackRequest wbRequest = new WaybackRequest();
    wbRequest.setAjaxRequest(false);
    wbRequest.setFrameWrapperContext(true);

    jspExec = new TestJSPExecutor(wbRequest);

    final String input = "<html>" +
        "<head>" +
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

   * @throws Exception
   */
  public void testNoBodyInsertForIFrameContent() throws Exception {
    delegator.setHeadInsertJsp("head.jsp");
    delegator.setJspInsertPath("body-insert.jsp");
    WaybackRequest wbRequest = new WaybackRequest();
    wbRequest.setAjaxRequest(false);
    wbRequest.setIFrameWrapperContext(true);

    jspExec = new TestJSPExecutor(wbRequest);

    final String input = "<html>" +
        "<head>" +
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

    EasyMock.replay(req);
    return cut.parse(req, accessPoint);
    }
   
    public void testReplayRequest() throws Exception {
        WaybackRequest wbr = parse("/web/20100101000000/http://www.yahoo.com/");
        assertNotNull(wbr);
        assertTrue(wbr.isReplayRequest());
        assertEquals("20100101000000", wbr.getReplayTimestamp());
        assertEquals("http://www.yahoo.com/", wbr.getRequestUrl());
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

     * has no trailing "*" - there's a special handling happening somewhere.)
     * Should this be interpreted as URL-query for the specific date?</p>
     * @throws Exception
     */
    public void testDatePathPrefix() throws Exception {
      WaybackRequest wbr = parse("/web/20100101000000/http://www.yahoo.com/*");
      assertNotNull(wbr);
      assertTrue(wbr.isReplayRequest());
      assertEquals("20100101000000", wbr.getReplayTimestamp());
      // ReplayRequestParser does not strip trailing "*" off.
      assertEquals("http://www.yahoo.com/*", wbr.getRequestUrl());
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

     * 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());
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

     * <p>this is a desired behavior to be implemented (assertion is disabled).
     * see issue <a href="https://webarchive.jira.com/browse/WWM-110">WWM-110</a></p>
     * @throws Exception
     */
    public void testDatePrefixEncoded() throws Exception {
    WaybackRequest wbr1 = parse("/web/20100101%2A/http://www.yahoo.com/?p=%2A");
    assertNotNull(wbr1);
    assertTrue(wbr1.isCaptureQueryRequest());
    assertEquals("20100101000000", wbr1.getStartTimestamp());
    assertEquals("20100101235959", wbr1.getEndTimestamp());
    assertEquals("20100101235959", wbr1.getReplayTimestamp());
    assertEquals("http://www.yahoo.com/?p=%2A", wbr1.getRequestUrl());
     
    WaybackRequest wbr2 = parse("/web/%2A/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());
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

     * date range becomes start and end timestamps. but it doesn't
     * set replayTimestamp (it should, for consistency?)
     */
    public void testPathDateRange() throws Exception {
      // range with full-length timestamps
    WaybackRequest wbr1 = parse("/web/20100101000000-20100630235959*/http://www.yahoo.com/");
    assertNotNull(wbr1);
    assertTrue(wbr1.isCaptureQueryRequest());
    assertEquals("20100101000000", wbr1.getStartTimestamp());
    assertEquals("20100630235959", wbr1.getEndTimestamp());
//    assertEquals("20100630235959", wbr1.getReplayTimestamp());
    assertEquals(null, wbr1.getReplayTimestamp());
    assertEquals("http://www.yahoo.com/", wbr1.getRequestUrl());
     
    WaybackRequest wbr2 = parse("/web/2010-2014*/http://www.yahoo.com/?p=2");
    assertNotNull(wbr2);
    assertTrue(wbr1.isCaptureQueryRequest());
    assertEquals("20100101000000", wbr2.getStartTimestamp());
    assertEquals("20141231235959", wbr2.getEndTimestamp());
//    assertEquals("20141231235959", wbr2.getReplayTimestamp());
    assertEquals(null, wbr2.getReplayTimestamp());
    assertEquals("http://www.yahoo.com/?p=2", wbr2.getRequestUrl());
   
    // Date range without "*" results in 404. We could make it work.
    WaybackRequest wbr3 = parse("/web/2010-2014/http://www.yahoo.com/");
    assertNull(wbr3);
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

    /**
     * test for {@link PathDateRangeQueryRequestParser}, %-encoded version.
     * @throws Exception
     */
    public void testPathDateRangeEncoded() throws Exception {
    WaybackRequest wbr1 = parse("/web/20100101000000-20100630235959%2A/http://www.yahoo.com/");
    assertNotNull(wbr1);
    assertTrue(wbr1.isCaptureQueryRequest());
    assertEquals("20100101000000", wbr1.getStartTimestamp());
    assertEquals("20100630235959", wbr1.getEndTimestamp());
//    assertEquals("20100630235959", wbr1.getReplayTimestamp());
    assertEquals(null, wbr1.getReplayTimestamp());
    assertEquals("http://www.yahoo.com/", wbr1.getRequestUrl());
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

     * <p>this is a URL query with (optional) single timestamp date range.
     * timestamp, if non-empty, becomes start and end.
     * </p>
     */
    public void testPathPrefixDatePrefix() throws Exception {
      WaybackRequest wbr1 = parse("/web/2010*/http://www.yahoo.com/*");
      assertNotNull(wbr1);
      assertTrue(wbr1.isUrlQueryRequest());
      assertEquals("20100101000000", wbr1.getStartTimestamp());
      assertEquals("20101231235959", wbr1.getEndTimestamp());
      // does not set replayTimestamp, but it is not a required behavior.
      assertEquals("http://www.yahoo.com/", wbr1.getRequestUrl());
     
      WaybackRequest wbr2 = parse("/web/*/http://www.yahoo.com/*");
      assertNotNull(wbr2);
      assertTrue(wbr2.isUrlQueryRequest());
      assertEquals(EXPECTED_START_TIMESTAMP, wbr2.getStartTimestamp());
      assertEquals(null, wbr2.getEndTimestamp());
      // does not set replayTimestamp, but it is not a required behavior.
      assertEquals("http://www.yahoo.com/", wbr2.getRequestUrl());
     
      // timestamp is up to 13 digits. 14-digit timestamp results in null (-> 404).
      // TODO: there'd be a nicer way.
      WaybackRequest wbr3 = parse("/web/20130101000000*/http://www.yahoo.com/*");
      assertNull(wbr3);
    }
View Full Code Here

Examples of org.archive.wayback.core.WaybackRequest

    public String jspToString(String jspPath) throws ServletException,
        IOException {
      return "[[[JSP-INSERT:" + jspPath + "]]]";
    }
    private static WaybackRequest stubWaybackRequest() {
      WaybackRequest wbRequest = new WaybackRequest();
      // make sure ajaxRequest is false (true disables JSP inserts)
      // it's false by default currently, but just in case (paranoia).
      wbRequest.setAjaxRequest(false);
      return wbRequest;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.