[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit package.html,1.4,1.5
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-11-03 17:37:41
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv17912/src/com/meterware/httpunit Modified Files: package.html Log Message: update JavaDoc Index: package.html =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/package.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- package.html 26 Oct 2000 14:16:49 -0000 1.4 +++ package.html 3 Nov 2002 17:37:37 -0000 1.5 @@ -8,9 +8,20 @@ requests based on either submitting a form or clicking on a link. <H2>Installation</H2> -The package depends on <A HREF="http://lempinen.net/sami/jtidy">JTidy</A>, an HTML parser/validator. -The jtidy.jar must be in the class path ahead of any other implementation of the DOM classes. In addition, -unit tests will require <A HREF="http://junit.org/">JUnit</A> as well. +The package depends on a number of external jar files, provided in the <code>jar</code> directory: +<dl><dt>nekohtml.jar</dt><dd>The <a href="http://www.apache.org/~andyc/neko/doc/html/index.html">NekoHTML parser</a>, +used to convert raw HTML into an XML DOM. This is required for handling HTML.</dd> +<dt>js.jar</dt><dd>The <a href="http://www.mozilla.org/rhino">Rhino JavaScript interpreter<a>, required for any JavaScript processing.</dd> +<dt>xmlParserAPIs.jar</dt><dd>The interfaces for a W3-compliant XML parser. Required for interpreting either HTML or XML pages.</dd> +<dt>xercesImpl.jar</dt><dd>The <a href="http://xml.apache.org/xerces2-j/index.html">Xerces 2 implementation</a> of an XML parser. +NekoHTML requires this implementation. +<dt>servlet.jar</dt><dd>The APIs and common classes for the Java Servlet 1.3 standard. Required for use with <a href="../servletunit-intro.html">ServletUnit.</a></dd> +<dt>junit.jar</dt><dd><a href="http://www.junit.org">JUnit</a>, the unit test framework. Used to test HttpUnit and +recommended for writing tests that use HttpUnit.</dd> +</dl> +No longer included, but still supported, is <A HREF="http://lempinen.net/sami/jtidy">JTidy</A>, an alternate HTML parser/validator. +JTidy is a lot pickier about HTML structure than NekoHTML, and uses its own implementation of the DOM classes, rather than using those +found in the xerces jar. Some JavaScript features, such as <code>document.write()</code> will only work with NekoHTML. <H2>Example</H2> @@ -30,19 +41,15 @@ public static void main( String[] params ) { try { - WebRequest request; - WebResponse response; WebConversation conversation = new WebConversation(); - request = new GetMethodWebRequest( "http://www.meterware.com/servlet/TopSecret" ); - response = conversation.getResponse( request ); + WebResponse response = conversation.getResponse( "http://www.meterware.com/servlet/TopSecret" ); System.out.println( response ); WebForm loginForm = response.getForms()[0]; - request = loginForm.getRequest(); - request.setParameter( "name", "master" ); - response = conversation.getResponse( request ); + loginForm.setParameter( "name", "master" ); + response = loginForm.submit(); System.out.println( response ); } catch (Exception e) { @@ -52,5 +59,5 @@ } </PRE> -Please direct any questions to <A HREF="mailto:rus...@ac...">Russell Gold</A>. +Please direct any questions to <A HREF="mailto:rus...@ht...">Russell Gold</A>. </BODY></HTML> |