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

JUNIT to test a web application

 
SaravanaKumar Venugopal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
Is there a way to test the web application(My application uses Jsp, Servlet and Struts) starting from Presenatation layer to DAO layer with Ant script.

If there is a method, please provide a sample script
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant would just run the junit test so the Ant part isn't important to the question. There are two main approaches.

  • Test in browser - selenium is most common. It offers a junit interface but you need a browser installed
  • Test from URL but without browser - JWebUnit is good here
  • Forget about the URL and start at the servlet/struts action/spring controller/etc. - Here you can just use JUnit in container testing
  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic