Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API to clean up all inline mocks after test #1619

Merged
merged 10 commits into from Mar 5, 2019

Commits on Mar 1, 2019

  1. Fixes mockito#1614: Add API to clean up mocks.

    Due to the introduction of map from weak reference from mock instance to
    its invocation handler, Mockito became vunerable to memory leaks as
    there are multiple situations where Mockito could unintentionally hold
    strong references to mock instances in the map record. The strong
    references could be through spiedInstance for spies, and arguments used
    to faciliate method stubbing.
    
    Mockito could never know if the arguments passed in for method stubbing
    are also strongly referenced somewhere else or not, so Mockito needs to
    save a strong reference to these arguments to avoid premature GC.
    Therefore to solve cyclic strong references through arguments Mockito
    needs to explicitly know when mocks are out of their life, and clean
    up all internal strong references associated with them.
    
    This commit also fixes mockito#1532 and fixes mockito#1533.
    ttanxu committed Mar 1, 2019
    Copy the full SHA
    91c8e9c View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2019

  1. Copy the full SHA
    808bae8 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    e44d76e View commit details
    Browse the repository at this point in the history
  3. Tweaked tests

    mockitoguy committed Mar 2, 2019
    Copy the full SHA
    a6027ac View commit details
    Browse the repository at this point in the history
  4. Tweaked javadoc

    mockitoguy committed Mar 2, 2019
    Copy the full SHA
    c3c0d0a View commit details
    Browse the repository at this point in the history
  5. Javadoc and since tags

    mockitoguy committed Mar 2, 2019
    Copy the full SHA
    ebb9b85 View commit details
    Browse the repository at this point in the history
  6. Next minor version

    mockitoguy committed Mar 2, 2019
    Copy the full SHA
    cc38b6c View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2019

  1. Added missing coverage

    mockitoguy committed Mar 5, 2019
    Copy the full SHA
    d61a8be View commit details
    Browse the repository at this point in the history
  2. Javadoc

    mockitoguy committed Mar 5, 2019
    Copy the full SHA
    1641868 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    959cba4 View commit details
    Browse the repository at this point in the history