- 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 TypeMethodDescriptionvoidassertCollectable(Object ref) After executing the lambda, the provided ref must be collectable.voidAfter executing the lambda, the provided ref must be not collectable.voidsetAsReferenced(Object ref) The provided reference will be reference hard, so it won't be collected, until memoryTest finishes.
-
Method Details
-
assertCollectable
After executing the lambda, the provided ref must be collectable. Otherwise, an Exception is thrown.- Parameters:
ref- The reference which should be collectable.
-
assertNotCollectable
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
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.
-