Skip to content

Commit

Permalink
Fix backward compat in TestCustomAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Sep 30, 2024
1 parent cf8c3c4 commit 9e90fb5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
public class TestCustomAnalyzer extends BaseTokenStreamTestCase {

@SuppressWarnings("deprecation")
private static final Version LUCENE_9_0_0 = Version.LUCENE_9_0_0;
private static final Version LUCENE_10_0_0 = Version.LUCENE_10_0_0;

// Test some examples (TODO: we only check behavior, we may need something like
// TestRandomChains...)
Expand Down Expand Up @@ -111,7 +111,7 @@ public void testWhitespaceWithFolding() throws Exception {
public void testVersionAwareFilter() throws Exception {
CustomAnalyzer a =
CustomAnalyzer.builder()
.withDefaultMatchVersion(LUCENE_9_0_0)
.withDefaultMatchVersion(LUCENE_10_0_0)
.withTokenizer(StandardTokenizerFactory.class)
.addTokenFilter(DummyVersionAwareTokenFilterFactory.class)
.build();
Expand All @@ -128,7 +128,7 @@ public void testVersionAwareFilter() throws Exception {
public void testFactoryHtmlStripClassicFolding() throws Exception {
CustomAnalyzer a =
CustomAnalyzer.builder()
.withDefaultMatchVersion(LUCENE_9_0_0)
.withDefaultMatchVersion(LUCENE_10_0_0)
.addCharFilter(HTMLStripCharFilterFactory.class)
.withTokenizer(ClassicTokenizerFactory.class)
.addTokenFilter(ASCIIFoldingFilterFactory.class, "preserveOriginal", "true")
Expand Down Expand Up @@ -164,7 +164,7 @@ public void testFactoryHtmlStripClassicFolding() throws Exception {
public void testHtmlStripClassicFolding() throws Exception {
CustomAnalyzer a =
CustomAnalyzer.builder()
.withDefaultMatchVersion(LUCENE_9_0_0)
.withDefaultMatchVersion(LUCENE_10_0_0)
.addCharFilter("htmlstrip")
.withTokenizer("classic")
.addTokenFilter("asciifolding", "preserveOriginal", "true")
Expand Down Expand Up @@ -513,7 +513,7 @@ public DummyVersionAwareTokenFilterFactory(Map<String, String> args) {

@Override
public TokenStream create(TokenStream input) {
if (luceneMatchVersion.equals(LUCENE_9_0_0)) {
if (luceneMatchVersion.equals(LUCENE_10_0_0)) {
return input;
}
return new LowerCaseFilter(input);
Expand Down

0 comments on commit 9e90fb5

Please sign in to comment.