diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java')
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java index bee65db4347..489afcb3088 100644 --- a/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java @@ -8,12 +8,12 @@ import com.yahoo.prelude.query.NullItem; import com.yahoo.search.Result; import com.yahoo.search.Searcher; import com.yahoo.search.searchchain.Execution; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Tests semantic searching @@ -27,128 +27,128 @@ public class SemanticSearcherTestCase extends RuleBaseAbstractTestCase { } @Test - public void testSingleShopping() { + void testSingleShopping() { assertSemantics("brand:sony", - "sony"); + "sony"); assertSemantics("brand:sony!150", - "sony!150"); + "sony!150"); } @Test - public void testCombinedShopping() { + void testCombinedShopping() { assertSemantics("AND brand:sony category:camera", - "sony camera"); + "sony camera"); } @Test - public void testPhrasedShopping() { + void testPhrasedShopping() { assertSemantics("AND brand:sony category:\"digital camera\"", - "sony digital camera"); + "sony digital camera"); } @Test - public void testSimpleLocal() { + void testSimpleLocal() { assertSemantics("AND listing:restaurant place:geary", - "restaurant in geary"); + "restaurant in geary"); } @Test - public void testLocal() { + void testLocal() { assertSemantics("AND listing:restaurant place:\"geary street san francisco\"", - "restaurant in geary street san francisco"); + "restaurant in geary street san francisco"); } @Test - public void testLiteralReplacing() { + void testLiteralReplacing() { assertSemantics("AND lord of rings", "lotr"); } @Test - public void testAddingAnd() { + void testAddingAnd() { assertSemantics("AND bar foobar:bar", - "bar"); + "bar"); } @Test - public void testAddingRank() { + void testAddingRank() { assertSemantics("RANK word foobar:word", - "word"); + "word"); } @Test - public void testFilterIsIgnored() { + void testFilterIsIgnored() { assertSemantics("RANK word |a |word |b foobar:word", - "word&filter=a word b"); + "word&filter=a word b"); assertSemantics("RANK a |word |b", - "a&filter=word b"); + "a&filter=word b"); } @Test - public void testAddingNegative() { + void testAddingNegative() { assertSemantics("+java -coffee", - "java"); + "java"); } @Test - public void testAddingNegativePluralToSingular() { + void testAddingNegativePluralToSingular() { assertSemantics("+javas -coffee", - "javas"); + "javas"); } @Test - public void testCombined() { + void testCombined() { assertSemantics("AND bar listing:restaurant place:\"geary street san francisco\" foobar:bar", - "bar restaurant in geary street san francisco"); + "bar restaurant in geary street san francisco"); } @Test - public void testStopWord() { - assertSemantics("strokes","the strokes"); + void testStopWord() { + assertSemantics("strokes", "the strokes"); } @Test - public void testStopWords1() { - assertSemantics("strokes","be the strokes"); + void testStopWords1() { + assertSemantics("strokes", "be the strokes"); } @Test - public void testStopWords2() { - assertSemantics("strokes","the strokes be"); + void testStopWords2() { + assertSemantics("strokes", "the strokes be"); } @Test - public void testDontRemoveEverything() { - assertSemantics("the","the the the"); + void testDontRemoveEverything() { + assertSemantics("the", "the the the"); } @Test - public void testMoreStopWordRemoval() { - assertSemantics("hamlet","hamlet to be or not to be"); + void testMoreStopWordRemoval() { + assertSemantics("hamlet", "hamlet to be or not to be"); } @Test - public void testTypeChange() { - assertSemantics("RANK default:typechange doors","typechange doors"); + void testTypeChange() { + assertSemantics("RANK default:typechange doors", "typechange doors"); } @Test - public void testTypeChangeWithSingularToPluralButNonReplaceWillNotSingularify() { - assertSemantics("RANK default:typechange door","typechange door"); + void testTypeChangeWithSingularToPluralButNonReplaceWillNotSingularify() { + assertSemantics("RANK default:typechange door", "typechange door"); } @Test - public void testExplicitContext() { - assertSemantics("AND from:paris to:texas","paris to texas"); + void testExplicitContext() { + assertSemantics("AND from:paris to:texas", "paris to texas"); } @Test - public void testOrProduction() { + void testOrProduction() { assertSemantics("OR something somethingelse", "something"); } // This test is order dependent. Fix it!! @Test - public void testWeightedSetItem() { + void testWeightedSetItem() { Query q = new Query(); WeightedSetItem weightedSet = new WeightedSetItem("fieldName"); weightedSet.addToken("a", 1); @@ -158,7 +158,7 @@ public class SemanticSearcherTestCase extends RuleBaseAbstractTestCase { } @Test - public void testNullQuery() { + void testNullQuery() { Query query = new Query(""); // Causes a query containing a NullItem doSearch(searcher, query, 0, 10); assertEquals(NullItem.class, query.getModel().getQueryTree().getRoot().getClass()); // Still a NullItem |