From 5913e32cc43f1b398c3be3c0323045e2e19d0274 Mon Sep 17 00:00:00 2001 From: Luc Boudreau Date: Mon, 20 Aug 2012 17:30:53 +0000 Subject: [PATCH] Fixes a few minor memory leaks in the TCK. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@548 c6a108a4-781c-0410-a6c6-c2d559e19af0 --- testsrc/org/olap4j/OlapTreeTest.java | 4 +++- testsrc/org/olap4j/test/ParserTest.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/testsrc/org/olap4j/OlapTreeTest.java b/testsrc/org/olap4j/OlapTreeTest.java index a76d712..c90effc 100644 --- a/testsrc/org/olap4j/OlapTreeTest.java +++ b/testsrc/org/olap4j/OlapTreeTest.java @@ -34,7 +34,7 @@ */ public class OlapTreeTest extends TestCase { - private final TestContext.Tester tester = + private TestContext.Tester tester = TestContext.instance().getTester(); /** @@ -45,6 +45,7 @@ public class OlapTreeTest extends TestCase { private Connection connection; protected void tearDown() throws Exception { + super.tearDown(); // Simple strategy to prevent connection leaks if (connection != null && !connection.isClosed()) @@ -52,6 +53,7 @@ protected void tearDown() throws Exception { connection.close(); connection = null; } + tester = null; } /** diff --git a/testsrc/org/olap4j/test/ParserTest.java b/testsrc/org/olap4j/test/ParserTest.java index d218103..357fbb1 100644 --- a/testsrc/org/olap4j/test/ParserTest.java +++ b/testsrc/org/olap4j/test/ParserTest.java @@ -50,7 +50,7 @@ public class ParserTest extends TestCase { Pattern.compile( "(?s)From line ([0-9]+), column ([0-9]+) to line ([0-9]+), column ([0-9]+): (.*)"); - final TestContext testContext = TestContext.instance(); + private TestContext testContext = TestContext.instance(); private Connection connection; public ParserTest(String name) { @@ -70,6 +70,7 @@ protected void tearDown() throws Exception { connection.close(); connection = null; } + testContext = null; } private MdxParser createParser() {