[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit PseudoServerTest.java,1.18,1.19
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-01-10 22:18:16
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv11271/test/com/meterware/httpunit
Modified Files:
PseudoServerTest.java
Log Message:
Handle initial empty cookie
Index: PseudoServerTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/PseudoServerTest.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- PseudoServerTest.java 2001/11/26 14:20:13 1.18
+++ PseudoServerTest.java 2002/01/10 22:18:14 1.19
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
-* Copyright (c) 2000-2001, Russell Gold
+* Copyright (c) 2000-2002, 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
@@ -195,6 +195,7 @@
PseudoServer ps = new PseudoServer();
int port = ps.getConnectedPort();
ps.setResource( resourceName, resourceValue );
+ ps.addResourceHeader( resourceName, "Set-Cookie: HSBCLoginFailReason=; path=/" );
ps.addResourceHeader( resourceName, "Set-Cookie: age=12, name= george" );
ps.addResourceHeader( resourceName, "Set-Cookie: type=short" );
ps.addResourceHeader( resourceName, "Set-Cookie: funky=ab$==" );
@@ -207,7 +208,8 @@
WebResponse response = wc.getResponse( request );
assertEquals( "requested resource", resourceValue, response.getText().trim() );
assertEquals( "content type", "text/html", response.getContentType() );
- assertEquals( "number of cookies", 7, wc.getCookieNames().length );
+ assertEquals( "number of cookies", 8, wc.getCookieNames().length );
+ assertEquals( "cookie 'HSBCLoginFailReason' value", "", wc.getCookieValue( "HSBCLoginFailReason" ) );
assertEquals( "cookie 'age' value", "12", wc.getCookieValue( "age" ) );
assertEquals( "cookie 'name' value", "george", wc.getCookieValue( "name" ) );
assertEquals( "cookie 'type' value", "short", wc.getCookieValue( "type" ) );
|