Interface JMemoryBuddy.MemoryTestAPI

Enclosing class:
JMemoryBuddy

public static interface JMemoryBuddy.MemoryTestAPI
This class provides different methods, which can be used to declare memory-constraints. You can get an instance through the lambda of the method JMemoryBuddy.memoryTest.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    After executing the lambda, the provided ref must be collectable.
    void
    After executing the lambda, the provided ref must be not collectable.
    void
    The provided reference will be reference hard, so it won't be collected, until memoryTest finishes.
  • Method Details

    • assertCollectable

      void assertCollectable(Object ref)
      After executing the lambda, the provided ref must be collectable. Otherwise, an Exception is thrown.
      Parameters:
      ref - The reference which should be collectable.
    • assertNotCollectable

      void assertNotCollectable(Object ref)
      After executing the lambda, the provided ref must be not collectable. Otherwise, an Exception is thrown.
      Parameters:
      ref - The reference which should not be collectable.
    • setAsReferenced

      void setAsReferenced(Object ref)
      The provided reference will be reference hard, so it won't be collected, until memoryTest finishes.
      Parameters:
      ref - The reference which should get a hard reference for this test.