Skip to content

Apache Lucene open-source search software

LUCENE-3795: use LuceneTestCase for all tests, propagate super.setUp in SpatialPrefixTreeTest

Robert Muirf7cf65f76c59
diff --git a/modules/spatial/src/test/org/apache/lucene/spatial/TestTestFramework.java b/modules/spatial/src/test/org/apache/lucene/spatial/TestTestFramework.java
index 5e1ffc0a48c..e35d848e9f9 100644
--- a/modules/spatial/src/test/org/apache/lucene/spatial/TestTestFramework.java
+++ b/modules/spatial/src/test/org/apache/lucene/spatial/TestTestFramework.java
@@ -22,6 +22,8 @@ import com.spatial4j.core.context.simple.SimpleSpatialContext;
import com.spatial4j.core.query.SpatialArgsParser;
import com.spatial4j.core.query.SpatialOperation;
import com.spatial4j.core.shape.Rectangle;
+
+import org.apache.lucene.util.LuceneTestCase;
import org.junit.Assert;
import org.junit.Test;
@@ -35,7 +37,7 @@ import java.util.List;
/**
* Make sure we are reading the tests as expected
*/
-public class TestTestFramework {
+public class TestTestFramework extends LuceneTestCase {
@Test
public void testQueries() throws IOException {
diff --git a/modules/spatial/src/test/org/apache/lucene/spatial/prefix/TestSpatialPrefixField.java b/modules/spatial/src/test/org/apache/lucene/spatial/prefix/TestSpatialPrefixField.java
index 1829c922b47..cbeae7b488e 100644
--- a/modules/spatial/src/test/org/apache/lucene/spatial/prefix/TestSpatialPrefixField.java
+++ b/modules/spatial/src/test/org/apache/lucene/spatial/prefix/TestSpatialPrefixField.java
@@ -17,6 +17,7 @@
package org.apache.lucene.spatial.prefix;
+import org.apache.lucene.util.LuceneTestCase;
import org.junit.Test;
import java.util.Arrays;
@@ -26,7 +27,7 @@ import java.util.List;
/**
* This is just a quick idea for *simple* tests
*/
-public class TestSpatialPrefixField {
+public class TestSpatialPrefixField extends LuceneTestCase {
@Test
public void testRawTokens() {
diff --git a/modules/spatial/src/test/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeTest.java b/modules/spatial/src/test/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeTest.java
index 96b46c1d9e0..3a00246fbbe 100644
--- a/modules/spatial/src/test/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeTest.java
+++ b/modules/spatial/src/test/org/apache/lucene/spatial/prefix/tree/SpatialPrefixTreeTest.java
@@ -20,14 +20,12 @@ package org.apache.lucene.spatial.prefix.tree;
import com.spatial4j.core.context.simple.SimpleSpatialContext;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
+
+import org.apache.lucene.util.LuceneTestCase;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-
-public class SpatialPrefixTreeTest {
+public class SpatialPrefixTreeTest extends LuceneTestCase {
//TODO plug in others and test them
private SimpleSpatialContext ctx;
@@ -35,6 +33,7 @@ public class SpatialPrefixTreeTest {
@Before
public void setUp() throws Exception {
+ super.setUp();
ctx = SimpleSpatialContext.GEO_KM;
trie = new GeohashPrefixTree(ctx,4);
}