• Post Reply Bookmark Topic Watch Topic
  • New Topic

junit  RSS feed

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Thanks
 
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by lakshmi manepally:
Can anyone help me in writing test cases using Junit in Eclipse from scratch with clear examples.


Which of these tutorials have you already gone through?

Originally posted by lakshmi manepally:
I have installed junit using eclipse, but I don't know how to write testcases.


Regarding how to write JUnit test cases, read through the official documentation. Especially this article could be a good starting point.

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.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to test a servlet or jsp? Give some examples.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to test a servlet or jsp?



Lasse linked to jWebUnit and Selenium. Have you looked at those?
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please give me some examples to test a java class?
It would be really helpful for me to test
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!