Index: lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java =================================================================== --- lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java (revision 1437918) +++ lucene/facet/src/java/org/apache/lucene/facet/index/params/CategoryListParams.java (working copy) @@ -143,4 +143,9 @@ return DEFAULT_ORDINAL_POLICY; } + @Override + public String toString() { + return "field=" + field + " encoder=" + createEncoder() + " ordinalPolicy=" + getOrdinalPolicy(); + } + } \ No newline at end of file Index: lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java =================================================================== --- lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java (revision 1437918) +++ lucene/facet/src/java/org/apache/lucene/util/encoding/FourFlagsIntDecoder.java (working copy) @@ -86,7 +86,7 @@ @Override public String toString() { - return "FourFlags(VInt8)"; + return "FourFlags(VInt)"; } } Index: lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/FacetTestBase.java (working copy) @@ -42,7 +42,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.Bits; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util._TestUtil; import org.junit.AfterClass; @@ -66,7 +65,7 @@ */ @SuppressCodecs({"SimpleText"}) -public abstract class FacetTestBase extends LuceneTestCase { +public abstract class FacetTestBase extends FacetTestCase { /** Holds a search and taxonomy Directories pair. */ private static final class SearchTaxoDirPair { @@ -92,7 +91,7 @@ @BeforeClass public static void beforeClassFacetTestBase() { TEST_DIR = _TestUtil.getTempDir("facets"); - dirsPerPartitionSize = new HashMap(); + dirsPerPartitionSize = new HashMap(); } @AfterClass @@ -181,8 +180,10 @@ return newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer); } - /** Returns a default facet indexing params */ + /** Returns a {@link FacetIndexingParams} per the given partition size. */ protected FacetIndexingParams getFacetIndexingParams(final int partSize) { + // several of our encoders don't support the value 0, + // which is one of the values encoded when dealing w/ partitions. return new FacetIndexingParams() { @Override public int getPartitionSize() { Index: lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java (revision 0) +++ lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java (working copy) @@ -0,0 +1,64 @@ +package org.apache.lucene.facet; + +import java.util.Random; + +import org.apache.lucene.facet.index.params.CategoryListParams; +import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.util.encoding.DGapIntEncoder; +import org.apache.lucene.util.encoding.DGapVInt8IntEncoder; +import org.apache.lucene.util.encoding.EightFlagsIntEncoder; +import org.apache.lucene.util.encoding.FourFlagsIntEncoder; +import org.apache.lucene.util.encoding.IntEncoder; +import org.apache.lucene.util.encoding.NOnesIntEncoder; +import org.apache.lucene.util.encoding.SortingIntEncoder; +import org.apache.lucene.util.encoding.UniqueValuesIntEncoder; +import org.apache.lucene.util.encoding.VInt8IntEncoder; + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class FacetTestCase extends LuceneTestCase { + + private static final IntEncoder[] ENCODERS = new IntEncoder[] { + new SortingIntEncoder(new UniqueValuesIntEncoder(new VInt8IntEncoder())), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEncoder()))), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapVInt8IntEncoder())), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new EightFlagsIntEncoder()))), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new FourFlagsIntEncoder()))), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new NOnesIntEncoder(3)))), + new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new NOnesIntEncoder(4)))), + }; + + /** Returns a {@link CategoryListParams} with random {@link IntEncoder} and field. */ + public static CategoryListParams randomCategoryListParams() { + final String field = CategoryListParams.DEFAULT_FIELD + "$" + random().nextInt(); + return randomCategoryListParams(field); + } + + /** Returns a {@link CategoryListParams} with random {@link IntEncoder}. */ + public static CategoryListParams randomCategoryListParams(String field) { + Random random = random(); + final IntEncoder encoder = ENCODERS[random.nextInt(ENCODERS.length)]; + return new CategoryListParams(field) { + @Override + public IntEncoder createEncoder() { + return encoder; + } + }; + } + +} Property changes on: lucene/facet/src/test/org/apache/lucene/facet/FacetTestCase.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java (working copy) @@ -1,30 +1,17 @@ package org.apache.lucene.facet; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import org.apache.lucene.analysis.MockAnalyzer; -import org.apache.lucene.facet.index.params.FacetIndexingParams; -import org.apache.lucene.facet.search.FacetsCollector; -import org.apache.lucene.facet.search.params.CountFacetRequest; -import org.apache.lucene.facet.search.params.FacetRequest; -import org.apache.lucene.facet.search.params.FacetSearchParams; import org.apache.lucene.facet.search.results.FacetResult; import org.apache.lucene.facet.search.results.FacetResultNode; -import org.apache.lucene.facet.taxonomy.CategoryPath; -import org.apache.lucene.facet.taxonomy.TaxonomyReader; import org.apache.lucene.facet.taxonomy.TaxonomyWriter; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.search.Collector; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.MatchAllDocsQuery; -import org.apache.lucene.search.MultiCollector; -import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; import org.apache.lucene.util.LuceneTestCase; @@ -109,30 +96,6 @@ return pairs; } - public static Collector[] search(IndexSearcher searcher, TaxonomyReader taxonomyReader, FacetIndexingParams iParams, - int k, String... facetNames) throws IOException { - - Collector[] collectors = new Collector[2]; - - List fRequests = new ArrayList(); - for (String facetName : facetNames) { - CategoryPath cp = new CategoryPath(facetName); - FacetRequest fq = new CountFacetRequest(cp, k); - fRequests.add(fq); - } - FacetSearchParams facetSearchParams = new FacetSearchParams(fRequests, iParams); - - TopScoreDocCollector topDocsCollector = TopScoreDocCollector.create(searcher.getIndexReader().maxDoc(), true); - FacetsCollector facetsCollector = FacetsCollector.create(facetSearchParams, searcher.getIndexReader(), taxonomyReader); - Collector mColl = MultiCollector.wrap(topDocsCollector, facetsCollector); - - collectors[0] = topDocsCollector; - collectors[1] = facetsCollector; - - searcher.search(new MatchAllDocsQuery(), mColl); - return collectors; - } - public static String toSimpleString(FacetResult fr) { StringBuilder sb = new StringBuilder(); toSimpleString(0, sb, fr.getFacetResultNode(), ""); Index: lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/index/OrdinalMappingReaderTest.java (working copy) @@ -7,16 +7,9 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.MatchAllDocsQuery; -import org.apache.lucene.store.Directory; -import org.junit.Test; - -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.example.merge.TaxonomyMergeUtils; +import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.facet.search.FacetsCollector; import org.apache.lucene.facet.search.params.CountFacetRequest; import org.apache.lucene.facet.search.params.FacetSearchParams; @@ -25,6 +18,13 @@ import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.store.Directory; +import org.junit.Test; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -43,34 +43,35 @@ * limitations under the License. */ -public class OrdinalMappingReaderTest extends LuceneTestCase { +public class OrdinalMappingReaderTest extends FacetTestCase { private static final int NUM_DOCS = 100; @Test public void testTaxonomyMergeUtils() throws Exception { Directory dir = newDirectory(); - Directory taxDir = newDirectory(); - buildIndexWithFacets(dir, taxDir, true); + Directory taxDir = newDirectory(); + FacetIndexingParams fip = new FacetIndexingParams(randomCategoryListParams()); + buildIndexWithFacets(dir, taxDir, true, fip); Directory dir1 = newDirectory(); Directory taxDir1 = newDirectory(); - buildIndexWithFacets(dir1, taxDir1, false); + buildIndexWithFacets(dir1, taxDir1, false, fip); TaxonomyMergeUtils.merge(dir, taxDir, dir1, taxDir1); - verifyResults(dir1, taxDir1); + verifyResults(dir1, taxDir1, fip); dir1.close(); taxDir1.close(); dir.close(); taxDir.close(); } - private void verifyResults(Directory dir, Directory taxDir) throws IOException { + private void verifyResults(Directory dir, Directory taxDir, FacetIndexingParams fip) throws IOException { DirectoryReader reader1 = DirectoryReader.open(dir); DirectoryTaxonomyReader taxReader = new DirectoryTaxonomyReader(taxDir); IndexSearcher searcher = newSearcher(reader1); - FacetSearchParams fsp = new FacetSearchParams(new CountFacetRequest(new CategoryPath("tag"), NUM_DOCS)); + FacetSearchParams fsp = new FacetSearchParams(fip, new CountFacetRequest(new CategoryPath("tag"), NUM_DOCS)); FacetsCollector collector = FacetsCollector.create(fsp, reader1, taxReader); searcher.search(new MatchAllDocsQuery(), collector); FacetResult result = collector.getFacetResults().get(0); @@ -88,7 +89,7 @@ taxReader.close(); } - private void buildIndexWithFacets(Directory dir, Directory taxDir, boolean asc) throws IOException { + private void buildIndexWithFacets(Directory dir, Directory taxDir, boolean asc, FacetIndexingParams fip) throws IOException { IndexWriterConfig config = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)); RandomIndexWriter writer = new RandomIndexWriter(random(), dir, config); @@ -101,7 +102,7 @@ int facetValue = asc? j: NUM_DOCS - j; categoryPaths.add(new CategoryPath("tag", Integer.toString(facetValue))); } - FacetFields facetFields = new FacetFields(taxonomyWriter); + FacetFields facetFields = new FacetFields(taxonomyWriter, fip); facetFields.addFields(doc, categoryPaths); writer.addDocument(doc); } Index: lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/index/TestFacetsPayloadMigrationReader.java (working copy) @@ -21,6 +21,7 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.params.CategoryListParams; import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.facet.index.params.PerDimensionIndexingParams; @@ -61,7 +62,6 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -82,7 +82,7 @@ */ /** Tests facets index migration from payload to DocValues.*/ -public class TestFacetsPayloadMigrationReader extends LuceneTestCase { +public class TestFacetsPayloadMigrationReader extends FacetTestCase { private static class PayloadFacetFields extends FacetFields { Index: lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/index/params/CategoryListParamsTest.java (working copy) @@ -1,6 +1,6 @@ package org.apache.lucene.facet.index.params; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.util.encoding.DGapVInt8IntEncoder; import org.apache.lucene.util.encoding.IntDecoder; import org.apache.lucene.util.encoding.IntEncoder; @@ -25,7 +25,7 @@ * limitations under the License. */ -public class CategoryListParamsTest extends LuceneTestCase { +public class CategoryListParamsTest extends FacetTestCase { @Test public void testDefaultSettings() { Index: lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/index/params/FacetIndexingParamsTest.java (working copy) @@ -1,10 +1,10 @@ package org.apache.lucene.facet.index.params; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.search.DrillDown; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.util.PartitionsUtils; import org.apache.lucene.index.Term; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -24,7 +24,7 @@ * limitations under the License. */ -public class FacetIndexingParamsTest extends LuceneTestCase { +public class FacetIndexingParamsTest extends FacetTestCase { @Test public void testDefaultSettings() { Index: lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/index/params/PerDimensionIndexingParamsTest.java (working copy) @@ -2,11 +2,11 @@ import java.util.Collections; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.search.DrillDown; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.util.PartitionsUtils; import org.apache.lucene.index.Term; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -26,7 +26,7 @@ * limitations under the License. */ -public class PerDimensionIndexingParamsTest extends LuceneTestCase { +public class PerDimensionIndexingParamsTest extends FacetTestCase { @Test public void testTopLevelSettings() { @@ -41,7 +41,6 @@ assertEquals("3 characters should be written", 3, numchars); assertEquals("wrong drill-down term text", expectedDDText, new String(buf, 0, numchars)); - CategoryListParams clParams = ifip.getCategoryListParams(null); assertEquals("partition for all ordinals is the first", "", PartitionsUtils.partitionNameByOrdinal(ifip, 250)); assertEquals("for partition 0, the same name should be returned", "", PartitionsUtils.partitionName(0)); assertEquals("for any other, it's the concatenation of name + partition", PartitionsUtils.PART_NAME_PREFIX + "1", PartitionsUtils.partitionName(1)); Index: lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/CategoryListIteratorTest.java (working copy) @@ -7,13 +7,13 @@ import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; import org.apache.lucene.document.StraightBytesDocValuesField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.index.AtomicReaderContext; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.encoding.DGapIntEncoder; import org.apache.lucene.util.encoding.IntEncoder; import org.apache.lucene.util.encoding.SortingIntEncoder; @@ -38,7 +38,7 @@ * limitations under the License. */ -public class CategoryListIteratorTest extends LuceneTestCase { +public class CategoryListIteratorTest extends FacetTestCase { static final IntsRef[] data = new IntsRef[] { new IntsRef(new int[] { 1, 2 }, 0, 2), @@ -48,9 +48,9 @@ }; @Test - public void testPayloadCategoryListIteraor() throws Exception { + public void test() throws Exception { Directory dir = newDirectory(); - final IntEncoder encoder = new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEncoder()))); + final IntEncoder encoder = randomCategoryListParams().createEncoder(); RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy())); BytesRef buf = new BytesRef(); @@ -89,7 +89,7 @@ } @Test - public void testPayloadIteratorWithInvalidDoc() throws Exception { + public void testEmptyDocuments() throws Exception { Directory dir = newDirectory(); final IntEncoder encoder = new SortingIntEncoder(new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEncoder()))); // NOTE: test is wired to LogMP... because test relies on certain docids having payloads Index: lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsCollectorTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsCollectorTest.java (revision 1437921) +++ lucene/facet/src/test/org/apache/lucene/facet/search/CountingFacetsCollectorTest.java (working copy) @@ -13,6 +13,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.CategoryListParams; import org.apache.lucene.facet.index.params.FacetIndexingParams; @@ -40,7 +41,6 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.collections.ObjectToIntMap; import org.apache.lucene.util.encoding.IntEncoder; import org.apache.lucene.util.encoding.VInt8IntEncoder; @@ -65,7 +65,7 @@ * limitations under the License. */ -public class CountingFacetsCollectorTest extends LuceneTestCase { +public class CountingFacetsCollectorTest extends FacetTestCase { private static final Term A = new Term("f", "a"); private static final CategoryPath CP_A = new CategoryPath("A"), CP_B = new CategoryPath("B"); Index: lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/DrillDownTest.java (working copy) @@ -10,6 +10,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.CategoryListParams; import org.apache.lucene.facet.index.params.FacetIndexingParams; @@ -27,7 +28,6 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -49,9 +49,9 @@ * limitations under the License. */ -public class DrillDownTest extends LuceneTestCase { +public class DrillDownTest extends FacetTestCase { - private FacetIndexingParams defaultParams = FacetIndexingParams.ALL_PARENTS; + private FacetIndexingParams defaultParams; private PerDimensionIndexingParams nonDefaultParams; private static IndexReader reader; private static DirectoryTaxonomyReader taxo; @@ -60,9 +60,10 @@ public DrillDownTest() { Map paramsMap = new HashMap(); - paramsMap.put(new CategoryPath("a"), new CategoryListParams("testing_facets_a")); - paramsMap.put(new CategoryPath("b"), new CategoryListParams("testing_facets_b")); + paramsMap.put(new CategoryPath("a"), randomCategoryListParams("testing_facets_a")); + paramsMap.put(new CategoryPath("b"), randomCategoryListParams("testing_facets_b")); nonDefaultParams = new PerDimensionIndexingParams(paramsMap); + defaultParams = new FacetIndexingParams(randomCategoryListParams(CategoryListParams.DEFAULT_FIELD)); } @BeforeClass Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestDemoFacets.java (working copy) @@ -24,6 +24,7 @@ import java.util.List; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.FacetTestUtils; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.search.params.CountFacetRequest; @@ -40,13 +41,12 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -public class TestDemoFacets extends LuceneTestCase { +public class TestDemoFacets extends FacetTestCase { private DirectoryTaxonomyWriter taxoWriter; private RandomIndexWriter writer; - private FacetFields docBuilder; + private FacetFields facetFields; private void add(String ... categoryPaths) throws IOException { Document doc = new Document(); @@ -55,7 +55,7 @@ for(String categoryPath : categoryPaths) { paths.add(new CategoryPath(categoryPath, '/')); } - docBuilder.addFields(doc, paths); + facetFields.addFields(doc, paths); writer.addDocument(doc); } @@ -70,7 +70,7 @@ // Reused across documents, to add the necessary facet // fields: - docBuilder = new FacetFields(taxoWriter); + facetFields = new FacetFields(taxoWriter); add("Author/Bob", "Publish Date/2010/10/15"); add("Author/Lisa", "Publish Date/2010/10/20"); Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetArrays.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetArrays.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetArrays.java (working copy) @@ -1,6 +1,6 @@ package org.apache.lucene.facet.search; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; /* @@ -20,7 +20,7 @@ * limitations under the License. */ -public class TestFacetArrays extends LuceneTestCase { +public class TestFacetArrays extends FacetTestCase { @Test public void testFacetArrays() { Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsAccumulatorWithComplement.java (working copy) @@ -123,16 +123,11 @@ } - private FacetSearchParams getFacetSearchParams() { - return new FacetSearchParams(new CountFacetRequest(new CategoryPath("root","a"), 10)); - } - /** compute facets with certain facet requests and docs */ private List findFacets(ScoredDocIDs sDocids, boolean withComplement) throws IOException { + FacetSearchParams fsp = new FacetSearchParams(getFacetIndexingParams(Integer.MAX_VALUE), new CountFacetRequest(new CategoryPath("root","a"), 10)); + FacetsAccumulator fAccumulator = new StandardFacetsAccumulator(fsp, indexReader, taxoReader); - FacetsAccumulator fAccumulator = - new StandardFacetsAccumulator(getFacetSearchParams(), indexReader, taxoReader); - fAccumulator.setComplementThreshold( withComplement ? FacetsAccumulator.FORCE_COMPLEMENT: Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java (working copy) @@ -7,6 +7,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.search.params.FacetSearchParams; import org.apache.lucene.facet.search.params.ScoreFacetRequest; @@ -24,7 +25,6 @@ import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -44,7 +44,7 @@ * limitations under the License. */ -public class TestFacetsCollector extends LuceneTestCase { +public class TestFacetsCollector extends FacetTestCase { @Test public void testFacetsWithDocScore() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestMultipleCategoryLists.java (working copy) @@ -13,6 +13,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.FacetTestUtils; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.CategoryListParams; @@ -41,7 +42,6 @@ import org.apache.lucene.search.TopScoreDocCollector; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -61,7 +61,7 @@ * limitations under the License. */ -public class TestMultipleCategoryLists extends LuceneTestCase { +public class TestMultipleCategoryLists extends FacetTestCase { private static final CategoryPath[] CATEGORIES = new CategoryPath[] { new CategoryPath("Author", "Mark Twain"), Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestScoredDocIdCollector.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestScoredDocIdCollector.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestScoredDocIdCollector.java (working copy) @@ -4,24 +4,18 @@ import java.util.Arrays; import java.util.List; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.Query; -import org.apache.lucene.search.TermQuery; -import org.junit.Before; -import org.junit.Test; - import org.apache.lucene.facet.FacetTestBase; -import org.apache.lucene.facet.search.FacetsAccumulator; -import org.apache.lucene.facet.search.ScoredDocIDs; -import org.apache.lucene.facet.search.ScoredDocIDsIterator; -import org.apache.lucene.facet.search.ScoredDocIdCollector; -import org.apache.lucene.facet.search.StandardFacetsAccumulator; import org.apache.lucene.facet.search.params.CountFacetRequest; import org.apache.lucene.facet.search.params.FacetSearchParams; import org.apache.lucene.facet.search.params.ScoreFacetRequest; import org.apache.lucene.facet.search.results.FacetResult; import org.apache.lucene.facet.search.results.FacetResultNode; import org.apache.lucene.facet.taxonomy.CategoryPath; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.junit.Before; +import org.junit.Test; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -65,8 +59,7 @@ System.out.println("Query: " + q); } float constScore = 17.0f; - ScoredDocIdCollector dCollector = ScoredDocIdCollector.create(indexReader - .maxDoc(), false); // scoring is disabled + ScoredDocIdCollector dCollector = ScoredDocIdCollector.create(indexReader.maxDoc(), false); // scoring is disabled dCollector.setDefaultScore(constScore); searcher.search(q, dCollector); @@ -75,13 +68,16 @@ assertEquals("Wrong number of matching documents!", 2, scoredDocIDs.size()); ScoredDocIDsIterator docItr = scoredDocIDs.iterator(); while (docItr.next()) { - assertEquals("Wrong score for doc " + docItr.getDocID(), constScore, - docItr.getScore(), Double.MIN_VALUE); + assertEquals("Wrong score for doc " + docItr.getDocID(), constScore, docItr.getScore(), Double.MIN_VALUE); } // verify by facet values - List countRes = findFacets(scoredDocIDs, getFacetSearchParams()); - List scoreRes = findFacets(scoredDocIDs, sumScoreSearchParams()); + CategoryPath cp = new CategoryPath("root","a"); + FacetSearchParams countFSP = new FacetSearchParams(getFacetIndexingParams(Integer.MAX_VALUE), new CountFacetRequest(cp, 10)); + FacetSearchParams scoreFSP = new FacetSearchParams(getFacetIndexingParams(Integer.MAX_VALUE), new ScoreFacetRequest(cp, 10)); + + List countRes = findFacets(scoredDocIDs, countFSP); + List scoreRes = findFacets(scoredDocIDs, scoreFSP); assertEquals("Wrong number of facet count results!", 1, countRes.size()); assertEquals("Wrong number of facet score results!", 1, scoreRes.size()); @@ -151,14 +147,4 @@ } } - /* use a scoring aggregator */ - private FacetSearchParams sumScoreSearchParams() { - // this will use default faceted indexing params, not altering anything about indexing - return new FacetSearchParams(new ScoreFacetRequest(new CategoryPath("root", "a"), 10)); - } - - private FacetSearchParams getFacetSearchParams() { - return new FacetSearchParams(new CountFacetRequest(new CategoryPath("root","a"), 10)); - } - -} \ No newline at end of file +} Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestStandardFacetsAccumulator.java (working copy) @@ -8,6 +8,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.CategoryListParams; import org.apache.lucene.facet.index.params.FacetIndexingParams; @@ -32,7 +33,6 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -52,7 +52,7 @@ * limitations under the License. */ -public class TestStandardFacetsAccumulator extends LuceneTestCase { +public class TestStandardFacetsAccumulator extends FacetTestCase { private void indexTwoDocs(IndexWriter indexWriter, FacetFields facetFields, boolean withContent) throws Exception { for (int i = 0; i < 2; i++) { Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestTopKInEachNodeResultHandler.java (working copy) @@ -9,6 +9,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.TextField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.facet.search.params.CountFacetRequest; @@ -30,7 +31,6 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -50,7 +50,7 @@ * limitations under the License. */ -public class TestTopKInEachNodeResultHandler extends LuceneTestCase { +public class TestTopKInEachNodeResultHandler extends FacetTestCase { //TODO (Facet): Move to extend BaseTestTopK and separate to several smaller test cases (methods) - see TestTopKResultsHandler Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCounts.java (working copy) @@ -4,13 +4,13 @@ import java.io.IOException; import java.util.Arrays; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.FacetTestUtils; import org.apache.lucene.facet.FacetTestUtils.IndexTaxonomyReaderPair; import org.apache.lucene.facet.FacetTestUtils.IndexTaxonomyWriterPair; import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util._TestUtil; import org.junit.Test; @@ -31,7 +31,7 @@ * limitations under the License. */ -public class TestTotalFacetCounts extends LuceneTestCase { +public class TestTotalFacetCounts extends FacetTestCase { private static void initCache(int numEntries) { TotalFacetCountsCache.getSingleton().clear(); @@ -53,8 +53,7 @@ // Create temporary RAMDirectories Directory[][] dirs = FacetTestUtils.createIndexTaxonomyDirs(1); // Create our index/taxonomy writers - IndexTaxonomyWriterPair[] writers = FacetTestUtils - .createIndexTaxonomyWriterPair(dirs); + IndexTaxonomyWriterPair[] writers = FacetTestUtils.createIndexTaxonomyWriterPair(dirs); FacetIndexingParams iParams = new FacetIndexingParams() { @Override public int getPartitionSize() { Index: lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/TestTotalFacetCountsCache.java (working copy) @@ -8,6 +8,7 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.FacetTestUtils; import org.apache.lucene.facet.FacetTestUtils.IndexTaxonomyReaderPair; import org.apache.lucene.facet.FacetTestUtils.IndexTaxonomyWriterPair; @@ -32,7 +33,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.SlowRAMDirectory; import org.apache.lucene.util._TestUtil; import org.junit.Before; @@ -55,7 +55,7 @@ * limitations under the License. */ -public class TestTotalFacetCountsCache extends LuceneTestCase { +public class TestTotalFacetCountsCache extends FacetTestCase { static final TotalFacetCountsCache TFC = TotalFacetCountsCache.getSingleton(); Index: lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/associations/AssociationsFacetRequestTest.java (working copy) @@ -5,6 +5,7 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.associations.AssociationsFacetFields; import org.apache.lucene.facet.associations.CategoryAssociationsContainer; import org.apache.lucene.facet.associations.CategoryFloatAssociation; @@ -47,7 +48,7 @@ */ /** Test for associations */ -public class AssociationsFacetRequestTest extends LuceneTestCase { +public class AssociationsFacetRequestTest extends FacetTestCase { private static Directory dir; private static IndexReader reader; Index: lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetRequestTest.java (working copy) @@ -1,16 +1,15 @@ package org.apache.lucene.facet.search.params; +import org.apache.lucene.facet.FacetTestCase; +import org.apache.lucene.facet.search.FacetResultsHandler; +import org.apache.lucene.facet.taxonomy.CategoryPath; +import org.apache.lucene.facet.taxonomy.TaxonomyReader; +import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.store.Directory; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.facet.search.FacetResultsHandler; -import org.apache.lucene.facet.taxonomy.CategoryPath; -import org.apache.lucene.facet.taxonomy.TaxonomyReader; -import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -28,7 +27,7 @@ * limitations under the License. */ -public class FacetRequestTest extends LuceneTestCase { +public class FacetRequestTest extends FacetTestCase { @Test(expected=IllegalArgumentException.class) public void testIllegalNumResults() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/params/FacetSearchParamsTest.java (working copy) @@ -1,6 +1,6 @@ package org.apache.lucene.facet.search.params; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; /* @@ -20,7 +20,7 @@ * limitations under the License. */ -public class FacetSearchParamsTest extends LuceneTestCase { +public class FacetSearchParamsTest extends FacetTestCase { @Test public void testSearchParamsWithNullRequest() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/params/MultiCategoryListIteratorTest.java (working copy) @@ -5,6 +5,7 @@ import java.util.Random; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.index.params.CategoryListParams; import org.apache.lucene.facet.index.params.PerDimensionIndexingParams; @@ -22,7 +23,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.encoding.IntDecoder; import org.junit.Test; @@ -43,7 +43,7 @@ * limitations under the License. */ -public class MultiCategoryListIteratorTest extends LuceneTestCase { +public class MultiCategoryListIteratorTest extends FacetTestCase { @Test public void testMultipleCategoryLists() throws Exception { @@ -58,7 +58,7 @@ HashMap clps = new HashMap(); for (String dim : dimensions) { CategoryPath cp = new CategoryPath(dim); - CategoryListParams clp = new CategoryListParams("$" + dim); + CategoryListParams clp = randomCategoryListParams("$" + dim); clps.put(cp, clp); } PerDimensionIndexingParams indexingParams = new PerDimensionIndexingParams(clps); Index: lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/search/sampling/OversampleWithDepthTest.java (working copy) @@ -5,7 +5,9 @@ import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; +import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.facet.search.FacetsAccumulator; import org.apache.lucene.facet.search.FacetsCollector; import org.apache.lucene.facet.search.StandardFacetsCollector; @@ -20,7 +22,6 @@ import org.apache.lucene.facet.taxonomy.TaxonomyWriter; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; -import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; @@ -28,9 +29,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -50,16 +49,18 @@ * limitations under the License. */ -public class OversampleWithDepthTest extends LuceneTestCase { +public class OversampleWithDepthTest extends FacetTestCase { @Test public void testCountWithdepthUsingSampling() throws Exception, IOException { Directory indexDir = newDirectory(); Directory taxoDir = newDirectory(); + FacetIndexingParams fip = new FacetIndexingParams(randomCategoryListParams()); + // index 100 docs, each with one category: ["root", docnum/10, docnum] // e.g. root/8/87 - index100Docs(indexDir, taxoDir); + index100Docs(indexDir, taxoDir, fip); DirectoryReader r = DirectoryReader.open(indexDir); TaxonomyReader tr = new DirectoryTaxonomyReader(taxoDir); @@ -69,7 +70,7 @@ facetRequest.setDepth(2); facetRequest.setResultMode(ResultMode.PER_NODE_IN_TREE); - FacetSearchParams fsp = new FacetSearchParams(facetRequest); + FacetSearchParams fsp = new FacetSearchParams(fip, facetRequest); // Craft sampling params to enforce sampling final SamplingParams params = new SamplingParams(); @@ -93,13 +94,12 @@ IOUtils.close(r, tr, indexDir, taxoDir); } - private void index100Docs(Directory indexDir, Directory taxoDir) - throws CorruptIndexException, LockObtainFailedException, IOException { + private void index100Docs(Directory indexDir, Directory taxoDir, FacetIndexingParams fip) throws IOException { IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new KeywordAnalyzer()); IndexWriter w = new IndexWriter(indexDir, iwc); TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir); - FacetFields facetFields = new FacetFields(tw); + FacetFields facetFields = new FacetFields(tw, fip); for (int i = 0; i < 100; i++) { Document doc = new Document(); CategoryPath cp = new CategoryPath("root",Integer.toString(i / 10), Integer.toString(i)); Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestCategoryPath.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestCategoryPath.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestCategoryPath.java (working copy) @@ -1,6 +1,6 @@ package org.apache.lucene.facet.taxonomy; -import org.apache.lucene.util.LuceneTestCase; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; /* @@ -20,7 +20,7 @@ * limitations under the License. */ -public class TestCategoryPath extends LuceneTestCase { +public class TestCategoryPath extends FacetTestCase { @Test public void testBasic() { Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyCombined.java (working copy) @@ -7,13 +7,13 @@ import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays; import org.apache.lucene.store.Directory; import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.store.RAMDirectory; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.SlowRAMDirectory; import org.junit.Test; @@ -37,7 +37,7 @@ // TODO: remove this suppress if we fix the TaxoWriter Codec to a non-default (see todo in DirTW) @SuppressCodecs("SimpleText") -public class TestTaxonomyCombined extends LuceneTestCase { +public class TestTaxonomyCombined extends FacetTestCase { /** The following categories will be added to the taxonomy by fillTaxonomy(), and tested by all tests below: Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java (working copy) @@ -5,13 +5,13 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.DiskOrdinalMap; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.OrdinalMap; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util._TestUtil; /* @@ -31,7 +31,7 @@ * limitations under the License. */ -public class TestAddTaxonomy extends LuceneTestCase { +public class TestAddTaxonomy extends FacetTestCase { private void dotest(int ncats, final int range) throws Exception { final AtomicInteger numCats = new AtomicInteger(ncats); Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestConcurrentFacetedIndexing.java (working copy) @@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.lucene.document.Document; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.writercache.TaxonomyWriterCache; @@ -17,7 +18,6 @@ import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -37,7 +37,7 @@ */ /** Tests concurrent indexing with facets. */ -public class TestConcurrentFacetedIndexing extends LuceneTestCase { +public class TestConcurrentFacetedIndexing extends FacetTestCase { // A No-Op TaxonomyWriterCache which always discards all given categories, and // always returns true in put(), to indicate some cache entries were cleared. Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java (working copy) @@ -4,19 +4,19 @@ import java.util.Random; import org.apache.lucene.analysis.core.KeywordAnalyzer; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.TaxonomyReader; import org.apache.lucene.facet.taxonomy.TaxonomyWriter; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LogByteSizeMergePolicy; -import org.apache.lucene.index.IndexWriterConfig.OpenMode; import org.apache.lucene.index.LogMergePolicy; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -36,7 +36,7 @@ * limitations under the License. */ -public class TestDirectoryTaxonomyReader extends LuceneTestCase { +public class TestDirectoryTaxonomyReader extends FacetTestCase { @Test public void testCloseAfterIncRef() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyWriter.java (working copy) @@ -7,6 +7,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.facet.taxonomy.TaxonomyReader; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter.MemoryOrdinalMap; @@ -21,7 +22,6 @@ import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -41,7 +41,7 @@ * limitations under the License. */ -public class TestDirectoryTaxonomyWriter extends LuceneTestCase { +public class TestDirectoryTaxonomyWriter extends FacetTestCase { // A No-Op TaxonomyWriterCache which always discards all given categories, and // always returns true in put(), to indicate some cache entries were cleared. Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCharBlockArray.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCharBlockArray.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCharBlockArray.java (working copy) @@ -9,12 +9,10 @@ import java.nio.charset.CharsetDecoder; import java.nio.charset.CodingErrorAction; +import org.apache.lucene.facet.FacetTestCase; +import org.apache.lucene.util.IOUtils; import org.junit.Test; -import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.facet.taxonomy.writercache.cl2o.CharBlockArray; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -32,7 +30,7 @@ * limitations under the License. */ -public class TestCharBlockArray extends LuceneTestCase { +public class TestCharBlockArray extends FacetTestCase { @Test public void testArray() throws Exception { CharBlockArray array = new CharBlockArray(); Index: lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCompactLabelToOrdinal.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCompactLabelToOrdinal.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/taxonomy/writercache/cl2o/TestCompactLabelToOrdinal.java (working copy) @@ -8,14 +8,11 @@ import java.util.Map; import java.util.Random; -import org.junit.Test; - +import org.apache.lucene.facet.FacetTestCase; +import org.apache.lucene.facet.taxonomy.CategoryPath; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util._TestUtil; -import org.apache.lucene.facet.taxonomy.CategoryPath; -import org.apache.lucene.facet.taxonomy.writercache.cl2o.CompactLabelToOrdinal; -import org.apache.lucene.facet.taxonomy.writercache.cl2o.LabelToOrdinal; +import org.junit.Test; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -34,7 +31,7 @@ * limitations under the License. */ -public class TestCompactLabelToOrdinal extends LuceneTestCase { +public class TestCompactLabelToOrdinal extends FacetTestCase { @Test public void testL2O() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java (working copy) @@ -9,6 +9,7 @@ import org.apache.lucene.document.Field; import org.apache.lucene.document.FieldType; import org.apache.lucene.document.StringField; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.search.ScoredDocIDs; import org.apache.lucene.facet.search.ScoredDocIDsIterator; import org.apache.lucene.facet.search.ScoredDocIdCollector; @@ -25,7 +26,6 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.Bits; import org.apache.lucene.util.FixedBitSet; -import org.apache.lucene.util.LuceneTestCase; import org.junit.Test; /* @@ -45,7 +45,7 @@ * limitations under the License. */ -public class TestScoredDocIDsUtils extends LuceneTestCase { +public class TestScoredDocIDsUtils extends FacetTestCase { @Test public void testComplementIterator() throws Exception { Index: lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayInputStreamTest.java (working copy) @@ -3,11 +3,9 @@ import java.io.IOException; import java.util.Arrays; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.UnsafeByteArrayInputStream; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -25,7 +23,7 @@ * limitations under the License. */ -public class UnsafeByteArrayInputStreamTest extends LuceneTestCase { +public class UnsafeByteArrayInputStreamTest extends FacetTestCase { @Test public void testSimple() throws IOException { Index: lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/UnsafeByteArrayOutputStreamTest.java (working copy) @@ -2,11 +2,9 @@ import java.io.IOException; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.UnsafeByteArrayOutputStream; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -24,7 +22,7 @@ * limitations under the License. */ -public class UnsafeByteArrayOutputStreamTest extends LuceneTestCase { +public class UnsafeByteArrayOutputStreamTest extends FacetTestCase { @Test public void testSimpleWrite() throws IOException { Index: lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/ArrayHashMapTest.java (working copy) @@ -4,11 +4,9 @@ import java.util.Iterator; import java.util.Random; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.ArrayHashMap; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -26,7 +24,7 @@ * limitations under the License. */ -public class ArrayHashMapTest extends LuceneTestCase { +public class ArrayHashMapTest extends FacetTestCase { public static final int RANDOM_TEST_NUM_ITERATIONS = 100; // set to 100,000 for deeper test Index: lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/FloatToObjectMapTest.java (working copy) @@ -1,13 +1,11 @@ package org.apache.lucene.util.collections; -import org.junit.Test; import java.util.HashSet; import java.util.Iterator; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.FloatIterator; -import org.apache.lucene.util.collections.FloatToObjectMap; +import org.apache.lucene.facet.FacetTestCase; +import org.junit.Test; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -26,7 +24,7 @@ * limitations under the License. */ -public class FloatToObjectMapTest extends LuceneTestCase { +public class FloatToObjectMapTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntArrayTest.java (working copy) @@ -1,10 +1,8 @@ package org.apache.lucene.util.collections; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.IntArray; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -22,7 +20,7 @@ * limitations under the License. */ -public class IntArrayTest extends LuceneTestCase { +public class IntArrayTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntHashSetTest.java (working copy) @@ -2,11 +2,9 @@ import java.util.HashSet; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.IntHashSet; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -24,7 +22,7 @@ * limitations under the License. */ -public class IntHashSetTest extends LuceneTestCase { +public class IntHashSetTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntToDoubleMapTest.java (working copy) @@ -1,15 +1,11 @@ package org.apache.lucene.util.collections; -import org.junit.Test; - -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.DoubleIterator; -import org.apache.lucene.util.collections.IntIterator; -import org.apache.lucene.util.collections.IntToDoubleMap; - import java.util.HashSet; import java.util.Random; +import org.apache.lucene.facet.FacetTestCase; +import org.junit.Test; + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -27,7 +23,8 @@ * limitations under the License. */ -public class IntToDoubleMapTest extends LuceneTestCase { +public class IntToDoubleMapTest extends FacetTestCase { + private static void assertGround(double value) { assertEquals(IntToDoubleMap.GROUND, value, Double.MAX_VALUE); } Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntToFloatMapTest.java (working copy) @@ -1,15 +1,11 @@ package org.apache.lucene.util.collections; -import org.junit.Test; - -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.FloatIterator; -import org.apache.lucene.util.collections.IntIterator; -import org.apache.lucene.util.collections.IntToFloatMap; - import java.util.HashSet; import java.util.Random; +import org.apache.lucene.facet.FacetTestCase; +import org.junit.Test; + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -27,7 +23,8 @@ * limitations under the License. */ -public class IntToFloatMapTest extends LuceneTestCase { +public class IntToFloatMapTest extends FacetTestCase { + private static void assertGround(float value) { assertEquals(IntToFloatMap.GROUND, value, Float.MAX_VALUE); } Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntToIntMapTest.java (working copy) @@ -1,12 +1,10 @@ package org.apache.lucene.util.collections; -import org.junit.Test; import java.util.HashSet; import java.util.Random; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.IntIterator; -import org.apache.lucene.util.collections.IntToIntMap; +import org.apache.lucene.facet.FacetTestCase; +import org.junit.Test; /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -25,7 +23,7 @@ * limitations under the License. */ -public class IntToIntMapTest extends LuceneTestCase { +public class IntToIntMapTest extends FacetTestCase { private static void assertGround(int value) { assertEquals(IntToIntMap.GROUD, value); Index: lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/IntToObjectMapTest.java (working copy) @@ -4,12 +4,9 @@ import java.util.Iterator; import java.util.Random; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.IntIterator; -import org.apache.lucene.util.collections.IntToObjectMap; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -27,7 +24,7 @@ * limitations under the License. */ -public class IntToObjectMapTest extends LuceneTestCase { +public class IntToObjectMapTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToFloatMapTest.java (working copy) @@ -1,15 +1,12 @@ package org.apache.lucene.util.collections; -import org.junit.Test; - -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.FloatIterator; -import org.apache.lucene.util.collections.ObjectToFloatMap; - import java.util.HashSet; import java.util.Iterator; import java.util.Random; +import org.apache.lucene.facet.FacetTestCase; +import org.junit.Test; + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -27,7 +24,7 @@ * limitations under the License. */ -public class ObjectToFloatMapTest extends LuceneTestCase { +public class ObjectToFloatMapTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/ObjectToIntMapTest.java (working copy) @@ -6,6 +6,7 @@ import org.junit.Test; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.collections.IntIterator; import org.apache.lucene.util.collections.ObjectToIntMap; @@ -27,7 +28,7 @@ * limitations under the License. */ -public class ObjectToIntMapTest extends LuceneTestCase { +public class ObjectToIntMapTest extends FacetTestCase { @Test public void test0() { Index: lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/collections/TestLRUHashMap.java (working copy) @@ -1,10 +1,8 @@ package org.apache.lucene.util.collections; +import org.apache.lucene.facet.FacetTestCase; import org.junit.Test; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.collections.LRUHashMap; - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -22,7 +20,7 @@ * limitations under the License. */ -public class TestLRUHashMap extends LuceneTestCase { +public class TestLRUHashMap extends FacetTestCase { // testLRU() tests that the specified size limit is indeed honored, and // the remaining objects in the map are indeed those that have been most // recently used Index: lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java =================================================================== --- lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java (revision 1437918) +++ lucene/facet/src/test/org/apache/lucene/util/encoding/EncodingTest.java (working copy) @@ -3,9 +3,9 @@ import java.io.IOException; import java.util.Arrays; +import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IntsRef; -import org.apache.lucene.util.LuceneTestCase; import org.junit.BeforeClass; import org.junit.Test; @@ -26,7 +26,7 @@ * limitations under the License. */ -public class EncodingTest extends LuceneTestCase { +public class EncodingTest extends FacetTestCase { private static IntsRef uniqueSortedData, data;