• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unit : clarifications

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,

We want to use junit in our applications, the problem i am facing is , is junit used to test a piece of code or to test functionality.MY appliaction is a web applicaiton .I have get data from ui through servlet/jsf and pass the data to backedn throgh facade pattern i.e i have some service classes and then there is dao layer or a webservice layer which will persist or fetch data from backend services.We have classified our applications in to three projects one is core progject which is like api where we have helper classes like db connection and JDBC utiliity classses.THen there is serice project where basically has service and vo and the web project.NOw how can i use junit in this scenario should i use it to test end to end funcitonality or just do a piece of code testing please help
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pure JUnit is best for non-web code. This would be your service layer/back end. To test the front end, you could use JWebUnit or Selenium.

I recommend starting by just testing your back end with JUnit to get used to testing and build skills before going on to automated testing on the front end.
 
vinay basavanal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you now i have mentioned that i have two different projects , one is for service and other is backend layer , service layer interacts with backend what should be my aim actually should it be to test code or functionality, should i write test case for serviced layer alone without backend and how it must be.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For testing that includes the database, I'd test the service and back end layers together. (Assuming they do what they sound like.) For true unit testing, I'd test them separately and mock out any resources used.

I recommend starting with the testing that involves both layers and the database. It's easier to start with and gives you more bang for the buck.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic