[Httpunit-commit] CVS: httpunit/test/com/meterware/servletunit StatefulTest.java,1.4,1.5
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-25 17:17:33
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/servletunit In directory sc8-pr-cvs1:/tmp/cvs-serv21722/test/com/meterware/servletunit Modified Files: StatefulTest.java Log Message: Support HttpSession.getValueNames Index: StatefulTest.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/servletunit/StatefulTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- StatefulTest.java 21 Oct 2002 13:34:19 -0000 1.4 +++ StatefulTest.java 25 Feb 2003 17:17:29 -0000 1.5 @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * -* Copyright (c) 2000-2001, Russell Gold +* Copyright (c) 2000-2003, 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 @@ -20,7 +20,6 @@ * *******************************************************************************************************************/ import java.io.*; -import java.net.HttpURLConnection; import java.util.Enumeration; import javax.servlet.ServletException; @@ -33,7 +32,7 @@ import com.meterware.httpunit.*; /** - * Tests support for stateless HttpServlets. + * Tests support for state-management behavior. **/ public class StatefulTest extends TestCase { @@ -128,6 +127,10 @@ assertTrue( "No attribute names in list", e.hasMoreElements() ); assertEquals( "First attribute name", "color", e.nextElement() ); assertTrue( "List did not end after one name", !e.hasMoreElements() ); + + String[] names = ic.getRequest().getSession().getValueNames(); + assertEquals( "number of value names", 1, names.length ); + assertEquals( "first name", "color", names[0] ); } |