public class FastArchivalUrlReplayParseEventHandlerTest
extends junit.framework.TestCase
FastArchivalUrlReplayParseEventHandler
.
also covers StandardAttributeRewriter
.Modifier and Type | Class and Description |
---|---|
protected static class |
FastArchivalUrlReplayParseEventHandlerTest.TestJSPExecutor
JSPExecutor patched to return predictable text without
actually running JSP.
|
Constructor and Description |
---|
FastArchivalUrlReplayParseEventHandlerTest() |
Modifier and Type | Method and Description |
---|---|
String |
doEndToEnd(String input) |
protected void |
setUp() |
void |
testAdditionalAttributeRewriteRules()
test of additional attribute rewrite rules for
StandardAttributeRewriter . |
void |
testAnchorHrefAbsolute() |
void |
testAnchorHrefAbsoluteInJavascript() |
void |
testAnchorHrefRelative() |
void |
testBase()
URL rewrite takes
BASE element into account. |
void |
testDisableDefaultRules()
|
void |
testDisableScriptElement()
test of rewriting SCRIPT tag.
|
void |
testDOMEventHandlers()
test of rewriting URLs in DOM event handler attributes.
|
void |
testElementLookAlikeInScript()
HTMLParser appears to parse the content of
<SCRIPT> element
as HTML. |
void |
testExtraHeadTag()
pathological case of two HEAD tags.
|
void |
testFramesetWithExtraTags()
Pathological case:
content-bearing tags before FRAMESET, even before HEAD.
|
void |
testHTMLEntityInURL()
URL-rewrite must not unescape HTML entities in URL.
|
void |
testHtmlParser_attributeValueEscaping()
test expected behavior of htmlparser.
|
void |
testHtmlParser_CDATA()
test expected behavior of
HTMLParser - handling of CDATA. |
void |
testInserts()
JSP inserts: well formed case.
|
void |
testLinkElement() |
void |
testMissingBodyTag() |
void |
testMissingHeadAndBodyTag()
Pathological case:
both HEAD and BODY tags are missing.
|
void |
testMissingHeadAndBodyTagStartsWithContentTag()
Pathological case:
both HEAD and BODY tags are missing.
|
void |
testMissingHeadCloseAndBodyTag()
Pathological case:
Content has
<HEAD> but missing </HEAD> and BODY . |
void |
testMissingHeadCloseTag()
Pathological case:
Content has
<HEAD> but missing </HEAD> and BODY . |
void |
testMissingHeadTag()
Pathological case:
Missing HEAD tag. head-insert shall be inserted just before
the first open tag (excluding !
|
void |
testNoBodyInsertForFrameContent()
body-inset shall not be inserted to resource rendered
insider
FRAME (identified by fw_ context
flag, frameWrapperContext in WaybackRequest . |
void |
testNoBodyInsertForIFrameContent()
similarly for
IFRAME . |
void |
testNoEndJspForNonHTML()
Servers often return non-HTML resource with
Content-Type: text/html . |
void |
testNonHeadTagBeforeBodyTag()
Pathological case:
Content-producing tag appearing before BODY tag.
|
void |
testStyleAttribute() |
void |
testStyleElementBackgroundUrl() |
void |
testStyleElementBackgroundUrlNoUnescape()
HTML entities in <STYLE> element are not unescaped.
|
void |
testStyleElementFontfaceSrcUrl() |
void |
testStyleElementImportUrl() |
void |
testStyleElmeentImportUrlInsideCDATA() |
void |
testStyleElmeentImportUrlInsideHTMLComment()
Some people enclose in-line STYLE content with HTML Comment
for better support for stone age browsers.
|
void |
testUnescapeAttributeValuesFalse()
test of
unescapeAttributeValue == false case. |
void |
testXHTML() |
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
public FastArchivalUrlReplayParseEventHandlerTest()
protected void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void testAnchorHrefAbsoluteInJavascript() throws Exception
Exception
public void testStyleElementBackgroundUrl() throws Exception
Exception
public void testStyleElementBackgroundUrlNoUnescape() throws Exception
Exception
public void testStyleElementImportUrl() throws Exception
Exception
public void testStyleElmeentImportUrlInsideCDATA() throws Exception
Exception
public void testStyleElmeentImportUrlInsideHTMLComment() throws Exception
Exception
public void testStyleElementFontfaceSrcUrl() throws Exception
Exception
public void testHTMLEntityInURL() throws Exception
Reported in ARI-3774.
Now all attribute values are unescaped before processing, and then escaped back
before writing out. This has a side-effect: bare "&
" gets rewritten to
"&
"
Exception
public void testUnescapeAttributeValuesFalse() throws Exception
unescapeAttributeValue
== false
case.
bare "&
" is unchanged.Exception
public void testDisableScriptElement() throws Exception
null
from
jsBlockTrans
(This feature may be removed/redesigned at any time).Exception
public void testBase() throws Exception
BASE
element into account.Exception
public void testAdditionalAttributeRewriteRules() throws Exception
StandardAttributeRewriter
.
additional rules takes precedence over default one, if they are of the same specificity.Exception
public void testNoEndJspForNonHTML() throws Exception
Content-Type: text/html
.
Inserting HTML annotation to non-HTML resource can break its replay.
Therefore, don't insert EndJsp
if resource does not appear to be
HTML.Exception
public void testInserts() throws Exception
Exception
public void testMissingHeadTag() throws Exception
Exception
public void testMissingHeadCloseTag() throws Exception
<HEAD>
but missing </HEAD>
and BODY
.Exception
public void testMissingHeadCloseAndBodyTag() throws Exception
<HEAD>
but missing </HEAD>
and BODY
.Exception
public void testMissingHeadAndBodyTag() throws Exception
Exception
public void testMissingHeadAndBodyTagStartsWithContentTag() throws Exception
Exception
public void testNonHeadTagBeforeBodyTag() throws Exception
Exception
public void testExtraHeadTag() throws Exception
Exception
public void testNoBodyInsertForFrameContent() throws Exception
FRAME
(identified by fw_
context
flag, frameWrapperContext
in WaybackRequest
.Exception
public void testNoBodyInsertForIFrameContent() throws Exception
IFRAME
.Exception
public void testFramesetWithExtraTags() throws Exception
FastArchivalUrlReplayParseEventHandler
alone cannot
handle this case well. ArchivalUrlSAXRewriteReplayRenderer
has
workaround for this kind of case.Exception
public void testElementLookAlikeInScript() throws Exception
<SCRIPT>
element
as HTML.Exception
public void testDOMEventHandlers() throws Exception
only limited set of attributes are supported currently.
Exception
public void testHtmlParser_attributeValueEscaping() throws Exception
htmlparser does neither unescape HTML entities found in text, nor escape special characters in Node.toHtml(). We have a workaround based on this behavior. If this expectation breaks, we need to modify our code.
Exception
Copyright © 2005–2015 IIPC. All rights reserved.