public class WarcResourceTest
extends junit.framework.TestCase
Constructor and Description |
---|
WarcResourceTest() |
Modifier and Type | Method and Description |
---|---|
protected Resource |
createResource(org.archive.io.warc.WARCRecordInfo recinfo)
|
protected void |
setUp() |
void |
testCompressedChunkedHttpRecord()
gzip-compressed, chunked-encoded HTTP response.
|
void |
testCompressedHttpRecord()
gzip-compressed HTTP response.
|
void |
testMetadataRecord()
metadata record with render-able content like site screenshot image.
|
void |
testOldRevisitRecord()
old revisit record, which has zero-length block (no HTTP response
line, no HTTP headers).
|
void |
testPlainChunkedHttpRecord()
uncompressed, but chunked-encoded HTTP response
|
void |
testPlainHttpRecord()
plain HTTP response (without any transfer/content-encoding)
|
void |
testResourceRecord()
resource record, typically used for archiving ftp fetches.
|
void |
testRevisitRecord()
new, current revisit record, which has just HTTP response line and
headers part of the capture.
|
void |
testUrlAgnosticRevisitRecord() |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
assertEquals, 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, fail
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
protected Resource createResource(org.archive.io.warc.WARCRecordInfo recinfo) throws Exception
Resource
from WARCRecordInfo
recinfo
.
Override this method to run tests on different implementations of Resource.
recinfo
- Exception
JWATResourceTest
public void testPlainHttpRecord() throws Exception
Exception
public void testPlainChunkedHttpRecord() throws Exception
Exception
public void testCompressedHttpRecord() throws Exception
Exception
public void testCompressedChunkedHttpRecord() throws Exception
Exception
public void testMetadataRecord() throws Exception
Exception
public void testRevisitRecord() throws Exception
Expectations:
TextReplayRender receives revisit WarcResource as httpHeaderResource
,
and calls following methods on it:
WarcResource.getStatusCode()
WarcResource.getHttpHeaders()
(ok to return null)Exception
public void testOldRevisitRecord() throws Exception
WarcResource.getStatusCode()
should not fail, but
either return special value or throw an appropriate exception signifying
there's no HTTP status line recorded in this resource, and thus ReplayRenderer
should fallback on using payloadResource for the info instead.
WarcResource.getHttpHeaders()
must not return null, but should
return empty Map object, so that CharsetDetector
can return null
without failing.
for the better, this fallback may be encapsulated in
virtual Resource combining httpHeaderResource and payloadResource.
related issue: https://webarchive.jira.com/browse/ACC-126public void testUrlAgnosticRevisitRecord() throws Exception
Exception
Copyright © 2005–2015 IIPC. All rights reserved.