[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit BlockElement.java,1.2,1.3 FrameSelector.j
Brought to you by:
russgold
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13602/src/com/meterware/httpunit Modified Files: BlockElement.java FrameSelector.java HTMLElement.java HTMLSegment.java HttpUnitOptions.java HttpUnitUtils.java MessageBodyWebRequest.java PostMethodWebRequest.java SubmitButton.java TableCell.java TextBlock.java UnsupportedActionException.java WebClient.java WebForm.java WebLink.java WebList.java WebRequestSource.java WebResponse.java Log Message: Clean up documentation for 1.6 Index: BlockElement.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/BlockElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BlockElement.java 8 Aug 2004 17:45:30 -0000 1.2 +++ BlockElement.java 29 Sep 2004 17:15:24 -0000 1.3 @@ -29,6 +29,8 @@ * Represents a block-level element such as a paragraph or table cell, which can contain other elements. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * + * @since 1.6 **/ abstract public class BlockElement extends ParsedHTML implements HTMLSegment, HTMLElement { Index: FrameSelector.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/FrameSelector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FrameSelector.java 13 Jun 2004 21:52:02 -0000 1.1 +++ FrameSelector.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -21,8 +21,11 @@ *******************************************************************************************************************/ /** + * An immutable class which describes the position of a frame in the window hierarchy. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * + * @since 1.6 **/ public class FrameSelector { @@ -34,7 +37,7 @@ private FrameSelector _parent; - public FrameSelector() { + FrameSelector() { _name = super.toString(); } Index: HTMLElement.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- HTMLElement.java 27 Jun 2004 19:29:15 -0000 1.5 +++ HTMLElement.java 29 Sep 2004 17:15:24 -0000 1.6 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002, Russell Gold + * Copyright (c) 2002-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -57,12 +57,16 @@ /** * Returns the value of the attribute of this element with the specified name. * Returns the empty string if no such attribute exists. + * + * @since 1.6 */ String getAttribute( String name ); /** * Returns true if this element may have an attribute with the specified name. + * + * @since 1.6 */ boolean isSupportedAttribute( String name ); @@ -75,6 +79,8 @@ /** * Returns the contents of this element, converted to a string. + * + * @since 1.6 */ String getText(); } Index: HTMLSegment.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HTMLSegment.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- HTMLSegment.java 8 Aug 2004 17:45:30 -0000 1.14 +++ HTMLSegment.java 29 Sep 2004 17:15:24 -0000 1.15 @@ -44,6 +44,8 @@ /** * Returns the HTMLElements found with the specified attribute value. + * + * @since 1.6 */ public HTMLElement[] getElementsWithAttribute( String name, String value ) throws SAXException; @@ -162,6 +164,8 @@ /** * Returns the top-level block elements found in the page in the order in which they appear. * @exception SAXException thrown if there is an error parsing the segment. + * + * @since 1.6 */ public TextBlock[] getTextBlocks() throws SAXException; Index: HttpUnitOptions.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitOptions.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- HttpUnitOptions.java 8 Aug 2004 17:38:18 -0000 1.42 +++ HttpUnitOptions.java 29 Sep 2004 17:15:24 -0000 1.43 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -219,7 +219,7 @@ /** * Returns true if form parameter settings are checked. * - * @deprecated use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. + * @deprecated as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. **/ public static boolean getParameterValuesValidated() { return _parameterValuesValidated; @@ -233,7 +233,7 @@ * with this option disabled will not only not be checked for correctness, its parameter submission * order will not be guaranteed, and changing parameters will not trigger Javascript onChange / onClick events. * - * @deprecated use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. + * @deprecated as of 1.6, use WebForm#newUnvalidatedRequest() to obtain a request without parameter validation. **/ public static void setParameterValuesValidated( boolean validated ) { _parameterValuesValidated = validated; Index: HttpUnitUtils.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitUtils.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- HttpUnitUtils.java 23 Jul 2004 01:31:04 -0000 1.19 +++ HttpUnitUtils.java 29 Sep 2004 17:15:24 -0000 1.20 @@ -68,6 +68,8 @@ /** * Returns an interpretation of the specified URL-encoded string, using the iso-8859-1 character set. + * + * @since 1.6 **/ public static String decode( String byteString ) { return decode( byteString, "iso-8859-1" ); Index: MessageBodyWebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/MessageBodyWebRequest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- MessageBodyWebRequest.java 4 Jun 2004 01:20:03 -0000 1.11 +++ MessageBodyWebRequest.java 29 Sep 2004 17:15:24 -0000 1.12 @@ -63,6 +63,8 @@ /** * Constructs a web request for a form submitted via a button. + * + * @since 1.6 **/ protected MessageBodyWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { super( sourceForm, parameterHolder, button, x, y ); Index: PostMethodWebRequest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/PostMethodWebRequest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- PostMethodWebRequest.java 4 Jun 2004 01:20:03 -0000 1.26 +++ PostMethodWebRequest.java 29 Sep 2004 17:15:24 -0000 1.27 @@ -124,7 +124,7 @@ } - public PostMethodWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { + PostMethodWebRequest( WebForm sourceForm, ParameterHolder parameterHolder, SubmitButton button, int x, int y ) { super( sourceForm, parameterHolder, button, x, y ); } Index: SubmitButton.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/SubmitButton.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- SubmitButton.java 11 Jul 2004 03:11:32 -0000 1.19 +++ SubmitButton.java 29 Sep 2004 17:15:24 -0000 1.20 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -48,7 +48,7 @@ * Performs the action associated with clicking this button after running any 'onClick' script. * For a submit button this typically submits the form. * - * @since 1.5.5 + * @since 1.6 */ public void click( int x, int y ) throws IOException, SAXException { if (!isImageButton()) throw new IllegalStateException( "May only specify positions for an image button" ); Index: TableCell.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/TableCell.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- TableCell.java 27 Jun 2004 19:29:15 -0000 1.18 +++ TableCell.java 29 Sep 2004 17:15:24 -0000 1.19 @@ -51,7 +51,7 @@ /** * Returns the text value of this cell. - * @deprecated as of 1.5.5, use #getText() + * @deprecated as of 1.6, use #getText() */ public String asText() { return getText(); Index: TextBlock.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/TextBlock.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TextBlock.java 8 Aug 2004 17:45:31 -0000 1.1 +++ TextBlock.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -23,11 +23,12 @@ import java.net.URL; import java.util.ArrayList; -import java.util.Enumeration; /** + * A class which represents a block of text in a web page. Experimental. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class TextBlock extends BlockElement { @@ -43,6 +44,9 @@ } + /** + * Returns any lists embedded in this text block. + */ public WebList[] getLists() { return (WebList[]) (_lists.toArray( new WebList[ _lists.size() ] ) ); } @@ -53,7 +57,7 @@ } - public String[] getFormats( int characterPosition ) { + String[] getFormats( int characterPosition ) { return null; } Index: UnsupportedActionException.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/UnsupportedActionException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UnsupportedActionException.java 28 Sep 2004 09:52:24 -0000 1.1 +++ UnsupportedActionException.java 29 Sep 2004 17:15:24 -0000 1.2 @@ -24,6 +24,7 @@ * An exception thrown when an action URL is not supported. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class UnsupportedActionException extends RuntimeException { Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- WebClient.java 22 Sep 2004 02:02:09 -0000 1.61 +++ WebClient.java 29 Sep 2004 17:15:24 -0000 1.62 @@ -135,7 +135,7 @@ * Returns the response associated with the specified frame name in the main window. * Throws a runtime exception if no matching frame is defined. * - * @since 1.5.5 + * @since 1.6 **/ public WebResponse getFrameContents( FrameSelector targetFrame ) { return _mainWindow.getFrameContents( targetFrame ); @@ -164,7 +164,7 @@ /** * Defines a cookie to be sent to the server on every request. - * @deprecated as of 1.5.5, use #putCookie instead. + * @deprecated as of 1.6, use #putCookie instead. **/ public void addCookie( String name, String value ) { _cookieJar.addCookie( name, value ); @@ -238,6 +238,8 @@ /** * Specifies a proxy server to use, along with a user and password for authentication. + * + * @since 1.6 */ public void setProxyServer( String proxyHost, int proxyPort, String userName, String password ) { setProxyServer( proxyHost, proxyPort ); Index: WebForm.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebForm.java,v retrieving revision 1.100 retrieving revision 1.101 diff -u -r1.100 -r1.101 --- WebForm.java 28 Sep 2004 09:52:24 -0000 1.100 +++ WebForm.java 29 Sep 2004 17:15:25 -0000 1.101 @@ -75,7 +75,7 @@ * Will usually return the result of that submission; however, if the submit button's 'onclick' * or the form's 'onsubmit' event is triggered and * inhibits the submission, will return the updated contents of the frame containing this form. - * @since 1.5.5 + * @since 1.6 **/ public WebResponse submit( SubmitButton button, int x, int y ) throws IOException, SAXException { return button.doOnClickEvent() ? doFormSubmit( button, x, y ) : getCurrentFrameContents(); @@ -84,7 +84,7 @@ /** * Submits this form using the web client from which it was originally obtained, ignoring any buttons defined for the form. - * @since 1.5.5 + * @since 1.6 **/ public WebResponse submitNoButton() throws SAXException, IOException { return submit( SubmitButton.createFakeSubmitButton( this /* fake */ ) ); @@ -626,7 +626,7 @@ /** * Sets the single value of a file upload parameter in this form. * A more convenient way to do this than using {@link #setParameter(String,UploadFileSpec[])} - * @since 1.5.5 + * @since 1.6 */ public void setParameter( String name, File file ) { setParameter( name, new UploadFileSpec[] { new UploadFileSpec( file ) } ); @@ -653,7 +653,7 @@ * @param value of the checkbox parameter * @throws IllegalArgumentException if the specified parameter is not a checkbox or if there is no checkbox * with the specified name and value. - * @since 1.5.5 + * @since 1.6 */ public void toggleCheckbox( String name, String value ) { FormParameter parameter = getParameter( name ); @@ -684,7 +684,7 @@ * @param state the new state of the checkbox * @throws IllegalArgumentException if the specified parameter is not a checkbox or if there is no checkbox * with the specified name and value. - * @since 1.5.5 + * @since 1.6 */ public void setCheckbox( String name, String value, boolean state ) { FormParameter parameter = getParameter( name ); Index: WebLink.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebLink.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- WebLink.java 12 Sep 2004 03:31:58 -0000 1.46 +++ WebLink.java 29 Sep 2004 17:15:25 -0000 1.47 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2003, Russell Gold +* Copyright (c) 2000-2004, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -67,6 +67,7 @@ /** * Returns the text value of this link. + * @since 1.6 **/ public String getText() { if (getNode().getNodeName().equalsIgnoreCase( "area" )) { @@ -79,7 +80,7 @@ /** * Returns the text value of this link. - * @deprecated use #getText instead + * @deprecated as of 1.6, use #getText instead **/ public String asText() { return getText(); Index: WebList.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WebList.java 8 Aug 2004 17:45:32 -0000 1.1 +++ WebList.java 29 Sep 2004 17:15:25 -0000 1.2 @@ -28,13 +28,19 @@ import com.meterware.httpunit.scripting.ScriptableDelegate; /** + * Represents an HTML list. Experimental. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> + * @since 1.6 **/ public class WebList extends HTMLElementBase { + /** Indicator of an ordered list (HTML tag <ol>) */ + public static final int ORDERED_LIST = 1; + + /** Indicator of a bullet list (HTML tag <ul>) */ + public static final int BULLET_LIST = 2; - public static int ORDERED_LIST = 0; private WebResponse _response; private FrameSelector _frame; private URL _baseURL; @@ -42,10 +48,16 @@ private String _characterSet; private ArrayList _items = new ArrayList(); + private int _listType; public WebList( WebResponse response, FrameSelector frame, URL baseURL, String baseTarget, Element element, String characterSet ) { super( element ); + if (element.getNodeName().equalsIgnoreCase( "ol" )) { + _listType = ORDERED_LIST; + } else if (element.getNodeName().equalsIgnoreCase( "ul" )) { + _listType = BULLET_LIST; + } _response = response; _frame = frame; _baseURL = baseURL; @@ -55,7 +67,7 @@ public int getListType() { - return 0; + return _listType; } Index: WebRequestSource.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequestSource.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- WebRequestSource.java 28 Sep 2004 09:52:25 -0000 1.41 +++ WebRequestSource.java 29 Sep 2004 17:15:25 -0000 1.42 @@ -86,7 +86,7 @@ /** * Returns the name of the frame containing this request source. - * @deprecated as of 1.5.5, use #getFrame + * @deprecated as of 1.6, use #getFrame */ public String getPageFrame() { return _frame.getName(); Index: WebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebResponse.java,v retrieving revision 1.136 retrieving revision 1.137 diff -u -r1.136 -r1.137 --- WebResponse.java 26 Sep 2004 01:30:37 -0000 1.136 +++ WebResponse.java 29 Sep 2004 17:15:25 -0000 1.137 @@ -345,6 +345,7 @@ /** * Returns the HTMLElements found with the specified attribute value. + * @since 1.6 */ public HTMLElement[] getElementsWithAttribute( String name, String value ) throws SAXException { return getReceivedPage().getElementsWithAttribute( name, value ); @@ -501,7 +502,7 @@ /** * Returns an array of text blocks found in the page. - * @since 1.5.5 + * @since 1.6 */ public TextBlock[] getTextBlocks() throws SAXException { return getReceivedPage().getTextBlocks(); @@ -510,7 +511,7 @@ /** * Returns the text block after the specified block, if any. - * @since 1.5.5 + * @since 1.6 */ public TextBlock getNextTextBlock( TextBlock block ) throws SAXException { return getReceivedPage().getNextTextBlock( block ); @@ -519,7 +520,7 @@ /** * Returns the first link found in the page matching the specified criteria. - * @since 1.5.5 + * @since 1.6 * @exception SAXException thrown if there is an error parsing the response. **/ public TextBlock getFirstMatchingTextBlock( HTMLElementPredicate predicate, Object criteria ) throws SAXException { |