geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [3/3] incubator-geode git commit: GEODE-11: Closing cache in @After of LuceneIndexXmlGenerator...Test
Date Tue, 03 May 2016 23:59:04 GMT
GEODE-11: Closing cache in @After of LuceneIndexXmlGenerator...Test

This test case was not cleaning up the cache after the tear down,
resulting in potential problems for later tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8dc2d303
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8dc2d303
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8dc2d303

Branch: refs/heads/develop
Commit: 8dc2d30317d6592af95ba62b95eba784a68a626f
Parents: b3ef791
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Tue May 3 15:54:35 2016 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Tue May 3 16:48:42 2016 -0700

----------------------------------------------------------------------
 .../xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8dc2d303/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java
index 8272522..0c9d500 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java
@@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.PrintWriter;
 import java.nio.charset.Charset;
 
+import org.junit.After;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -40,13 +41,20 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)
 public class LuceneIndexXmlGeneratorIntegrationJUnitTest {
+
+  private Cache cache;
+
+  @After
+  public void closeCache() {
+    cache.close();
+  }
   
   /**
    * Test of generating and reading cache configuration back in.
    */
   @Test
   public void generateWithFields() {
-    Cache cache = new CacheFactory().set("mcast-port", "0").create();
+    cache = new CacheFactory().set("mcast-port", "0").create();
     LuceneService service = LuceneServiceProvider.get(cache);
     service.createIndex("index", "region", "a", "b", "c");
     cache.createRegionFactory(RegionShortcut.PARTITION).create("region");


Mime
View raw message