diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-02 09:40:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-02 09:41:00 +0200 |
commit | b6cff5fae1a91549402bdee55a1077719f7b9c65 (patch) | |
tree | 6d7370bdef0fbd5680f1d9c6a633b54565d91af8 /javaunohelper/test | |
parent | 5a295a9a9d3c25344d37b162c9c95d10e5c2e0f2 (diff) |
More robust way to wait for finalization
Change-Id: I99aa3ac27c5157a6858978da20e480bc9847d88f
Diffstat (limited to 'javaunohelper/test')
-rw-r--r-- | javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java index 89ab9ddc547e..44cfcb952c34 100644 --- a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java +++ b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java @@ -30,6 +30,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Before; import org.junit.Test; +import util.WaitUnreachable; public class ComponentBase_Test { @@ -97,16 +98,12 @@ public class ComponentBase_Test @Test public void test_finalize() throws Exception { - logger.log(Level.INFO, "Testing ComponentBase: test_finalize()"); ComponentBase comp= new ComponentBase(); obj1.nDisposingCalled = 0; comp.addEventListener(obj1); - + WaitUnreachable u = new WaitUnreachable(comp); comp= null; - System.gc(); - System.runFinalization(); - logger.log(Level.FINE, "Waiting 51ms (-XX:MaxGCPauseMillis=50)"); - Thread.sleep(51); + u.waitUnreachable(); assertEquals(obj1.nDisposingCalled, 1); } -}
\ No newline at end of file +} |