[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebLinkTest.java,1.16,1.17
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-11-27 16:40:51
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv25123/test/com/meterware/httpunit
Modified Files:
WebLinkTest.java
Log Message:
Added security to servlet unit tutorial
Index: WebLinkTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebLinkTest.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- WebLinkTest.java 2001/11/09 18:35:14 1.16
+++ WebLinkTest.java 2001/11/27 16:40:47 1.17
@@ -160,6 +160,27 @@
}
+ public void testLinksWithFragmentsAndParameters() throws Exception {
+ WebConversation wc = new WebConversation();
+ defineResource( "Initial.html?age=3", "<html><head><title>Initial</title></head><body>" +
+ "Go to <a href=\"Next.html\">the next page.</a> <a name=\"bottom\">Bottom</a>" +
+ "</body></html>" );
+ defineWebPage( "Next", "And go back to <a href=\"Initial.html?age=3#Bottom\">the first page.</a>" );
+
+ WebResponse initialPage = wc.getResponse( getHostPath() + "/Initial.html?age=3" );
+ assertEquals( "Num links in initial page", 1, initialPage.getLinks().length );
+ WebLink link = initialPage.getLinks()[0];
+
+ WebResponse nextPage = wc.getResponse( link.getRequest() );
+ assertEquals( "Title of next page", "Next", nextPage.getTitle() );
+ assertEquals( "Num links in next page", 1, nextPage.getLinks().length );
+ link = nextPage.getLinks()[0];
+
+ WebResponse thirdPage = wc.getResponse( link.getRequest() );
+ assertEquals( "Title of next page", "Initial", thirdPage.getTitle() );
+ }
+
+
public void testDocumentBase() throws Exception {
WebConversation wc = new WebConversation();
defineWebPage( "alternate/Target", "Found me!" );
|