diff options
Diffstat (limited to 'tools/ahat/test/InstanceTest.java')
-rw-r--r-- | tools/ahat/test/InstanceTest.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/ahat/test/InstanceTest.java b/tools/ahat/test/InstanceTest.java index 7173b1127c..3a50150c0e 100644 --- a/tools/ahat/test/InstanceTest.java +++ b/tools/ahat/test/InstanceTest.java @@ -223,6 +223,16 @@ public class InstanceTest { } @Test + public void unreachableReferent() throws IOException { + // The test dump program should never be under enough GC pressure for the + // soft reference to be cleared. Ensure that ahat will show the soft + // reference as having a non-null referent. + TestDump dump = TestDump.getTestDump(); + AhatInstance ref = dump.getDumpedAhatInstance("aSoftReference"); + assertNotNull(ref.getReferent()); + } + + @Test public void gcRootPath() throws IOException { TestDump dump = TestDump.getTestDump(); @@ -359,14 +369,6 @@ public class InstanceTest { } @Test - public void reverseReferencesAreNotUnreachable() throws IOException { - TestDump dump = TestDump.getTestDump(); - AhatInstance obj = dump.getDumpedAhatInstance("basicString"); - assertEquals(2, obj.getHardReverseReferences().size()); - assertEquals(0, obj.getSoftReverseReferences().size()); - } - - @Test public void asStringEmbedded() throws IOException { // Set up a heap dump with an instance of java.lang.String of // "hello" with instance id 0x42 that is backed by a char array that is |