LUCENE-3020: don't reflect mockanalyzer, it has no no-arg ctor anymore

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1091159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-04-11 18:15:50 +00:00
parent e483e260d2
commit 52b54262dc
3 changed files with 11 additions and 9 deletions

View File

@ -407,7 +407,7 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
// Index the line docs // Index the line docs
String algLines2[] = { String algLines2[] = {
"# ----- properties ", "# ----- properties ",
"analyzer=org.apache.lucene.analysis.MockAnalyzer", "analyzer=org.apache.lucene.analysis.core.WhitespaceAnalyzer",
"content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource", "content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource",
"docs.file=" + lineFile.getAbsolutePath().replace('\\', '/'), "docs.file=" + lineFile.getAbsolutePath().replace('\\', '/'),
"content.source.forever=false", "content.source.forever=false",
@ -448,7 +448,7 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
// then build index from the same docs // then build index from the same docs
String algLines1[] = { String algLines1[] = {
"# ----- properties ", "# ----- properties ",
"analyzer=org.apache.lucene.analysis.MockAnalyzer", "analyzer=org.apache.lucene.analysis.core.WhitespaceAnalyzer",
"content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource", "content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource",
"docs.file=" + getReuters20LinesFile(), "docs.file=" + getReuters20LinesFile(),
"# ----- alg ", "# ----- alg ",
@ -1021,18 +1021,18 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
"two three four", "three four", "two three four", "three four",
"three four five", "four five", "three four five", "four five",
"four five six", "five six" }); "four five six", "five six" });
// MockAnalyzer, default maxShingleSize and outputUnigrams // WhitespaceAnalyzer, default maxShingleSize and outputUnigrams
benchmark = execBenchmark benchmark = execBenchmark
(getShingleConfig("analyzer:MockAnalyzer")); (getShingleConfig("analyzer:WhitespaceAnalyzer"));
assertEqualShingle(benchmark.getRunData().getAnalyzer(), text, assertEqualShingle(benchmark.getRunData().getAnalyzer(), text,
new String[] { "one,two,three,", "one,two,three, four", new String[] { "one,two,three,", "one,two,three, four",
"four", "four five", "five", "five six", "four", "four five", "five", "five six",
"six" }); "six" });
// MockAnalyzer, maxShingleSize=3 and outputUnigrams=false // WhitespaceAnalyzer, maxShingleSize=3 and outputUnigrams=false
benchmark = execBenchmark benchmark = execBenchmark
(getShingleConfig (getShingleConfig
("outputUnigrams:false,maxShingleSize:3,analyzer:MockAnalyzer")); ("outputUnigrams:false,maxShingleSize:3,analyzer:WhitespaceAnalyzer"));
assertEqualShingle(benchmark.getRunData().getAnalyzer(), text, assertEqualShingle(benchmark.getRunData().getAnalyzer(), text,
new String[] { "one,two,three, four", new String[] { "one,two,three, four",
"one,two,three, four five", "one,two,three, four five",

View File

@ -21,6 +21,7 @@ import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.benchmark.BenchmarkTestCase; import org.apache.lucene.benchmark.BenchmarkTestCase;
import org.apache.lucene.benchmark.byTask.PerfRunData; import org.apache.lucene.benchmark.byTask.PerfRunData;
import org.apache.lucene.benchmark.byTask.tasks.AddDocTask; import org.apache.lucene.benchmark.byTask.tasks.AddDocTask;
@ -70,7 +71,7 @@ public class DocMakerTest extends BenchmarkTestCase {
Properties props = new Properties(); Properties props = new Properties();
// Indexing configuration. // Indexing configuration.
props.setProperty("analyzer", MockAnalyzer.class.getName()); props.setProperty("analyzer", WhitespaceAnalyzer.class.getName());
props.setProperty("content.source", OneDocSource.class.getName()); props.setProperty("content.source", OneDocSource.class.getName());
props.setProperty("directory", "RAMDirectory"); props.setProperty("directory", "RAMDirectory");
if (setIndexProps) { if (setIndexProps) {
@ -99,7 +100,7 @@ public class DocMakerTest extends BenchmarkTestCase {
Properties props = new Properties(); Properties props = new Properties();
// Indexing configuration. // Indexing configuration.
props.setProperty("analyzer", MockAnalyzer.class.getName()); props.setProperty("analyzer", WhitespaceAnalyzer.class.getName());
props.setProperty("content.source", OneDocSource.class.getName()); props.setProperty("content.source", OneDocSource.class.getName());
props.setProperty("directory", "RAMDirectory"); props.setProperty("directory", "RAMDirectory");
if (setNormsProp) { if (setNormsProp) {

View File

@ -27,6 +27,7 @@ import java.util.Properties;
import org.apache.commons.compress.compressors.CompressorStreamFactory; import org.apache.commons.compress.compressors.CompressorStreamFactory;
import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.benchmark.BenchmarkTestCase; import org.apache.lucene.benchmark.BenchmarkTestCase;
import org.apache.lucene.benchmark.byTask.PerfRunData; import org.apache.lucene.benchmark.byTask.PerfRunData;
import org.apache.lucene.benchmark.byTask.feeds.LineDocSource.HeaderLineParser; import org.apache.lucene.benchmark.byTask.feeds.LineDocSource.HeaderLineParser;
@ -121,7 +122,7 @@ public class LineDocSourceTest extends BenchmarkTestCase {
} }
// Indexing configuration. // Indexing configuration.
props.setProperty("analyzer", MockAnalyzer.class.getName()); props.setProperty("analyzer", WhitespaceAnalyzer.class.getName());
props.setProperty("content.source", LineDocSource.class.getName()); props.setProperty("content.source", LineDocSource.class.getName());
props.setProperty("directory", "RAMDirectory"); props.setProperty("directory", "RAMDirectory");
props.setProperty("doc.stored", "true"); props.setProperty("doc.stored", "true");