public class FastArchivalUrlReplayParseEventHandlerTest
extends junit.framework.TestCase
FastArchivalUrlReplayParseEventHandler.
 also covers StandardAttributeRewriter.| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | FastArchivalUrlReplayParseEventHandlerTest.TestJSPExecutorJSPExecutor 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  BASEelement 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>andBODY. | 
| void | testMissingHeadCloseTag()Pathological case:
 Content has  <HEAD>but missing</HEAD>andBODY. | 
| 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 byfw_context
 flag,frameWrapperContextinWaybackRequest. | 
| 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 ==falsecase. | 
| void | testXHTML() | 
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, failpublic FastArchivalUrlReplayParseEventHandlerTest()
protected void setUp()
              throws Exception
setUp in class junit.framework.TestCaseExceptionpublic void testAnchorHrefAbsoluteInJavascript()
                                        throws Exception
Exceptionpublic void testStyleElementBackgroundUrl()
                                   throws Exception
Exceptionpublic void testStyleElementBackgroundUrlNoUnescape()
                                             throws Exception
Exceptionpublic void testStyleElementImportUrl()
                               throws Exception
Exceptionpublic void testStyleElmeentImportUrlInsideCDATA()
                                          throws Exception
Exceptionpublic void testStyleElmeentImportUrlInsideHTMLComment()
                                                throws Exception
Exceptionpublic void testStyleElementFontfaceSrcUrl()
                                    throws Exception
Exceptionpublic 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
 "&"
Exceptionpublic void testUnescapeAttributeValuesFalse()
                                      throws Exception
unescapeAttributeValue  == false case.
 bare "&" is unchanged.Exceptionpublic void testDisableScriptElement()
                              throws Exception
null from
 jsBlockTrans (This feature may be removed/redesigned at any time).Exceptionpublic void testBase()
              throws Exception
BASE element into account.Exceptionpublic void testAdditionalAttributeRewriteRules()
                                         throws Exception
StandardAttributeRewriter.
 additional rules takes precedence over default one, if they are of the same specificity.Exceptionpublic 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.Exceptionpublic void testInserts()
                 throws Exception
Exceptionpublic void testMissingHeadTag()
                        throws Exception
Exceptionpublic void testMissingHeadCloseTag()
                             throws Exception
<HEAD> but missing </HEAD> and BODY.Exceptionpublic void testMissingHeadCloseAndBodyTag()
                                    throws Exception
<HEAD> but missing </HEAD> and BODY.Exceptionpublic void testMissingHeadAndBodyTag()
                               throws Exception
Exceptionpublic void testMissingHeadAndBodyTagStartsWithContentTag()
                                                   throws Exception
Exceptionpublic void testNonHeadTagBeforeBodyTag()
                                 throws Exception
Exceptionpublic void testExtraHeadTag()
                      throws Exception
Exceptionpublic void testNoBodyInsertForFrameContent()
                                     throws Exception
FRAME (identified by fw_ context
 flag, frameWrapperContext in WaybackRequest.Exceptionpublic void testNoBodyInsertForIFrameContent()
                                      throws Exception
IFRAME.Exceptionpublic void testFramesetWithExtraTags()
                               throws Exception
FastArchivalUrlReplayParseEventHandler alone cannot
 handle this case well. ArchivalUrlSAXRewriteReplayRenderer has
 workaround for this kind of case.Exceptionpublic void testElementLookAlikeInScript()
                                  throws Exception
<SCRIPT> element
 as HTML.Exceptionpublic void testDOMEventHandlers()
                          throws Exception
only limited set of attributes are supported currently.
Exceptionpublic 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.
ExceptionCopyright © 2005–2015 IIPC. All rights reserved.