JMockit An automated testing toolkit for Java

The JMockit Testing Toolkit Tutorial

  1. Introduction
    1. Developer testing and test isolation
    2. Testing with mock objects
    3. Tools for testing with mock objects
    4. Issues with conventional mock objects
    5. An example
    6. Running tests with JMockit
  2. Mocking
    1. Mocked types and instances
    2. Expectations
    3. The record-replay-verify model
    4. Regular, strict, and non-strict expectations
    5. Recording results for an expectation
    6. Matching invocations to specific instances
    7. Flexible matching of argument values
    8. Specifying invocation count constraints
    9. Explicit verification
    10. Capturing invocation arguments for verification
    11. Delegates: specifying custom results
    12. Cascading mocks
    13. Accessing private members
    14. Partial mocking
    15. Capturing implementation classes and instances
    16. Instantiation and injection of tested classes
    17. Reusing expectation and verification blocks
    18. Other topics
  3. Faking
    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
  4. Reflection-based utilities
  5. 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
  6. Testing enterprise applications
    1. Scenario-based testing
    2. An example