JUnit is one of a family of unit testing frameworks all built with the same philosophy. To abstract the programmer away from the mechanics of running tests. You concentrate on testing the functionality of the application, and the logistics of running, monitoring and displaying results is taken care of by the framework.
In this course, we’ll be writing simple tests using all the different features of JUnit tests. Using 25 solved examples, you'll get a complete overview of the JUnit framework and all the functionality within.
1) Assertions : the fundamental component of any Junit test
2) Matchers : Write complicated tests in a very readable way. Implement your own custom matchers
3) Assumptions : Check for preconditions and external dependencies
4) Fixtures : Setup and Cleanup for your tests
5) Runners : Understand what goes on under the hood in JUnit. Use different runners to run multiple test classes with different conditions and parameters
4) Mockito : Understand the concept of mock objects and use the Mockito framework to run tests on interdependent classes.
Using discussion forums
Please use the discussion forums on this course to engage with other students and to help each other out. Unfortunately, much as we would like to, it is not possible for us at Loonycorn to respond to individual questions from students:-(
We're super small and self-funded with only 2 people developing technical video content. Our mission is to make high-quality courses available at super low prices.
The only way to keep our prices this low is to *NOT offer additional technical support over email or in-person*. The truth is, direct support is hugely expensive and just does not scale.
We understand that this is not ideal and that a lot of students might benefit from this additional support. Hiring resources for additional support would make our offering much more expensive, thus defeating our original purpose.
It is a hard trade-off.
Thank you for your patience and understanding!
Write your very first JUnit test and understand what is happening when a test is run.
What are the different things you need to do in a test? Every test is made up of 3 basic steps - understand this to test any class.
The Assert class provides many methods to check different conditions against different types of objects.
Make complex checks more readable with the help of matchers.
Understand the different methods available in the Matchers class
Error messages for Matchers are very verbose and help with debugging!
Implement a custom matcher, when you have a special requirement not already handled!
Use Assumptions to check that preconditions and external dependencies are set up correctly.
Fixtures are used for setup and cleanup. Ex: Setting up common objects, starting and closing server/database/file connections.
JUnit allows you to specify different Test Runners, each with different ways to control how your tests are run
Run multiple tests at at time.
Run tests with different values for certain parameters.
Run tests with different sets of assumptions.
Loonycorn is us, Janani Ravi and Vitthal Srinivasan. Between us, we have studied at Stanford, been admitted to IIM Ahmedabad and have spent years working in tech, in the Bay Area, New York, Singapore and Bangalore.
Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft
Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too
We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!
We hope you will try our offerings, and think you'll like them :-)