summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-08-28 20:38:35 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-08-28 20:38:35 +0200
commit2a0a35a68edc3f604aa1747ffbbdefbd821c5470 (patch)
treea9c618276b5febbad477bffe68f942237c24abeb /container-search/src/test/java/com/yahoo/search
parenta88fd8184a3b232d4c0f238e675f10a80724ca93 (diff)
Restore old beahvior on clone.
- If getSessionId(true) has been called prior to clone, allcones will share sessionid with parent. - If not, they will all get their own.
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search')
-rw-r--r--container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java14
1 files changed, 14 insertions, 0 deletions
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 3ffc5dbcf78..0e9451685cb 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
@@ -670,6 +670,20 @@ public class QueryTestCase {
}
@Test
+ public void testThatSessionIdIsNotSharedIfCreatedAfterClone() {
+ Query q = new Query();
+ Query q2 = q.clone();
+ assertNull(q.getSessionId(false));
+ assertNull(q2.getSessionId(false));
+
+ assertNotNull(q.getSessionId(true));
+ assertNull(q2.getSessionId(false));
+
+ assertNotNull(q2.getSessionId(true));
+ assertNotEquals(q.getSessionId(false), q2.getSessionId(false));
+ }
+
+ @Test
public void testPositiveTerms() {
Query q = new Query(httpEncode("/?query=-a \"b c\" d e"));
Item i = q.getModel().getQueryTree().getRoot();