Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Monday, June 22, 2009

Setting up JUnit in your Eclipse Project

The following is the first steps to adding JUnit test cases to your Eclipse project. It's the first step in working your processes towards Test Driven Development, which is the bread and butter of Agile and XP Programming methodologies and techniques.

Step 1: Download JUnit


The first step is to download the most recent version of JUnit (look for the 'Releases' link off the homepage). At the time of this article, the latest version was 4.6.

Step 2: Add JUnit to your Eclipse project's build path.


Right click on your project and select 'Properties'.
Click 'Java Build Path'.
Click the 'Libraries' tab.
Click 'Add JARs' (if you've added the JAR into your workspace)
or
Click 'Add External JARs' (if you are linking the JAR from outside your workspace)
In the GUI, select the JUnit jar (junit-4.6.jar).

Step 3: Organize your source folders


One recommended practice is to organize your source folders into the following structure:

[project]
-- src    
-- main   (module code)
-- test   (test code only)


Create the above directory structure under your project in Eclipse.
Right click on your project and select 'Properties'.
Click 'Java Build Path'.
Click the 'Source' tab.
Add the 'main' and 'test' folders as source folders in your project and deselect 'src' as a source folder.

Ready to go


You now have effectively integrated JUnit into your project, provided a clean way to separate your code base with your testing code.

Any questions, feel free to comment and I'll get back to you as soon as I can.

137 comments:

  1. Replies
    1. Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

      Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Java Online Training Java Online Training Java Online Training Java Online Training

      Delete
  2. I went through article, and it’s totally awesome. Java is most popular programming language and its considered as base to various new technologies like Hadoop, Salesforce, etc.
    Java Training in Chennai

    ReplyDelete
  3. Thanks for sharing your informative article on Hive ODBC Driver. Your article is very descriptive and assists me to learn whole concept in detail. Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete
  4. Java is the best programming language that are serving as a entry point for fresher like me. The content you have provided here tells me that clearly. This will be useful for my training program. Thanks for sharing this useful information here. You are running a great blog though.

    JAVA Training in Chennai | JAVA Training Institutes in Chennai | Selenium training in chennai

    ReplyDelete
  5. Excellent post!!! In this competitive market, customer relationship management plays a significant role in determining a business success. That too, cloud based CRM product offer more flexibility to business owners to main strong relationship with the consumers. Salesforce Training Institutes in Chennai | Salesforce Training in Chennai

    ReplyDelete
  6. Responsive desing can yield a very good revenue to a business. It has been discovered since the usage of multiple devices increase. The content furnished above too tells the same. Thanks for sharing this information in here. Please keep bloging content like this.

    Web designing course in chennai | Web designing institute in chennai | PHP Training in Chennai

    ReplyDelete
  7. Cloud has beome the common word that is being used by most of the professional these day. The reason for relying on this technology is security. Your content too lecture the same. Thanks for sharing this worth able information in here. Keep blogging article like this.

    Hadoop Training Chennai
    | Hadoop training institutes in chennai | Manual testing training in Chennai

    ReplyDelete
  8. Great Post in Java Technology..

    ReplyDelete
  9. Best Java Training Institute In ChennaiThis information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic..

    ReplyDelete
  10. This blog is impressive and informative.It clearly explains about the concept and its techniques.Thanks for sharing this information.Please update this type of information
    Salesforce Training in Chennai

    ReplyDelete
  11. HTML5 is the recently arrived most trending technology that has bright future. If you are interested in studying HTML5 training visit this website.
    html5 training in chennai | html5 training chennai | html5 course in chennai

    ReplyDelete
  12. Java is programing language which is used in almost all the applications and games which are on the web. Java is being used extensively and it will be used extensively in near future. So getting trained in Java will surely be helpful.
    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    ReplyDelete
  13. iFlyChat is an ongoing talk module most appropriate for group and long range informal communication sites. It helps in expanding client engagement of your WordPress site by empowering clients to visit with each other secretly (balanced private discussion), bunch talk or in talk rooms
    Wp Chat

    ReplyDelete
  14. This was a great and interesting article to read. I have really enjoyed all of this very cool information affordable seo packages

    ReplyDelete
  15. Wonderful post. Thanks for sharing such a informative post.

    Wordpress development in chennai

    ReplyDelete
  16. To keep ourselves up to date with the current trend is not an easy task in IT. But we can, through quality and worth able content like this. Thanks for sharing this web page. Please write more articles like this in future.
    PHP training in Chennai | PHP course in Chennai

    ReplyDelete
  17. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. The Struts, Spring, Hibernate are the advanced level of programming language which are most widely used.
    hibernate training in chennai | hibernate training

    ReplyDelete

  18. Hello Admin,
    Awesome Post! I like writing style, how you describing the topics throughout the post. I hope many web reader will keep reading your post at the end, Thanks for sharing your view.
    Regards,
    PHP Institutes in Chennai|PHP Training in Chennai|PHP Course in Chennai

    ReplyDelete
  19. Ethical hacking describes hacking performed by a company or individual to help them to identify potential threats on a computer or network.
    Ethical hacking Course in Chennai | Ethical hacking Training in Chennai

    ReplyDelete
  20. Good post. Thanks for sharing such a informative post.

    web design courses in chennai

    ReplyDelete
  21. Nice blog. Thanks for sharing such a useful post.

    php training in chennai

    ReplyDelete
  22. The usage of third party storage system for the data storage can be avoided in cloud computing and we can store, access the data through internet.
    cloud computing training in chennai | cloud computing courses in chennai

    ReplyDelete
  23. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete
  24. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete
  25. Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me this article. You have done a great job by sharing this content in here. Keep writing article like this.
    SAS Training in Chennai | SAS Course in Chennai

    ReplyDelete
  26. Very useful content thanks for sharing such a informative content which provided me the required information on the various technology.
    AngularJS Training in Chennai | AngularJS course in Chennai

    ReplyDelete
  27. Hibernate Training Institutes in ChennaiHibernate Training Institutes in Chennai Hibernate Online Training Hibernate Online Training Hibernate Training in Chennai Hibernate Training in Chennai Java Online Training Java Online Training

    ReplyDelete
  28. Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
    informix training in chennai

    ReplyDelete
  29. Thanks for sharing this unique and informative content which provided me the required information.
    mvc training in chennai

    ReplyDelete
  30. Nice blog. Thanks for sharing such a useful post.
    Selenium Training In Chennai

    ReplyDelete
  31. looking for ORACLE RAC in Training in Chennai? then join us at Greens Technology. Oracle Rac Training in Chennai

    ReplyDelete
  32. Very useful content thanks for sharing such a informative content...
    webshere training in chennai

    ReplyDelete
  33. Pleasant Post. It is truly intriguing to peruse from the earliest starting point and I might want to share your site to my circles, continue sharing more like this.
    Regards,
    Hadoop Training in Chennai | Hadoop course in Chennai | Bigdata Training | Bigdata course in Chennai

    ReplyDelete
  34. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    Web Designing Course in Chennai | web designing training in chennai

    ReplyDelete
  35. Very interesting content which helps me to get the in depth knowledge about the technology. To know more details about the course visit this website.
    Digital marketing course in Chennai | Digital marketing training in Chennai

    ReplyDelete
  36. Learning AngularJs course will becoming you as a web developer. Web designer and developer have great demand in today’s IT sectors.
    Regards,
    Angularjs Training | Angularjs Training in Chennai | Angularjs course in Chennai

    ReplyDelete
  37. A debt of gratitude is in order for requiring some serious energy share this post. It is truly useful. I propose to visit this site to my group members. Please continue posting this way.
    Regards,
    SAS Training in Chennai | SAS Courses in Chennai | SAS Training center in Chennai

    ReplyDelete
  38. This substance makes another trust and motivation within me. A debt of gratitude is in order for sharing article this way. The way you have expressed everything above is entirely amazing. Continue blogging this way.
    Regards,
    Spring Training in Chennai | Spring course in Chennai | Spring Framework Training in Chennai

    ReplyDelete
  39. Great and useful post.Thanks for taking time to share this informative post to my vision.
    Regards,
    Manual Testing Training in Chennai | Manual Testing course in Chennai

    ReplyDelete
  40. Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me this article.
    SAS Training in Chennai | SAS Training Institute in Chennai

    ReplyDelete
  41. A debt of gratitude is in order for the enlightening article. This is one of the best assets I have found in a long while. Pleasantly composed and incredible data. I truly can't thank you enough to share.
    Regards,
    Java Training in Chennai | Java course in Chennai | Best Java Training in Chennai

    ReplyDelete
  42. Thanks for sharing this junit test cases.It is really helpful to me.
    Regards,
    Oracle Training in Chennai | oracle dba training in chennai

    ReplyDelete
  43. Salesforce is a CRM tool which runs on cloud and very easy to use. Cloud computing is very convenient as there is no need for dedicated infrastructure for cloud computing.
    Thanks,
    Salesforce Training in Chennai | Salesforce Training Institutes in Chennai | Salesforce course in Chennai

    ReplyDelete
  44. Wonderful article with lots of useful information very interesting to read and hearty thanks to the article writer.
    Regards
    Selenium Training in Chennai | Java Training in Chennai

    ReplyDelete
  45. Thanks for your great information. Keep Updating.
    ERP in Chennai | ERP Providers in Chennai | ERP Software Company in Chennai. Brave Technologies Private Limited is an one of the best Low Cost ERP Software Solution for all Industries.

    ReplyDelete
  46. Hi, Really your post was very informative. Today's internet era learn Hadoop Online Training will helps you to reach your goal.Selenium Training

    ReplyDelete
  47. Nice sharing. R is a language and environment for statistical computing and graphics. Want to make a career in R Programming. Learn R Programming Training course @ GangBoard. We are the best provider of online training on evergreen technologies.

    ReplyDelete
  48. You have done really great job. Your blog is very unique and informative. Thanks. Devops Online Training | Data Science Online Training

    ReplyDelete
  49. The best thing is that your blog really informative thanks for your great information!
    erp in chennai

    ReplyDelete
  50. Excellent post! I heve read your blog it's very interesting and informative. Keep sharing.
    erp providers in chennai | erp software chennai

    ReplyDelete
  51. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it. erp software in chennai.

    ReplyDelete
  52. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    PHP training in chennai

    ReplyDelete
  53. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    Sharepoint Training in Chennai

    ReplyDelete
  54. Useful blog.i liked your step by step explanation.you follow the unique way.Thanks for sharing.so Learn high level language in best institute.more details..... Android Training in Chennai
    Dot Net Training in Chennai
    Hadoop Training in Chennai
    Selenium Training in Chennai

    ReplyDelete
  55. This comment has been removed by the author.

    ReplyDelete
  56. I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon...
    Java Training in Chennai

    ReplyDelete
  57. Driven Development, which is the bread and butter of Agile and XP Programming methodologies and techniques.web design tutorials

    ReplyDelete
  58. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Data Science with SAS Training, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Sangita Mohanty
    MaxMunus
    E-mail: sangita@maxmunus.com
    Skype id: training_maxmunus
    Ph:(0) 9738075708 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete
  59. Awesome blog. I enjoyed reading your articles. This is truly a great read for me.
    Suchmaschinenoptimierung in Lüdenscheid

    ReplyDelete
  60. Thanks for the useful post. Keep posting more like this.
    Webdesign Lüdenscheid

    ReplyDelete
  61. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    office 2010 professional plus key deutsch

    ReplyDelete
  62. Interesting post! This is really helpful for me. I like it! Thanks for sharing!

    Webdesign Lüdenscheid

    ReplyDelete
  63. Your website content nice nice and interesting to observe.
    jobbörse Neunkirchen

    ReplyDelete
  64. Your website content nice nice and interesting to observe.
    jobbörse Neunkirchen

    ReplyDelete
  65. http://www.j2eeprogrammer.com/2009/06/adding-junit-test-cases-to-your-eclipse.html?showComment=1480408834287#c3909258665286697944

    ReplyDelete
  66. Good post and I like it very much. By the way, anybody try this increase app downloads? I do not how to use.

    ReplyDelete
  67. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    online marketing lüdenscheid

    ReplyDelete
  68. Your website content nice nice and interesting to observe.
    Internet Marketing Dienstleistungen

    ReplyDelete
  69. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog
    Best digital marketing workshop in chennai

    ReplyDelete
  70. I found a lot of interesting information here. A really good post
    WebDesign Lüdenscheid

    ReplyDelete

  71. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    online marketing lüdenscheid

    ReplyDelete

  72. You've made some good points there. I looked on the internet for more information about this


    Hadoop Training In Chennai | Sap MM Training In Chennai | ETL Testing Training In Chennai

    ReplyDelete
  73. I read this article. I think You put a lot of effort to create this article. I appreciate your work.
    Dissertation Writing Services

    ReplyDelete

  74. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    arguments against big bang theory

    ReplyDelete
  75. There are numerous stores, stands, corners, banks and other budgetary organizations around the country that give this administration. check cashing san diego

    ReplyDelete
  76. Thanks for sharing this valuable information.. I saw your website and get more details..Nice work...
    Java Training in Chennai | Java Training in Kanchipuram

    ReplyDelete
  77. I think this is the best article today about the future technology. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.


    Selenium Training in Chennai
    Selenium Course in Chennai
    iOS Course in Chennai
    iOS Training Chennai
    best ios training in chennai
    JAVA Training in Chennai
    JAVA Course in Chennai

    ReplyDelete
  78. Thanks for sharing this valuable information.. I saw your website and get more details..Nice work...
    Android Training in Chennai | Android Training in Kanchipuram

    ReplyDelete
  79. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Robotic Process Automation Training in Chennai | Robotic Process Automation Training in Taramani

    ReplyDelete
  80. Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
    Air Hostess Training in Chennai | Air Hostess Training Institute in Chennai | Air Hostess Academy in Chennai | Air Hostess Course in Chennai | Air Hostess Institute in Chennai

    ReplyDelete
  81. Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
    Air Hostess Training in Chennai | Air Hostess Training Institute in Chennai | Air Hostess Academy in Chennai | Air Hostess Course in Chennai | Air Hostess Institute in Chennai

    ReplyDelete
  82. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way. T hank you so much.
    CCNA Training in Chennai
    DevOps Training in Chennai
    DevOps course
    Best devOps Training in Chennai
    CCNA certification in Chennai
    CCNA Training

    ReplyDelete
  83. Innovative thinking of you in this blog makes me very useful to learn.
    i need more info to learn so kindly update it.
    angularjs training center in bangalore
    AngularJS courses in Anna Nagar
    AngularJS Certification Training in T nagar

    ReplyDelete
  84. Really it was an awesome article. Very useful & Informative..Thanks for sharing..
    iOS Training in Chennai | iOS Training in Tambaram

    ReplyDelete
  85. very interesting topic.Helps to gain knowledge about lot of information. Thanks for posting information in this blog.
    Dot net Training in Chennai | Dot net Training in Perungudi

    ReplyDelete
  86. This blog very easily understandable. Thanks for sharing such an informative post with us.This is a nice post in an interesting line of content.
    Python Training in Chennai | Python Training in Madipakkam

    ReplyDelete
  87. Thanks for sharing this valuable information.. I saw your website and get more details..Nice work...
    ISTQB Training in Chennai | ISTQB Training in Guindy

    ReplyDelete
  88. It is very excellent blog and useful article thank you for sharing with us, keep posting.
    Software Testing Training in Chennai | Software Testing Training in Saidapet

    ReplyDelete
  89. Brilliant ideas that you have share with us.It is really help me lot and i hope it will help others also.update more different ideas with us.
    german language coaching centres in bangalore
    german language tutorial in bangalore
    German Training in Mogappair
    German Training in Nungambakkam

    ReplyDelete
  90. Excellent information with unique content and it is very useful to know about the information based on blogs...
    Java Training in Chennai | Java Training in Chrompet

    ReplyDelete
  91. All the points you described so beautiful. Every time i read your blog content and i so surprised that how you can write so well.
    Graphic Designing Training in Chennai | Graphic Designing Training in Keelkattalai

    ReplyDelete
  92. Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
    Ethical Hacking Training in Chennai | Ethical Hacking Training in Thiruvanmiyur

    ReplyDelete
  93. Thanks its Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us.
    Android Training in Chennai | Android Training in Porur

    ReplyDelete
  94. Your blog information are really creative and useful for the readers.I ever read such kind of nice article yet.hope you will add more innovative ideas on your post.
    Best AWS Training in Bangalore
    AWS Certification Training in Bangalore
    AWS Training in Nolambur
    AWS Training in Saidapet

    ReplyDelete
  95. I have read your blog. It’s very informative and useful blog. You have done really great job. Keep update your blog.
    Java Training in Chennai | Java Training in St.Thomas Mount

    ReplyDelete
  96. Your blog is really amazing with smart and cute content.keep updating such an excellent article..
    IOS Training Institute in Chennai | IOS Training Institute in Velachery

    ReplyDelete
  97. Really i enjoyed very much. And this may helpful for lot of peoples. So you are provided such a nice and great article within this.
    Java Training in Chennai | Java Training in Meenambakkam

    ReplyDelete
  98. Thanks its Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us.
    Best Software Testing Training Institute in Chennai | Best Software Testing Training Institute in T.Nagar

    ReplyDelete
  99. Very interesting content which helps me to get the in depth knowledge about the technology.
    ISTQB Certification Course in Chennai | ISTQB Certification Course in Sozhinganallur

    ReplyDelete