You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/12/27 08:50:12 UTC

[lucene] branch main updated: LUCENE-10338: make TestPosition an internal class inside TrivialLookaheadFilter so that it's not picked up as a test.

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 17b4680  LUCENE-10338: make TestPosition an internal class inside TrivialLookaheadFilter so that it's not picked up as a test.
17b4680 is described below

commit 17b4680641877bc9a94f3059ef1f49bd6904a428
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Mon Dec 27 09:38:02 2021 +0100

    LUCENE-10338: make TestPosition an internal class inside TrivialLookaheadFilter so that it's not picked up as a test.
---
 .../apache/lucene/tests/analysis/TestPosition.java | 33 ----------------------
 .../tests/analysis/TrivialLookaheadFilter.java     | 15 +++++++++-
 2 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java
deleted file mode 100644
index a0bbd12..0000000
--- a/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TestPosition.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-package org.apache.lucene.tests.analysis;
-
-import org.junit.Ignore;
-
-/** Trivial position class. */
-@Ignore
-public class TestPosition extends LookaheadTokenFilter.Position {
-  private String fact;
-
-  public String getFact() {
-    return fact;
-  }
-
-  public void setFact(String fact) {
-    this.fact = fact;
-  }
-}
diff --git a/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java
index 4bb031c..03cef27 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/tests/analysis/TrivialLookaheadFilter.java
@@ -25,7 +25,8 @@ import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 
 /** Simple example of a filter that seems to show some problems with LookaheadTokenFilter. */
-public final class TrivialLookaheadFilter extends LookaheadTokenFilter<TestPosition> {
+public final class TrivialLookaheadFilter
+    extends LookaheadTokenFilter<TrivialLookaheadFilter.TestPosition> {
 
   private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
   private final PositionIncrementAttribute posIncAtt =
@@ -34,6 +35,18 @@ public final class TrivialLookaheadFilter extends LookaheadTokenFilter<TestPosit
 
   private int insertUpto;
 
+  public static class TestPosition extends LookaheadTokenFilter.Position {
+    private String fact;
+
+    public String getFact() {
+      return fact;
+    }
+
+    public void setFact(String fact) {
+      this.fact = fact;
+    }
+  }
+
   protected TrivialLookaheadFilter(TokenStream input) {
     super(input);
   }