Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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
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: 42974
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
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
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!