Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Java EE 8 Development with Eclipse

You're reading from   Java EE 8 Development with Eclipse Develop, test, and troubleshoot Java Enterprise applications rapidly with Eclipse

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher
ISBN-13 9781788833776
Length 596 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (20) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
1. Introducing JEE and Eclipse FREE CHAPTER 2. Creating a Simple JEE Web Application 3. Source Control Management in Eclipse 4. Creating JEE Database Applications 5. Unit Testing 6. Debugging the JEE Application 7. Creating JEE Applications with EJB 8. Creating Web Applications with Spring MVC 9. Creating Web Services 10. Asynchronous Programming with JMS 11. Java CPU Profiling and Memory Tracking 12. Microservices 13. Deploying JEE Applications in the Cloud 14. Securing JEE Applications 1. Other Books You May Enjoy Index

Introducing JUnit


JUnit test classes are Java classes separate from the classes you want to test. Each test class can contain many test cases, which are just methods marked to be executed when JUnit tests are executed. A test suite is a collection of test classes.

The convention is to assign the test class the same name as that of the class you want to test, and append Test to that name. For example, if you wanted to test the Course class from the previous chapter, then you would create a JUnit test class and name it CourseTest. Test case (method) names start with test, followed by the name of the method in the class that you want to test; for example, if you wanted to test the validate method in the Course class, then you would create the testValidate method in the CourseTest class. Test classes are also created in the same package as the package in which the classes to be tested are present. In Maven projects, test classes are typically created under the src/test/java folder. The convention...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images