1.1 --- a/samples/gc/test/org/apidesign/gc/WeakListenersTest.java Sat Jun 14 09:54:38 2008 +0200
1.2 +++ b/samples/gc/test/org/apidesign/gc/WeakListenersTest.java Sat Jun 14 18:51:38 2008 +0200
1.3 @@ -5,6 +5,7 @@
1.4 import java.beans.PropertyChangeListener;
1.5 import java.lang.ref.WeakReference;
1.6 import javax.swing.JPanel;
1.7 +import junit.framework.AssertionFailedError;
1.8 import org.junit.After;
1.9 import org.junit.AfterClass;
1.10 import org.junit.Before;
1.11 @@ -43,9 +44,9 @@
1.12 "Of course, this listener cannot disappear, because it is held from long living JavaBean",
1.13 ref
1.14 );
1.15 - } catch (Exception ex) {
1.16 + } catch (AssertionFailedError ex) {
1.17 ex.printStackTrace();
1.18 - // of course it cannot
1.19 + // of course it cannot be garbage collected. That is OK.
1.20 return;
1.21 }
1.22 fail("The listener cannot be GCed as it is held from long living JavaBean");