[Libreoffice-commits] core.git: javaunohelper/JunitTest_juh.mk javaunohelper/test
Stephan Bergmann
sbergman at redhat.com
Thu Oct 2 00:41:28 PDT 2014
javaunohelper/JunitTest_juh.mk | 1
javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java | 11 +++-------
2 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit b6cff5fae1a91549402bdee55a1077719f7b9c65
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Oct 2 09:40:43 2014 +0200
More robust way to wait for finalization
Change-Id: I99aa3ac27c5157a6858978da20e480bc9847d88f
diff --git a/javaunohelper/JunitTest_juh.mk b/javaunohelper/JunitTest_juh.mk
index fc289ca..214589d 100644
--- a/javaunohelper/JunitTest_juh.mk
+++ b/javaunohelper/JunitTest_juh.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_JunitTest_set_defs,juh,\
))
$(eval $(call gb_JunitTest_use_jars,juh,\
+ OOoRunnerLight \
ridl \
jurt \
))
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 89ab9dd..44cfcb9 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
+}
More information about the Libreoffice-commits
mailing list