[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebClientTest.java,1.4,1.5
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-06-26 15:48:59
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv17599/test/com/meterware/httpunit Modified Files: WebClientTest.java Log Message: Support acceptCookies global option Index: WebClientTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebClientTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- WebClientTest.java 26 Jun 2002 15:12:01 -0000 1.4 +++ WebClientTest.java 26 Jun 2002 15:48:56 -0000 1.5 @@ -88,6 +88,23 @@ } + public void testCookiesDisabled() throws Exception { + String resourceName = "something/baking"; + String resourceValue = "the desired content"; + + defineResource( resourceName, resourceValue ); + addResourceHeader( resourceName, "Set-Cookie: age=12" ); + + HttpUnitOptions.setAcceptCookies( false ); + WebConversation wc = new WebConversation(); + WebRequest request = new GetMethodWebRequest( getHostPath() + '/' + resourceName ); + WebResponse response = wc.getResponse( request ); + assertEquals( "requested resource", resourceValue, response.getText().trim() ); + assertEquals( "content type", "text/html", response.getContentType() ); + assertEquals( "number of cookies", 0, wc.getCookieNames().length ); + } + + public void testOldCookies() throws Exception { String resourceName = "something/baking"; String resourceValue = "the desired content"; |