This repository consists of 3 demo projects and 1 source project which demonstrate functional differences and unit testing capabilities of JUnit 3, JUnit 4 and Spock.
- Download and install Maven from [http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html]
- Install Groovy plugin in your preferred IDE.
- Clone the project.
- Maven build JUnitUpgradeSource project so that it is available in maven's local repository.
- JUnitUpgradeSource jar is referred as one of the dependency in all the 3 demo projects. It provides the source code which will be tested by 3 Unit testing frameworks.
- Run the unit tests for each demo project.
Kindly refer to the TechiNar Series-Unit Testing Frameworks Demo.pptx which covers in-depth information for all the aspects covered in these projects.
- Test suite creation
- Testing exceptions
- Testing exception with exception messages
- One time setup and tear down
- Setup and tear down per test
- Test suite creation
- Testing exceptions
- Testing exception with exception messages
- One time setup and tear down
- Setup and tear down per test
- Integration with Spring
- Integration with Powermockito
- Mocking DAOs
- Mocking private method calls
- Parameterized testing with 3rd party JUnitParamsRunner
- Parameterized testing with in built Parameterized runner class
- Ignoring Tests
- Test suite creation
- Testing exceptions
- Testing exception with exception messages
- One time setup and tear down
- Setup and tear down per test
- Integration with Spring
- Integration with Powermockito
- Mocking private methods
- Mocking using Spock's in built mocking api
- Parameterized Testing
- Ignoring tests