diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-28 16:12:40 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-03-28 17:42:10 +0200 |
commit | 46fee0b7694db400a73f2a4e53846a9047c9cd2a (patch) | |
tree | 8d04cfb1b402839ed798661b23e307e0924c7989 /container-search | |
parent | 3b67ce3460a1758232a0ede6ac28377dc16ab732 (diff) |
Test both with and without QueryProfile
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java | 4 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java index 1a4ef7b7d62..4d3826bbae7 100644 --- a/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileTestCase.java @@ -663,13 +663,13 @@ public class QueryProfileTestCase { "ne=true", Method.GET); for (int i = 0; i < 30000; i++) { Query q = new Query(httpRequest, cqp); - assertTrue(q.properties().getBoolean("clustering.timeline", false)); + assertTrue(q.properties().getBoolean(CompoundName.of("clustering.timeline"), false)); } Thread.sleep(2000); long start = System.nanoTime(); for (int i = 0; i < 100000; i++) { Query q = new Query(httpRequest, cqp); - assertTrue(q.properties().getBoolean("clustering.timeline", false)); + assertTrue(q.properties().getBoolean(CompoundName.of("clustering.timeline"), false)); } long now = System.nanoTime(); System.out.println("Duration = " + (now - start)/1_000_000 + " ms"); diff --git a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java index 559b814a265..748a20801d1 100644 --- a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java @@ -327,6 +327,14 @@ public class QueryTestCase { } @Test + void testBooleanParameterNoQueryProfile() { + QueryProfile profile = new QueryProfile("myProfile"); + Query query = new Query("/?query=something&ranking.softtimeout.enable=false"); + assertFalse(query.properties().getBoolean("ranking.softtimeout.enable")); + assertFalse(query.getRanking().getSoftTimeout().getEnable()); + } + + @Test void testQueryProfileSubstitution2() { QueryProfile profile = new QueryProfile("myProfile"); profile.set("model.language", "en-US", null); |