aesthetics cleanup

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2003-10-09 00:13:24 +00:00
parent 0e60607de8
commit ded5fcb7ac
1 changed files with 13 additions and 6 deletions

View File

@ -58,17 +58,24 @@ import java.io.StringReader;
*/
public class TestPerFieldAnalzyerWrapper extends TestCase {
public void testIt() throws Exception {
public void testPerField() throws Exception {
String text = "Qwerty";
PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new WhitespaceAnalyzer());
PerFieldAnalyzerWrapper analyzer =
new PerFieldAnalyzerWrapper(new WhitespaceAnalyzer());
analyzer.addAnalyzer("special", new SimpleAnalyzer());
TokenStream tokenStream = analyzer.tokenStream("field", new StringReader(text));
TokenStream tokenStream = analyzer.tokenStream("field",
new StringReader(text));
Token token = tokenStream.next();
assertEquals("WhitespaceAnalyzer does not lowercase", "Qwerty", token.termText());
assertEquals("WhitespaceAnalyzer does not lowercase",
"Qwerty",
token.termText());
tokenStream = analyzer.tokenStream("special", new StringReader(text));
tokenStream = analyzer.tokenStream("special",
new StringReader(text));
token = tokenStream.next();
assertEquals("SimpleAnalyzer lowercases", "qwerty", token.termText());
assertEquals("SimpleAnalyzer lowercases",
"qwerty",
token.termText());
}
}