java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.htmlparser.tests.ParserTestCase
org.htmlparser.tests.scannersTests.ScriptScannerTest
- All Implemented Interfaces:
- junit.framework.Test
- public class ScriptScannerTest
- extends org.htmlparser.tests.ParserTestCase
| Fields inherited from class junit.framework.TestCase |
|
| Methods inherited from class org.htmlparser.tests.ParserTestCase |
assertHiddenIDTagPresent, assertNodeCount, assertNodeCount, assertSameType, assertStringEquals, assertTagEquals, assertType, assertXmlEquals, createParser, createParser, createParser, createParser, parse, parseAndAssertNodeCount, parseNodes, removeEscapeCharacters |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
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 |
ScriptScannerTest
public ScriptScannerTest(java.lang.String name)
testEvaluate
public void testEvaluate()
testScan
public void testScan()
throws org.htmlparser.util.ParserException
testScanBug
public void testScanBug()
throws org.htmlparser.util.ParserException
- Bug reported by Gordon Deudney 2002-03-27 Upon parsing : <SCRIPT
LANGUAGE="JavaScript" SRC="../js/DetermineBrowser.js"></SCRIPT>
the SRC data cannot be retrieved.
testScanBugWG
public void testScanBugWG()
throws org.htmlparser.util.ParserException
- Bug check by Wolfgang Germund 2002-06-02 Upon parsing : <script
language="javascript"> if(navigator.appName.indexOf("Netscape") != -1)
document.write ('xxx'); else document.write ('yyy'); </script>
check getScriptCode().
testScanScriptWithLinks
public void testScanScriptWithLinks()
throws org.htmlparser.util.ParserException
testScanScriptWithComments
public void testScanScriptWithComments()
throws org.htmlparser.util.ParserException
testScriptTagComments
public void testScriptTagComments()
throws org.htmlparser.util.ParserException
- Submitted by Dhaval Udani - reproducing bug 664404
testScriptTagsGeneratedByScriptCode
public void testScriptTagsGeneratedByScriptCode()
throws java.lang.Exception
- Duplicates bug reported by James Moliere - whereby, if script tags are
generated by script code, the parser interprets them as real tags. The
problem was that the string parser was not moving to the ignore state on
encountering double quotes (only single quotes were previously accepted).
testScriptCodeExtraction
public void testScriptCodeExtraction()
throws org.htmlparser.util.ParserException
testScriptCodeExtractionWithMultipleQuotes
public void testScriptCodeExtractionWithMultipleQuotes()
throws org.htmlparser.util.ParserException
testScriptWithinComments
public void testScriptWithinComments()
throws java.lang.Exception
testScriptCodeExtractionWithNewlines
public void testScriptCodeExtractionWithNewlines()
throws org.htmlparser.util.ParserException
- There was a bug in the ScriptScanner when there was multiline script and
the last line did not have a newline before the end script tag. For
example:
<script>alert() alert()</script>
Would generate the following "scriptCode()" result: alert()alert()
But should actually return: alert() alert()
This was fixed in ScriptScanner, which this test verifies
testScanNoEndTag
public void testScanNoEndTag()
throws org.htmlparser.util.ParserException
- Tests a bug in ScriptScanner where a NPE would be thrown if the script
tag was not closed before the document ended.
testScanQuotedEndTag
public void testScanQuotedEndTag()
throws org.htmlparser.util.ParserException
- See bug #741769 ScriptScanner doesn't handle quoted tags