aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java')
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java
index 43911b33161..755a1c11d47 100644
--- a/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/searcher/test/PosSearcherTestCase.java
@@ -10,12 +10,12 @@ import com.yahoo.search.Searcher;
import com.yahoo.search.rendering.RendererRegistry;
import com.yahoo.search.result.ErrorHit;
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 for the PosSearcher
@@ -31,7 +31,7 @@ public class PosSearcherTestCase {
* Tests basic lat/long input.
*/
@Test
- public void testBasics() {
+ void testBasics() {
Query q = new Query();
q.properties().set("pos.ll", "N0;E0");
doSearch(searcher, q, 0, 10);
@@ -47,44 +47,44 @@ public class PosSearcherTestCase {
* Tests basic bounding box input.
*/
@Test
- public void testBoundingBox() {
+ void testBoundingBox() {
Query q = new Query();
q.properties().set("pos.bb", "n=51.9,s=50.2,e=0.34,w=-10.01");
doSearch(searcher, q, 0, 10);
assertEquals("[2,-10010000,50200000,340000,51900000]",
- q.getRanking().getLocation().toString());
+ q.getRanking().getLocation().toString());
q = new Query();
q.properties().set("pos.bb", "n=0,s=0,e=123.456789,w=-123.456789");
doSearch(searcher, q, 0, 10);
assertEquals("[2,-123456789,0,123456789,0]",
- q.getRanking().getLocation().toString());
+ q.getRanking().getLocation().toString());
q = new Query();
q.properties().set("pos.bb", "n=12.345678,s=-12.345678,e=0,w=0");
doSearch(searcher, q, 0, 10);
assertEquals("[2,0,-12345678,0,12345678]",
- q.getRanking().getLocation().toString());
+ q.getRanking().getLocation().toString());
q = new Query();
q.properties().set("pos.bb", "n=0.000001,s=-0.000001,e=0.000001,w=-0.000001");
doSearch(searcher, q, 0, 10);
assertEquals("[2,-1,-1,1,1]",
- q.getRanking().getLocation().toString());
+ q.getRanking().getLocation().toString());
}
/**
* Tests basic bounding box input.
*/
@Test
- public void testBoundingBoxAndRadius() {
+ void testBoundingBoxAndRadius() {
Query q = new Query();
q.properties().set("pos.bb", "n=60.111,s=59.999,e=30.111,w=29.999");
q.properties().set("pos.ll", "N60;E30");
doSearch(searcher, q, 0, 10);
assertEquals(
"[2,29999000,59999000,30111000,60111000]" +
- "(2,30000000,60000000,450668,0,1,0,2147483647)",
+ "(2,30000000,60000000,450668,0,1,0,2147483647)",
q.getRanking().getLocation().toString());
}
@@ -92,7 +92,7 @@ public class PosSearcherTestCase {
* Tests different ways of specifying the radius.
*/
@Test
- public void testRadiusUnits() {
+ void testRadiusUnits() {
Query q = new Query();
q.properties().set("pos.ll", "N0;E0");
q.properties().set("pos.radius", "2km");
@@ -130,7 +130,7 @@ public class PosSearcherTestCase {
* Tests xy position (internal format).
*/
@Test
- public void testXY() {
+ void testXY() {
Query q = new Query();
q.properties().set("pos.xy", "22500;22500");
doSearch(searcher, q, 0, 10);
@@ -144,7 +144,7 @@ public class PosSearcherTestCase {
}
@Test
- public void testNotOverridingOldStyleParameters() {
+ void testNotOverridingOldStyleParameters() {
PosSearcher searcher = new PosSearcher();
Query q = new Query("?query=test&pos.ll=N10.15;E6.08&location=(2,-1100222,0,300,0,1,0,CalcLatLon)");
q.setTraceLevel(1);
@@ -156,7 +156,7 @@ public class PosSearcherTestCase {
* Tests input parameters that should report errors.
*/
@Test
- public void testInvalidInput() {
+ void testInvalidInput() {
PosSearcher searcher = new PosSearcher();
Result result;
@@ -164,18 +164,18 @@ public class PosSearcherTestCase {
q.properties().set("pos.ll", "NE74.14;E14.48");
result = doSearch(searcher, q, 0, 10);
assertEquals("Error in pos parameters: Unable to parse lat/long string 'NE74.14;E14.48': already set direction once, cannot add direction: E",
- ((ErrorHit)result.hits().get(0)).errors().iterator().next().getDetailedMessage());
+ ((ErrorHit) result.hits().get(0)).errors().iterator().next().getDetailedMessage());
q = new Query();
q.properties().set("pos.ll", "NE74.14;E14.48");
q.properties().set("pos.xy", "82400, 72800");
result = doSearch(searcher, q, 0, 10);
assertEquals("Error in pos parameters: Cannot handle both lat/long and xy coords at the same time",
- ((ErrorHit)result.hits().get(0)).errors().iterator().next().getDetailedMessage());
+ ((ErrorHit) result.hits().get(0)).errors().iterator().next().getDetailedMessage());
}
@Test
- public void testWrappingTheNorthPole() {
+ void testWrappingTheNorthPole() {
Query q = new Query();
q.properties().set("pos.ll", "N89.9985365158;E122.163600102");
q.properties().set("pos.radius", "20mi");