Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Java Tools for Extreme programming mastering open source tools including - Hightower R.

Hightower R. Java Tools for Extreme programming mastering open source tools including - Wiley publishing , 2002. - 417 p.
ISBN: 0-471-20708
Download (direct link): javatoolsforextremeprog2002.pdf
Previous << 1 .. 149 150 151 152 153 154 < 155 > 156 157 158 .. 159 >> Next

This method attempts to return the DOM tree associated with this response. If the response is determined to be HTML, a special HTML-savvy parser (JTidy) will be used. If not, a regular SAX parser will be used on the response text. If errors are encountered during parsing (for instance, if the response contains neither HTML nor XML), a SAXException will be thrown.
getFrameNames()
public String[] getFrameNames() throws SAXException
This method returns an array containing the names of all the frames contained in this page. You can retrieve the contents of individual frames by these names from the WebClient (see that section for details).
getHeaderField(String fieldName)
public String getHeaderField(String fieldName)
This method gets the contents of the header field specified by the given name: public void testContentLength() throws Exception{
WebConversation conversation = new WebConversation();
WebResponse response = conversation.getResponse("http://www.junit.org"); assertEquals("6575", response.getHeaderField("CONTENT-LENGTH"));
}
getInputStream()
405
public InputStream getInputStream()
This method returns the textual contents of this response as an input stream. getNewCookieNames() public String[] getNewCookieNames()
This method returns all the cookie names defined as part of this response. (See the section on WebClient.addCookie for an example of this method in action.)
getNewCookieValue(String name)
public String getNewCookieValue(String name)
This method returns the value associated with the given new cookie name (see getNewCookieNames()). getRefreshDelay() public int getRefreshDelay()
This method returns the delay specified by the refresh metatag contained in the header (or Q if none is found). This delay corresponds the waiting period before a standard browser would follow the refresh request.
getRefreshRequest()
public WebRequest getRefreshRequest()
This method gets the WebRequest embodying the refresh URL contained in the refresh metatag in the header (or null if none exists).
getResponseCode()
public abstract int getResponseCode()
This method returns the HTTP response code for this request. getTarget()
public String getTarget()
This method gets the frame in which the WebResponse resides (the default frame for any WebRequests originating from this response).
getTitle()
public String getTitle() throws SAXException
This method returns the title element of the underlying HTML page. getText()
public String getText() throws IOException
This method returns a String representation of the underlying HTML page (roughly equivalent to calling "view source" in a traditional browser). This method is preferred over toString() for the retrieval of page contents.
getURL()
public java.net.URL getURL()
This method returns the URL of the request that generated this response. isHTML()
public boolean isHTML()
This method returns true if the content-type for the underlying page is specified as "text/html". loadResponseText()
protected void loadResponseText() throws IOException
newResponse(URLConnection connection)
public static WebResponse newResponse(URLConnection connection)
throws IOException
406
readRefreshRequest(String contentTypeHeader)
protected final void readRefreshRequest(String contentTypeHeader)
setContentTypeHeaderString value)
protected void setContentTypeHeaderString value)
toString()
public String toString()
In the default implementation, this method returns the response text. In HttpWebResponse (the only concrete subclass in the HttpUnit API), it returns only the response headers.
Class WebTable
public class WebTable
Inheritance Information
Extends: ObjectDescription
WebTable represents an HTML table. It provides methods to get various attributes of a table (row count, column count, id, and summary) and methods to get single table cells (as TableCells or as text), and also lets you convert the entire table into a array-based representation.
Methods
asText()
public String[][] asText()
This method returns the entire table as a two-dimensional String array. The first dimension contains the rows, and the second dimension contains the cells.
getCell(int row, int column) Deprecated
public String getCell(int row, int column)
Use getCellAsText(int row, int column). getCellAsText(int row, int column)
public String getCellAsText(int row, int column)
This method returns the contents of the cell in the given position as text. The row and column numbers are zero based, and this method will throw an IndexOutOfBoundsException if the parameters are not within the table's range.
getColumnCount()
public int getColumnCount()
getID()
public String getID()
getRowCount()
public int getRowCount()
getSummary()
public String getSummary()
getTableCell(int row, int column)
407
public TableCell getTableCell(int row, int column)
This method returns the contents of the cell in the given position as a TableCell. The row and column numbers are zero based, and this method will throw an IndexOutOfBoundsException if the parameters are not within the table's range.
Previous << 1 .. 149 150 151 152 153 154 < 155 > 156 157 158 .. 159 >> Next