JMockit The Mock Anything Toolkit for Java

The JMockit Testing Toolkit Tutorial

  1. Introduction
  2. An example
  3. Running tests with JMockit
  4. Behavior-based testing
    1. Mocked types
    2. Expectations
    3. The record-replay-verify model
    4. Declaring and using mocked types
    5. Strict and non-strict expectations
    6. Recording results for an expectation
    7. Matching invocations to specific instances
    8. Flexible matching of argument values
    9. Specifying invocation count constraints
    10. Explicit verification
    11. Delegates: specifying custom results
    12. Capturing invocation arguments for verification
    13. Accessing private members
    14. Partial mocking
    15. Cascading mocks
    16. Capturing implementation classes and instances
    17. Instantiation and injection of tested classes
    18. Reusing expectation and verification blocks
    19. Other topics
  5. Fakes and state-based testing
    1. Mock methods and mock classes
    2. Setting up mocks for a test
    3. Mocking interfaces
    4. Mocking unspecified implementation classes
    5. Invocation count constraints
    6. Mocking class initializers
    7. Accessing the invocation context
    8. Proceeding into the real implementation
    9. Reusing mocks between tests
    10. Mock-ups at the test class/suite level
  6. Reflection-based utilities
  7. Measuring code coverage
    1. Line coverage
    2. Path coverage
    3. Data coverage
    4. Types of coverage output
    5. Configuring the coverage tool
    6. Aggregated reports for multiple test runs
    7. Checking minimum coverage
    8. Activating coverage in a Maven project
    9. Turning coverage output off
    10. Standalone mode