Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get request scope attribute values thru HttpUnit

 
saritha Reddy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application is built using struts 1.1. We are also using tiles concept.I'm trying to execute some Unit test case using HttpUnit & JUnit. At Java layer I set one ArrayList to request using request.setAttribute().How can i retrive this attribute values in my HttpUnit TestCase.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't, because httpUnit actually isn't a unit testing framework. It's a system testing framework simulating a web client, so all you can do is make assertions about information available at the client side (HTML, cookies etc.).

HttpUnit is coming with ServletUnit that you could possibly be used for this. I'm not totally sure, though. Take a look at the documentation on the httpUnit homepage...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic