geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject incubator-geode git commit: GEODE-11: Changing test to check if the bug is fixed.
Date Mon, 01 Aug 2016 23:00:48 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 2cab2ee70 -> 59e4c447e


GEODE-11: Changing test to check if the bug is fixed.

Signed-off-by: Gester Zhou <gzhou@pivotal.io>

This closes #222


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

Branch: refs/heads/develop
Commit: 59e4c447e6e645d3ea3ce3093e33a6d8774b1cc3
Parents: 2cab2ee
Author: Aparna Dharmakkan <adharmakkan@pivotal.io>
Authored: Mon Aug 1 15:48:16 2016 -0700
Committer: zhouxh <gzhou@pivotal.io>
Committed: Mon Aug 1 16:00:01 2016 -0700

----------------------------------------------------------------------
 .../LuceneIndexCreationIntegrationTest.java     | 28 +++++++++++++-------
 1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/59e4c447/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java
b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java
index dd9fd57..fc1f84f 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexCreationIntegrationTest.java
@@ -166,20 +166,28 @@ public class LuceneIndexCreationIntegrationTest extends LuceneIntegrationTest
{
 
   @Test
   public void cannotCreateLuceneIndexForReplicateRegion() throws IOException, ParseException
{
-    expectedException.expect(UnsupportedOperationException.class);
-    expectedException.expectMessage("Lucene indexes on replicated regions are not supported");
-    createIndex("field1", "field2", "field3");
-    this.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+    try {
+      createIndex("field1", "field2", "field3");
+      this.cache.createRegionFactory(RegionShortcut.REPLICATE).create(REGION_NAME);
+      fail("Should not have been able to create index");
+    } catch (UnsupportedOperationException e) {
+      assertEquals("Lucene indexes on replicated regions are not supported", e.getMessage());
+      assertNull(cache.getRegion(REGION_NAME));
+    }
   }
 
   @Test
   public void cannotCreateLuceneIndexForRegionWithEviction() throws IOException, ParseException
{
-    expectedException.expect(UnsupportedOperationException.class);
-    expectedException.expectMessage("Lucene indexes on regions with eviction and action local
destroy are not supported");
-    createIndex("field1", "field2", "field3");
-    RegionFactory regionFactory = this.cache.createRegionFactory(RegionShortcut.PARTITION);
-    regionFactory.setEvictionAttributes(EvictionAttributes.createLIFOEntryAttributes(100,
EvictionAction.LOCAL_DESTROY));
-    regionFactory.create(REGION_NAME);
+    try {
+      createIndex("field1", "field2", "field3");
+      RegionFactory regionFactory = this.cache.createRegionFactory(RegionShortcut.PARTITION);
+      regionFactory.setEvictionAttributes(
+        EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY));
+      regionFactory.create(REGION_NAME);
+    } catch (UnsupportedOperationException e) {
+      assertEquals("Lucene indexes on regions with eviction and action local destroy are
not supported", e.getMessage());
+      assertNull(cache.getRegion(REGION_NAME));
+    }
   }
 
   @Test


Mime
View raw message