File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes test my jsp of my web application no in the networc company Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "test my jsp of my web application no in the networc company" Watch "test my jsp of my web application no in the networc company" New topic

test my jsp of my web application no in the networc company

Dora Di Donato
Ranch Hand

Joined: Nov 27, 2009
Posts: 60
Hi guys,
How can test a jsp that use the tag of spring and the controlle exends the simpleformcontroller of my webapplicatio but I am not on the network company so I don't find the databes,webservise and other.
Someone can suggest me there is a way??


Tim Cooke

Joined: Mar 28, 2008
Posts: 836

What you are describing here, including the controllers, application, database, webservices, is not Unit Testing. That sounds very much like an Integration Test to me.

Unit testing the presentation layer is, and always has, been a difficult task. But there are a couple of tools in the kit that we can use.

First off you can use a web testing tool such a Selenium to drive and observe the Browser user interface. These sorts of tools hook into the browser using the xpath, DOM id, or DOM class. The advantage of these sorts of tools is that they're relatively easy to get going with. The downside is that they require a browser to be installed to run and can be quite picky with what browsers and versions they're run with. Another downside is that if you change the UI you may break your tests. This leads your tests to be pretty flakey.

Secondly you can use something like JspTest which will directly test the data being passed up to the presentation layer in the JSP tags. While you are not testing the layout of your UI (which you probably shouldn't be doing anyway) it will test that the required data is being received correctly and for submission data is being sent correctly. You are now testing the functionality of your presentation layer with a Unit Test which is really what we want to be doing. (Disclaimer: I haven't used JspTest, just read about it in Lasse Koskela's Test Driven book).

If you setup your test cases so that the controllers are mocked out then you do not need access to anything beyond that to run your presentation Unit Tests. So lack of network access will not be a problem.

Tim Driven Development
I agree. Here's the link:
subject: test my jsp of my web application no in the networc company
Similar Threads
Oracle License for production and test issue
Web Hosting Companies
URGENT: Help needed for Job Change
jsp, servlet upload on webserver (workes on localhost)
does this make sense