public class EmbeddedCDXServerIndexTest
extends junit.framework.TestCase
EmbeddedCDXServerIndex.| Modifier and Type | Class and Description |
|---|---|
static class |
EmbeddedCDXServerIndexTest.ExcludeAllFilterFactory |
static class |
EmbeddedCDXServerIndexTest.StubZipNumCluster |
static class |
EmbeddedCDXServerIndexTest.TestCDXServer
fixture CDXServer (unnecessary if CDServer was an interface).
|
| Constructor and Description |
|---|
EmbeddedCDXServerIndexTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
setCdxLines(String... lines)
Set CDX lines TestCDXServer stub returns.
|
protected void |
setUp() |
void |
testBuildStatusFilter()
quick test of
EmbeddedCDXServerIndex.buildStatusFilter(String) |
void |
testCollapseTime()
test of timestamp-collapsing.
|
void |
testHandleRequest()
EmbeddedCDXServerIndex.handleRequest(HttpServletRequest, HttpServletResponse) is
a entry point for CDXServer API. |
void |
testIgnoreRobotPaths()
for those SURT prefixes in
ignoreRobotsPaths,
AuthToken.isIgnoreRobots() flag is set. |
void |
testIgnoreRobotsForEmbeds()
robots.txt exclusion shall be disable for embeds.
|
void |
testQuery()
capture search. basic options.
|
void |
testQueryWithCustomStatusFilter()
|
void |
testRenderMementoTimemap()
EmbeddedCDXServerIndex.renderMementoTimemap(WaybackRequest, HttpServletRequest, HttpServletResponse)
is a CDXServer API entry point for Memento format output. |
void |
testRevisitResolution()
EmbeddedCDXServerIndex resolves revisits for replay requests. |
void |
testRevisitResolutionReverse()
CDXToCaptureSearchResultsWriter resolves revisits for replay requests
(reverse order input mode) (Test of CDXToCaptureSearchResultsWriter.) |
void |
testSoftBlock_fieldModificationRecognized()
Supplementary test for soft-block feature.
|
void |
testSoftBlock_revisitPayloadLookup()
Test of soft-block feature (URL-agnostic revisit payload lookup).
|
void |
testSoftBlock()
Test of soft-block feature (regular replay).
|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toStringassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, failprotected void setUp()
throws Exception
setUp in class junit.framework.TestCaseExceptionprotected void setCdxLines(String... lines)
CDXFieldConstants.CDX_ALL_NAMES.
Note EmbeddedCDXServerIndex.query(org.archive.wayback.core.WaybackRequest) will throw ResourceNotInArchiveException
if lines is empty.lines - text CDX linespublic void testRevisitResolution()
throws Exception
EmbeddedCDXServerIndex resolves revisits for replay requests.
(This is actually a test of CDXToCaptureSearchResultsWriter.)Exceptionpublic void testRevisitResolutionReverse()
throws Exception
CDXToCaptureSearchResultsWriter resolves revisits for replay requests
(reverse order input mode) (Test of CDXToCaptureSearchResultsWriter.)
Since there's no way to put CDXToCaptureSearchResultsWriter's in reverse
mode, this test calls CDXToCaptureSearchResultWriter directly.
In other words, its reverse mode is never used in practice.
Exceptionpublic void testSoftBlock()
throws Exception
robotflags field does not make its way
into CaptureSearchResults, but still available as payload
capture for revisits.Exceptionpublic void testSoftBlock_fieldModificationRecognized()
throws Exception
robotflags made by exclusionFilter must be
properly recognized. As baseline EmbeddedCDXServerIndex does not have
setting up exclusionFilter, this test deals with
CDXToCaptureSearchResultsWriter directly.Exceptionpublic void testSoftBlock_revisitPayloadLookup()
throws Exception
Exceptionpublic void testBuildStatusFilter()
EmbeddedCDXServerIndex.buildStatusFilter(String)public void testQueryWithCustomStatusFilter()
throws Exception
Exceptionpublic void testIgnoreRobotPaths()
throws Exception
ignoreRobotsPaths,
AuthToken.isIgnoreRobots() flag is set.Exceptionpublic void testCollapseTime()
throws Exception
Actual processing happens in CDXServer. EmbeddedCDXServerIndex
simply passes WaybackRequest.getCollapseTime() to CDXQuery.setCollapse(String[]).
if collapseTime is unspecified in WaybackRequest (-1), default value
timestampDedupLength will be used.
Exceptionpublic void testHandleRequest()
throws Exception
EmbeddedCDXServerIndex.handleRequest(HttpServletRequest, HttpServletResponse) is
a entry point for CDXServer API. It should return all accessible cdx lines, without applying
any additional filters not requested by API user.Exceptionpublic void testRenderMementoTimemap()
throws Exception
EmbeddedCDXServerIndex.renderMementoTimemap(WaybackRequest, HttpServletRequest, HttpServletResponse)
is a CDXServer API entry point for Memento format output.Exceptionpublic void testIgnoreRobotsForEmbeds()
throws Exception
TODO: This is actually testing classes in wayback-cdx-server
module. Implemented here because it takes more work to do this
in wayback-cdx-server module, and it makes little sense to do it before
planned refactoring.
Ref: WWM-119. A bug in PrivTokenAuthChecker.
ExceptionCopyright © 2005–2015 IIPC. All rights reserved.