diff options
author | Eike Stepper | 2012-08-14 05:35:55 +0000 |
---|---|---|
committer | Eike Stepper | 2012-08-14 05:35:55 +0000 |
commit | 6528637024f680f530a08d8d1830c23a99c2c460 (patch) | |
tree | 6a35cc95da4702bc6b72948f9f0d5eaf189c8bdb | |
parent | e9b7efc6ad64d6d92aeac6fa9e91c9c5e7f20a2f (diff) | |
download | cdo-6528637024f680f530a08d8d1830c23a99c2c460.tar.gz cdo-6528637024f680f530a08d8d1830c23a99c2c460.tar.xz cdo-6528637024f680f530a08d8d1830c23a99c2c460.zip |
Release heap space after test cases
25 files changed, 257 insertions, 20 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java index 31bd7d6987..634e0a4947 100644 --- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java +++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/Net4jDBTest.java @@ -45,12 +45,22 @@ public class Net4jDBTest extends AbstractCDOTest { private static final String FIELD_NAME = "testField"; - private DBStore store; - private ArrayList<Pair<DBType, Object>> columns = new ArrayList<Pair<DBType, Object>>(); + private DBStore store; + private Connection connection; + @Override + protected void doTearDown() throws Exception + { + columns.clear(); + columns = null; + store = null; + connection = null; + super.doTearDown(); + } + public void testBigInt() throws Exception { registerColumn(DBType.BIGINT, Long.MAX_VALUE); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java index 64e2fc8743..2be8adc37d 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java @@ -22,6 +22,7 @@ import org.eclipse.emf.cdo.util.CDOURIUtil; import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.net4j.signal.RemoteException; +import org.eclipse.net4j.util.lifecycle.LifecycleUtil; import org.eclipse.emf.common.util.URI; @@ -38,6 +39,14 @@ public class AuditTest extends AbstractCDOTest { protected CDOSession session1; + @Override + protected void doTearDown() throws Exception + { + LifecycleUtil.deactivate(session1); + session1 = null; + super.doTearDown(); + } + protected CDOSession openSession1() { session1 = openSession(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java index d71b4e1c1c..1e3c4b3d91 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java @@ -70,6 +70,7 @@ public class BranchingTest extends AbstractCDOTest @Override protected void doTearDown() throws Exception { + session1 = null; Field disableGC = ReflectUtil.getField(AbstractCDORevisionCache.class, "disableGC"); ReflectUtil.setValue(disableGC, null, false); super.doTearDown(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ComplexTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ComplexTest.java index 1e807fea99..a3ade3e1ae 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ComplexTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ComplexTest.java @@ -90,6 +90,17 @@ public class ComplexTest extends AbstractCDOTest commit(); } + @Override + protected void doTearDown() throws Exception + { + factory = null; + session = null; + transaction = null; + resource1 = null; + resource2 = null; + super.doTearDown(); + } + private void purgeCaches() { // according to Eike's comment at Bug 249681, client caches are diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FeatureMapTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FeatureMapTest.java index 7ce06b455f..5dc3dc13f0 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FeatureMapTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FeatureMapTest.java @@ -128,6 +128,28 @@ public class FeatureMapTest extends AbstractCDOTest tx.commit(); } + @Override + protected void doTearDown() throws Exception + { + pkg = null; + dummy = null; + name = null; + fmapContainer = null; + string1 = null; + integer = null; + fMap = null; + string2 = null; + longObj = null; + bool = null; + ref1 = null; + ref2 = null; + session = null; + tx = null; + resource = null; + dummyObj = null; + super.doTearDown(); + } + public void _testAddDifferentTypes() throws CommitException { EObject fMapObj = EcoreUtil.create(fmapContainer); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IndexReconstructionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IndexReconstructionTest.java index 24e1e152a0..e486dad120 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IndexReconstructionTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/IndexReconstructionTest.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Eike Stepper - initial API and implementation */ @@ -62,6 +62,7 @@ public class IndexReconstructionTest extends AbstractCDOTest transaction = null; session.close(); session = null; + resource = null; super.doTearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java index 646755f612..893428dde2 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java @@ -47,6 +47,9 @@ public class LockingManagerRestartTransactionTest extends AbstractLockingTest protected void doTearDown() throws Exception { LifecycleUtil.deactivate(session); + session = null; + transaction = null; + resource = null; super.doTearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OCLQueryTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OCLQueryTest.java index dfe1d382ae..a4d36f12d2 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OCLQueryTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OCLQueryTest.java @@ -66,6 +66,18 @@ public class OCLQueryTest extends AbstractCDOTest resource = createTestSet(transaction); } + @Override + protected void doTearDown() throws Exception + { + salesOrders = null; + orderDetails = null; + customers = null; + products = null; + resource = null; + transaction = null; + super.doTearDown(); + } + public void testAllProducts() throws Exception { CDOQuery query = transaction.createQuery("ocl", "Product1.allInstances()", getModel1Package().getProduct1()); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java index 63af76927d..f4472db8e3 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PartialCommitTest.java @@ -106,7 +106,29 @@ public class PartialCommitTest extends AbstractCDOTest protected void doTearDown() throws Exception { tx.close(); + tx = null; + session.close(); + session = null; + + resource1 = null; + company1 = null; + company2 = null; + company3 = null; + company99 = null; + purchaseOrder = null; + supplier1 = null; + refSingleContained1 = null; + refSingleContained2 = null; + singleContainedElement1 = null; + refSingleNonContained1 = null; + refSingleNonContained2 = null; + singleNonContainedElement1 = null; + singleNonContainedElement2 = null; + refMultiNonContained1 = null; + refMultiNonContained2 = null; + multiNonContainedElement1 = null; + multiNonContainedElement2 = null; super.doTearDown(); } @@ -1154,7 +1176,7 @@ public class PartialCommitTest extends AbstractCDOTest /** * Test the commit integrity, assuming that it is good. - * + * * @param style * - the checking style to be used; if null, just commit. In that case, the commit logic will choose the * checking style. @@ -1210,7 +1232,7 @@ public class PartialCommitTest extends AbstractCDOTest /** * Test the commit integrity, assuming that it is bad. - * + * * @param style * - the checking style to be used; if null, just commit. In that case, the commit logic will choose the * checking style. diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java index 6255b5d7b2..495bcbb578 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java @@ -512,6 +512,14 @@ public class UnsetTest extends AbstractCDOTest } } + @Override + protected void doTearDown() throws Exception + { + commitAndLoadSession = null; + commitAndLoadTransaction = null; + super.doTearDown(); + } + private <T extends EObject> T commitAndLoad(T object) throws Exception { CDOSession session = openSession(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java index bb4624d79a..dc10c05ca6 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/WorkspaceTest.java @@ -132,6 +132,13 @@ public class WorkspaceTest extends AbstractCDOTest } workspaces.clear(); + workspaces = null; + transaction = null; + products = null; + customers = null; + salesOrders = null; + orderDetails = null; + localStore = null; super.doTearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_2_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_2_Test.java index 1a260c931d..1fc4b4a7d0 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_2_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_2_Test.java @@ -47,6 +47,18 @@ public class Bugzilla_283985_2_Test extends AbstractCDOTest order1.getOrderDetails().add(detail4); } + @Override + protected void doTearDown() throws Exception + { + order1 = null; + order2 = null; + detail1 = null; + detail2 = null; + detail3 = null; + detail4 = null; + super.doTearDown(); + } + public void testMoveOnce() throws CommitException { { diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_3_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_3_Test.java index 8ad3dbbcc9..e0004c23ed 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_3_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_3_Test.java @@ -72,7 +72,18 @@ public class Bugzilla_283985_3_Test extends AbstractCDOTest public void tearDown() throws Exception { transaction.close(); + transaction = null; + session.close(); + session = null; + + order1 = null; + order2 = null; + + detail1 = null; + detail2 = null; + detail3 = null; + detail4 = null; super.tearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_293283_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_293283_Test.java index 84f012fc6b..47f076d148 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_293283_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_293283_Test.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Caspar De Groot - initial API and implementation */ @@ -19,7 +19,7 @@ import org.eclipse.emf.cdo.transaction.CDOTransaction; /** * Bugzilla 293283/314387 - Failed writes on CDOObjects leave bad featureDeltas in transaction - * + * * @author Caspar De Groot */ public class Bugzilla_293283_Test extends AbstractCDOTest @@ -53,8 +53,12 @@ public class Bugzilla_293283_Test extends AbstractCDOTest public void tearDown() throws Exception { tx.close(); + tx = null; + session.close(); + session = null; + order1 = null; super.tearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_299190_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_299190_Test.java index 5e501346e5..75e889a1b7 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_299190_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_299190_Test.java @@ -47,6 +47,16 @@ public class Bugzilla_299190_Test extends AbstractCDOTest commit(); } + @Override + protected void doTearDown() throws Exception + { + session = null; + transaction = null; + resource1 = null; + factory = null; + super.doTearDown(); + } + private void purgeCaches() { // according to Eike's comment at Bug 249681, client caches are diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_308895_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_308895_Test.java index cdc3841b71..05906e097c 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_308895_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_308895_Test.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Stefan Winkler - initial API and implementation */ @@ -56,6 +56,15 @@ public class Bugzilla_308895_Test extends AbstractCDOTest CDOUtil.prepareDynamicEPackage(pkg); } + @Override + protected void doTearDown() throws Exception + { + pkg = null; + cls = null; + att = null; + super.doTearDown(); + } + protected EAttribute getAtt() { return att; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java index ec1f6bc606..eee5b974c4 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_316444_Test.java @@ -50,13 +50,9 @@ public class Bugzilla_316444_Test extends AbstractCDOTest private int idInitSession; - private Object monitor = new Object(); - - private CountDownLatch latch = new CountDownLatch(2); - private boolean finishedSessionA = false; - private List<Exception> exceptions = new ArrayList<Exception>(); + private List<Exception> exceptions; @Override public synchronized Map<String, Object> getTestProperties() @@ -69,6 +65,7 @@ public class Bugzilla_316444_Test extends AbstractCDOTest @Override protected void doSetUp() throws Exception { + exceptions = new ArrayList<Exception>(); createRepository(); super.doSetUp(); } @@ -77,6 +74,10 @@ public class Bugzilla_316444_Test extends AbstractCDOTest { Repository repository = new Repository.Default() { + private Object monitor = new Object(); + + private CountDownLatch latch = new CountDownLatch(2); + @Override public InternalCommitContext createCommitContext(InternalTransaction transaction) { diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_326743_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_326743_Test.java index f8b83de08a..e2d1e3b825 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_326743_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_326743_Test.java @@ -65,6 +65,15 @@ public class Bugzilla_326743_Test extends AbstractCDOTest CDOUtil.prepareDynamicEPackage(pkg); } + @Override + protected void doTearDown() throws Exception + { + pkg = null; + cls = null; + att = null; + super.doTearDown(); + } + public void testDefaultValue() throws CommitException { EObject obj = EcoreUtil.create(cls); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java index d115d3faf3..b89a8975bc 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_327604_Test.java @@ -53,7 +53,7 @@ import java.util.Map; /** * See bug 327604. - * + * * @author Martin Fluegge */ @Requires(IRepositoryConfig.CAPABILITY_AUDITING) @@ -133,6 +133,13 @@ public class Bugzilla_327604_Test extends AbstractCDOTest } workspaces.clear(); + workspaces = null; + transaction = null; + products = null; + customers = null; + salesOrders = null; + orderDetails = null; + localStore = null; super.doTearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329254_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329254_Test.java index 4d931a1dce..e5ddeb5b2d 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329254_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_329254_Test.java @@ -34,7 +34,7 @@ import java.util.concurrent.CountDownLatch; * LastCommitTimeStamp updated even when a serverSide Error occurred. * <p> * See bug 329254. - * + * * @author Pascal Lehmann * @since 4.0 */ @@ -42,11 +42,11 @@ public class Bugzilla_329254_Test extends AbstractCDOTest { private static final String REPOSITORY_NAME = "repo1"; - private boolean modelInitialized; + private final CountDownLatch enterLatch = new CountDownLatch(1); - private CountDownLatch enterLatch = new CountDownLatch(1); + private final CountDownLatch leaveLatch = new CountDownLatch(1); - private CountDownLatch leaveLatch = new CountDownLatch(1); + private boolean modelInitialized; private int sessionId2; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_335772_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_335772_Test.java index 8272ea14b9..b73ae353ef 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_335772_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_335772_Test.java @@ -75,8 +75,13 @@ public class Bugzilla_335772_Test extends AbstractCDOTest @Override protected void doTearDown() throws Exception { - customer = null; factory = null; + customer = null; + product1 = null; + product2 = null; + order1 = null; + order2 = null; + map = null; super.doTearDown(); } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351921_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351921_Test.java index 379935bfd6..0bbc23d730 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351921_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_351921_Test.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Stefan Winkler - initial API and implementation */ @@ -57,6 +57,15 @@ public class Bugzilla_351921_Test extends AbstractCDOTest CDOUtil.prepareDynamicEPackage(pkg); } + @Override + protected void doTearDown() throws Exception + { + pkg = null; + cls = null; + att = null; + super.doTearDown(); + } + protected EAttribute getAtt() { return att; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_385268_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_385268_Test.java index 80b0381aed..52ecbb6bfe 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_385268_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_385268_Test.java @@ -104,6 +104,7 @@ public class Bugzilla_385268_Test extends AbstractCDOTest } transaction.commit(); + remoteUser.dispose(); } /** @@ -122,6 +123,12 @@ public class Bugzilla_385268_Test extends AbstractCDOTest resource = transaction.getResource(getResourcePath("test1")); } + public void dispose() + { + transaction = null; + resource = null; + } + public void changeSupplierAndLockIt() throws InterruptedException { Company company = (Company)resource.getContents().get(0); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTest.java index de3fcc47aa..2a1064ffa2 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/ConfigTest.java @@ -746,6 +746,18 @@ public abstract class ConfigTest extends AbstractOMTest implements IConstants try { getScenario().tearDown(); + + if (testProperties != null) + { + testProperties.clear(); + testProperties = null; + } + + if (homeProperties != null) + { + homeProperties.clear(); + homeProperties = null; + } } catch (Exception ex) { diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java index 6caa2d943a..483ecb774e 100644 --- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java +++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java @@ -11,6 +11,7 @@ package org.eclipse.net4j.util.tests; import org.eclipse.net4j.tests.bundle.OM; +import org.eclipse.net4j.util.ReflectUtil; import org.eclipse.net4j.util.concurrent.ConcurrencyUtil; import org.eclipse.net4j.util.event.EventUtil; import org.eclipse.net4j.util.event.IListener; @@ -29,6 +30,8 @@ import org.eclipse.net4j.util.om.trace.ContextTracer; import org.eclipse.net4j.util.om.trace.PrintTraceHandler; import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -197,6 +200,15 @@ public abstract class AbstractOMTest extends TestCase IOUtil.print(ex); } + try + { + clearReferences(getClass()); + } + catch (Exception ex) + { + IOUtil.print(ex); + } + if (!SUPPRESS_OUTPUT) { IOUtil.OUT().println(); @@ -204,6 +216,29 @@ public abstract class AbstractOMTest extends TestCase } } + protected void clearReferences(Class<?> c) + { + if (c != AbstractOMTest.class) + { + for (Field field : c.getDeclaredFields()) + { + if (Modifier.isStatic(field.getModifiers())) + { + continue; + } + + if (field.getType().isPrimitive()) + { + continue; + } + + ReflectUtil.setValue(field, this, null); + } + + clearReferences(c.getSuperclass()); + } + } + @Override public void runBare() throws Throwable { |