use of com.yahoo.search.query.context.QueryContext in project vespa by vespa-engine.
the class TraceTestCase method testBasicTracing.
public void testBasicTracing() {
Query query = new Query();
QueryContext h = query.getContext(true);
h.trace("first message", 0);
h.trace("second message", 0);
assertEquals("trace: [ [ first message second message ] ]", h.toString());
}
use of com.yahoo.search.query.context.QueryContext in project vespa by vespa-engine.
the class PropertiesTestCase method testProperties.
public void testProperties() {
Query query = new Query();
QueryContext h = query.getContext(true);
h.setProperty("a", "a1");
h.trace("first message", 2);
h.setProperty("a", "a2");
h.setProperty("b", "b1");
query.clone();
QueryContext h2 = query.clone().getContext(true);
h2.setProperty("b", "b2");
h2.trace("second message", 2);
h2.setProperty("b", "b3");
h.setProperty("b", "b4");
QueryContext h3 = query.clone().getContext(true);
h3.setProperty("b", "b5");
h3.setProperty("c", "c1");
h3.trace("third message", 2);
h2.setProperty("c", "c2");
h.trace("fourth message", 2);
h.setProperty("d", "d1");
h2.trace("fifth message", 2);
h2.setProperty("c", "c3");
h.setProperty("c", "c4");
assertEquals("a2", h.getProperty("a"));
assertEquals("b5", h.getProperty("b"));
assertEquals("c4", h.getProperty("c"));
assertEquals("d1", h.getProperty("d"));
assertNull(h.getProperty("e"));
}
Aggregations