public class JSStringTransformerTest
extends junit.framework.TestCase
| Modifier and Type | Class and Description |
|---|---|
static class |
JSStringTransformerTest.RecordingReplayParseContext
ReplayParseContext mock
TODO: move to package-level as this is useful for testing other
StringTransformers. |
| Constructor and Description |
|---|
JSStringTransformerTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
setUp() |
void |
testRewriteHttpsOnly()
rewriteHttpsOnly property is used to limit URL rewrite
to HTTPS ones (intended for proxy mode). |
void |
testRewriteHttpsOnlyEscapedSlashes()
same as above, slashes are backslash-escaped.
|
void |
testRewriteProtocolRelativeWithCustomRegex()
test of rewriting protocol relative URLs (
"//www.example.com/...") |
void |
testRewriteSpecialCharURL()
test of rewriting corner case where URL contains special chars for
Matcher#appendReplacement. |
void |
testTransform_EscapedSlashes()
slash is often escaped with backslash in JavaScript (esp.
|
void |
testTransform_HostOnly()
|
void |
testTransform_WithPath() |
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.TestCaseExceptionpublic void testTransform_HostOnly()
throws MalformedURLException
JSStringTransformer.transform(org.archive.wayback.replay.html.ReplayParseContext, java.lang.String).MalformedURLExceptionpublic void testTransform_WithPath()
public void testTransform_EscapedSlashes()
public void testRewriteHttpsOnly()
throws Exception
rewriteHttpsOnly property is used to limit URL rewrite
to HTTPS ones (intended for proxy mode). That should affect how
StringTransformer picks up URLs in text for translation.
Now rewriteHttpsOnly has no effect on JSStringTransformer's
behavior and picks up all fulll URLs.
Exceptionpublic void testRewriteHttpsOnlyEscapedSlashes()
throws Exception
Exceptionpublic void testRewriteProtocolRelativeWithCustomRegex()
throws Exception
"//www.example.com/...")
with non-default regex.
check if text preceding the first group is preserved in the result. also make sure it works with URLs with protocol.
ExceptionCopyright © 2005–2015 IIPC. All rights reserved.