use of com.yahoo.fs4.QueryPacket in project vespa by vespa-engine.
the class CacheKeyTestCase method testSessionKeyIgnored.
@Test
public void testSessionKeyIgnored() {
Query a = new Query("/?query=abcd");
QueryPacket ap = QueryPacket.create(a);
Query b = new Query("/?query=abcd&ranking.queryCache=true");
QueryPacket bp = QueryPacket.create(b);
CacheKey ak = new CacheKey(ap);
CacheKey bk = new CacheKey(bp);
assertEquals(ak, bk);
assertEquals(ak.hashCode(), bk.hashCode());
assertFalse(ap.getQueryPacketData().equals(bp.getQueryPacketData()));
}
use of com.yahoo.fs4.QueryPacket in project vespa by vespa-engine.
the class CacheKeyTestCase method testHitsOffsetEquality.
@Test
public void testHitsOffsetEquality() {
Query a = new Query("/?query=abcd");
QueryPacket p1 = QueryPacket.create(a);
a.setWindow(100, 1000);
QueryPacket p2 = QueryPacket.create(a);
CacheKey k1 = new CacheKey(p1);
CacheKey k2 = new CacheKey(p2);
assertEquals(k1, k2);
assertEquals(k1.hashCode(), k2.hashCode());
}
Aggregations