Author: batosai
Date: 2008-09-07 15:58:20 +0000 (Sun, 07 Sep 2008)
New Revision: 22542

Modified:
   trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java
   trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java
   trunk/plugins/WoT/src/plugins/WoT/TrustTest.java
Log:
Try to get db4o really closed before the persistency check.
If you think 2 seconds aren't enough, please tell me.

Modified: trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java 2008-09-07 15:54:42 UTC 
(rev 22541)
+++ trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java 2008-09-07 15:58:20 UTC 
(rev 22542)
@@ -83,7 +83,12 @@

        public void testPersistence() throws MalformedURLException, 
DuplicateIdentityException {
                db.close();
+               
                System.gc();
+               System.runFinalization();
+               try{ Thread.sleep(2000); } 
+               catch (InterruptedException e){}
+               
                db = Db4o.openFile("identityTest.db4o");

                assertEquals(Identity.getNbIdentities(db), 1);

Modified: trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java    2008-09-07 15:54:42 UTC 
(rev 22541)
+++ trunk/plugins/WoT/src/plugins/WoT/ScoreTest.java    2008-09-07 15:58:20 UTC 
(rev 22542)
@@ -62,7 +62,12 @@
        public void testScorePersistence() throws NotInTrustTreeException, 
DuplicateScoreException, MalformedURLException, UnknownIdentityException, 
DuplicateIdentityException {

                db.close();
-               // TODO Force a garbage collection/finalization
+               
+               System.gc();
+               System.runFinalization();
+               try{ Thread.sleep(2000); } 
+               catch (InterruptedException e){}
+               
                db = Db4o.openFile("scoreTest.db4o");

                a = OwnIdentity.getByURI(db, uriA);

Modified: trunk/plugins/WoT/src/plugins/WoT/TrustTest.java
===================================================================
--- trunk/plugins/WoT/src/plugins/WoT/TrustTest.java    2008-09-07 15:54:42 UTC 
(rev 22541)
+++ trunk/plugins/WoT/src/plugins/WoT/TrustTest.java    2008-09-07 15:58:20 UTC 
(rev 22542)
@@ -61,7 +61,12 @@
        public void testTrustPersistence() throws MalformedURLException, 
UnknownIdentityException, DuplicateIdentityException, NotTrustedException, 
DuplicateTrustException  {

                db.close();
-               // TODO Force a garbage collection/finalization
+               
+               System.gc();
+               System.runFinalization();
+               try{ Thread.sleep(2000); } 
+               catch (InterruptedException e){}
+               
                db = Db4o.openFile("trustTest.db4o");

                a = Identity.getByURI(db, uriA);


Reply via email to