Can anyone help me in writing test cases using Junit in Eclipse from scratch with clear examples. I have installed junit using eclipse, but I don't know how to write testcases. Could you please suggest me any sites where can I learn testing a web application with junit
Originally posted by lakshmi manepally: Could you please suggest me any sites where can I learn testing a web application with junit.
You don't test web applications with JUnit. You test code with JUnit. For testing web applications, you should look into tools such as jWebUnit or Selenium. These are tools that interact with a web application over HTTP and provide means for performing assertions against the generated HTML content, for example.
Originally posted by lakshmi manepally: How to test a servlet or jsp? Give some examples.
If you are new to unit testing, you shouldn't start testing those. Extract as much logic as possible into plain Java classes and start testing those.
Unit testing servlet-classes or JSPs is an advanced topic that I wouldn't advice to tackle before you feel comfortable testing "normal" Java classes.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus