[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebLinkTest.java,1.19,1.20
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-07-25 11:19:21
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv28540/test/com/meterware/httpunit Modified Files: WebLinkTest.java Log Message: Rajan Narasimhan: fixed problem with base URLs containing slash in a query string Index: WebLinkTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebLinkTest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- WebLinkTest.java 23 Jan 2002 18:35:56 -0000 1.19 +++ WebLinkTest.java 25 Jul 2002 11:19:18 -0000 1.20 @@ -192,6 +192,23 @@ } + public void testLinksWithSlashesInQuery() throws Exception { + WebConversation wc = new WebConversation(); + defineResource( "sample/Initial.html?age=3/5", "<html><head><title>Initial</title></head><body>" + + "Go to <a href=\"Next.html\">the next page.</a>" + + "</body></html>" ); + defineWebPage( "sample/Next", "And go back to <a href=\"Initial.html?age=3/5\">the first page.</a>" ); + + WebResponse initialPage = wc.getResponse( getHostPath() + "/sample/Initial.html?age=3/5" ); + 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", "sample/Next", nextPage.getTitle() ); + assertEquals( "Num links in next page", 1, nextPage.getLinks().length ); + } + + public void testDocumentBase() throws Exception { WebConversation wc = new WebConversation(); defineWebPage( "alternate/Target", "Found me!" ); |