public class ParserTest extends ParserTestCase
| 构造器和说明 |
|---|
ParserTest(java.lang.String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
testDifferentLocale()
See bug #883664 toUpperCase on tag names and attributes depends on locale
|
void |
testDoubleQuotedCharset()
Test the case of a double quoted charset directive.
|
void |
testElements() |
void |
testElementsFromWeb()
This testcase needs you to be online.
|
void |
testEmbeddedQuoteSplit()
See bug #729368 Embedded quote and split tag
|
void |
testFile()
Tests the 'from file' Parser constructor.
|
void |
testFileDelete()
Tests deleting a file held open by the parser.
|
void |
testFixSpaces() |
void |
testHTMLCharset()
Test with a HTML header with a charset parameter not matching the HTTP header.
|
void |
testHTTPCharset()
Test with a HTTP header with a valid charset parameter.
|
void |
testImageCollection() |
void |
testLinkCollection() |
void |
testNullUrl() |
void |
testOutOfMemory()
See bug #728241 OutOfMemory error/ Infinite loop
|
void |
testPOST()
Test the Parser(URLConnection) constructor.
|
void |
testSetInputHTML()
See bug #826764 ParserException occurs only when using setInputHTML() instea
|
void |
testSetRemarkText()
See bug #900128 RemarkNode.setText() does not set Text
|
void |
testSetStringText()
See bug #900128 RemarkNode.setText() does not set Text
|
void |
testSingleQuotedCharset()
Test the case of a single quoted charset directive.
|
void |
testSwitchCharset()
Test the case of a charset directive different than the HTTP header.
|
void |
testURLWithSpaces() |
void |
testXMLTypeToString()
Test reproducing a java.lang.StackOverflowError.
|
assertNodeCount, assertSameType, assertStringEquals, assertSuperType, assertTagEquals, assertType, assertXmlEquals, failWithMessage, getParser, main, parseAndAssertNodeCount, parseNodes, removeEscapeCharacters, setParser, testFakeassertEquals, 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, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toStringpublic void testElements()
throws java.lang.Exception
java.lang.Exceptionpublic void testElementsFromWeb()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testPOST()
throws java.lang.Exception
http://www.canadapost.ca/tools/pcl/bin/default-e.asp:
<form NAME="SearchQuick" method="POST" action="cp_search_response-e.asp"
onSubmit="return runSubmit();">
<!-- begin test hidden field code -->
<input TYPE="Hidden" NAME="app_language" value="english">
<input TYPE="Hidden" NAME="app_response_start_row_number" value="1">
<input TYPE="Hidden" NAME="app_response_rows_max" value="9">
<input TYPE="Hidden" NAME="app_source" value="quick">
<input TYPE="Hidden" NAME="query_source" value="q">
<input TYPE="Hidden" NAME="name" value>
<input TYPE="Hidden" NAME="postal_code" value>
<input TYPE="Hidden" NAME="directory_area_name" value>
<input TYPE="Hidden" NAME="delivery_mode" value>
<input TYPE="Hidden" NAME="Suffix" value>
<input TYPE="Hidden" NAME="street_direction" value>
<input TYPE="Hidden" NAME="installation_type" value>
<input TYPE="Hidden" NAME="delivery_number" value>
<input TYPE="Hidden" NAME="installation_name" value>
<input TYPE="Hidden" NAME="unit_number" value>
<input TYPE="Hidden" NAME="app_state" value="production">
<!-- end test hidden field code -->
<p>
<table border="0" cellpadding="0" width="90%" cellspacing="0">
<tr>
<td class="tbltitle"> Street Number: </td>
<td class="tbltitle"> Street Name: </td>
<td class="tbltitle"> Street Type:</td>
</tr>
<tr>
<td>
<input type="text" name="street_number" size="10" maxlength="10">
</td>
<td>
<input type="text" name="street_name" size="30" maxlength="40">
<input type="hidden" name="street_type" size="30">
</td>
<td><input type="text" name="test" size="10" maxlength="30"></td>
</tr>
</table>
<p>
<table border="0" cellpadding="0" width="90%" cellspacing="0">
<tr>
<td class="tbltitle">
Municipality (City, Town, etc.):
</td>
<td class="tbltitle">
Province:
</td>
</tr>
<tr>
<td>
<input type="text" name="city" size="30" maxlength="30">
</td>
<td>
<select size="1" name="prov">
<option selected value="NULL">Select</option><option value="AB">AB - Alberta</option><option value="BC">BC - British Columbia</option><option value="MB">MB - Manitoba</option><option value="NB">NB - New Brunswick</option><option value="NL">NL - Newfoundland and Labrador</option><option value="NS">NS - Nova Scotia</option><option value="NT">NT - Northwest Territories</option><option value="NU">NU - Nunavut</option><option value="ON">ON - Ontario</option><option value="PE">PE - Prince Edward Island</option><option value="QC">QC - Quebec</option><option value="SK">SK - Saskatchewan</option><option value="YT">YT - Yukon</option>
</select>
</td>
</tr>
<tr>
<td height="10"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="right" nowrap>
<input type="image" src="images/bb_submit-e.gif" name="Search" border="0" WIDTH="88" HEIGHT="23">
<a href="#" onclick="javascript:fClearAllFields();"><img src="images/bb_clear_form-e.gif" name="Clear" border="0" WIDTH="88" HEIGHT="23"></a>
</td>
</tr>
</table>
<p>
</form>
Sumbits the POST and verifies the returned HTML contains an expected value.java.lang.Exception - Exceptionpublic void testFile()
public void testFileDelete()
public void testHTTPCharset()
public void testHTMLCharset()
public void testSwitchCharset()
throws ParserException
ParserException - ParserExceptionpublic void testDoubleQuotedCharset()
throws ParserException
ParserException - ParserExceptionpublic void testSingleQuotedCharset()
throws ParserException
ParserException - ParserExceptionpublic void testNullUrl()
public void testURLWithSpaces()
throws ParserException
ParserExceptionpublic void testLinkCollection()
throws ParserException
ParserExceptionpublic void testImageCollection()
throws ParserException
ParserExceptionpublic void testOutOfMemory()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testEmbeddedQuoteSplit()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testSetInputHTML()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testXMLTypeToString()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testDifferentLocale()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testSetStringText()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testSetRemarkText()
throws java.lang.Exception
java.lang.Exception - Exceptionpublic void testFixSpaces()
throws ParserException
ParserException