mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Attach LeakHunter output to the exception message
for better diagnostic output in test results.
This commit is contained in:
committed by
Alexey Kudravtsev
parent
55c60b7d62
commit
06976e0219
@@ -60,12 +60,13 @@ public class LeakHunter {
|
||||
@Nullable final Condition<? super T> isReallyLeak) throws AssertionError {
|
||||
processLeaks(roots, suspectClass, isReallyLeak, (leaked, backLink)->{
|
||||
String place = leaked instanceof Project ? PlatformTestCase.getCreationPlace((Project)leaked) : "";
|
||||
System.out.println("Found leaked "+leaked.getClass() + ": "+leaked +
|
||||
"; hash: " + System.identityHashCode(leaked) + "; place: " + place);
|
||||
System.out.println(backLink);
|
||||
String message ="Found leaked "+leaked.getClass() + ": "+leaked +
|
||||
"; hash: " + System.identityHashCode(leaked) + "; place: " + place + "\n" +
|
||||
backLink;
|
||||
System.out.println(message);
|
||||
System.out.println(";-----");
|
||||
|
||||
throw new AssertionError();
|
||||
throw new AssertionError(message);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user