jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1359550 - /jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
Date Tue, 10 Jul 2012 09:54:51 GMT
Author: jukka
Date: Tue Jul 10 09:54:51 2012
New Revision: 1359550

URL: http://svn.apache.org/viewvc?rev=1359550&view=rev
Log:
OAK-12: Implement a test suite for the MicroKernel

Clear fields in MK integration tests to avoid extra memory use with JUnit

Modified:
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java?rev=1359550&r1=1359549&r2=1359550&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
Tue Jul 10 09:54:51 2012
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.mk.test;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Map;
@@ -29,7 +30,6 @@ import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.ComparisonFailure;
 import org.junit.runners.Parameterized.Parameters;
 
 import static org.junit.Assert.assertEquals;
@@ -128,6 +128,13 @@ public abstract class AbstractMicroKerne
     @After
     public void tearDown() {
         fixture.tearDownCluster(mks);
+
+        // Clear fields to avoid consuming memory after the test has run.
+        // It looks like JUnit keeps references to all test instances until
+        // the entire test suite has been run.
+        Arrays.fill(mks, null);
+        mk = null;
+        parser = null;
     }
 
     //--------------------------------< utility methods for parsing json data >



Mime
View raw message