Skip to content

ayazlakdawala/UnitTestingFrameworksDemo

Repository files navigation

Unit Testing Frameworks Demo

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.

Prerequisites:

Steps to follow:

  1. Clone the project.
  2. Maven build JUnitUpgradeSource project so that it is available in maven's local repository.
  3. 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.
  4. Run the unit tests for each demo project.

Presentation:

Kindly refer to the TechiNar Series-Unit Testing Frameworks Demo.pptx which covers in-depth information for all the aspects covered in these projects.

Unit Testing functionalities covered in the demo projects:

1.JUnit3.xDemo

  1. Test suite creation
  2. Testing exceptions
  3. Testing exception with exception messages
  4. One time setup and tear down
  5. Setup and tear down per test

2.JUnit4.xDemo

  1. Test suite creation
  2. Testing exceptions
  3. Testing exception with exception messages
  4. One time setup and tear down
  5. Setup and tear down per test
  6. Integration with Spring
  7. Integration with Powermockito
    • Mocking DAOs
    • Mocking private method calls
  8. Parameterized testing with 3rd party JUnitParamsRunner
  9. Parameterized testing with in built Parameterized runner class
  10. Ignoring Tests

3.SpockDemo

  1. Test suite creation
  2. Testing exceptions
  3. Testing exception with exception messages
  4. One time setup and tear down
  5. Setup and tear down per test
  6. Integration with Spring
  7. Integration with Powermockito
    • Mocking private methods
  8. Mocking using Spock's in built mocking api
  9. Parameterized Testing
  10. Ignoring tests

About

This repository consists of a 3 demo projects and 1 source project which demonstrate functionality differences between Junit 3, Junit 4 and Spock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors