use of org.apache.jackrabbit.oak.api.ResultRow in project jackrabbit-oak by apache.
the class FunctionIndexTest method explainXpath.
protected String explainXpath(String query) throws ParseException {
String explain = "explain " + query;
Result result = executeQuery(explain, "xpath", NO_BINDINGS);
ResultRow row = Iterables.getOnlyElement(result.getRows());
String plan = row.getValue("plan").getValue(Type.STRING);
return plan;
}
use of org.apache.jackrabbit.oak.api.ResultRow in project jackrabbit-oak by apache.
the class SuggestionIntervalTest method getSuggestions.
Set<String> getSuggestions(String nodeType, String suggestFor) throws Exception {
Set<String> ret = Sets.newHashSet();
String suggQuery = createSuggestQuery(nodeType, suggestFor);
QueryEngine qe = root.getQueryEngine();
Result result = qe.executeQuery(suggQuery, Query.JCR_SQL2, null, null);
for (ResultRow row : result.getRows()) {
ret.add(row.getValue("suggestion").toString());
}
return ret;
}
use of org.apache.jackrabbit.oak.api.ResultRow in project jackrabbit-oak by apache.
the class LucenePropertyIndexTest method explainXpath.
private String explainXpath(String query) throws ParseException {
String explain = "explain " + query;
Result result = executeQuery(explain, "xpath", NO_BINDINGS);
ResultRow row = Iterables.getOnlyElement(result.getRows());
return row.getValue("plan").getValue(Type.STRING);
}
use of org.apache.jackrabbit.oak.api.ResultRow in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testWeakReferenceColumn.
@Test
public void testWeakReferenceColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.WEAKREFERENCE).when(value).getType();
doReturn("value").when(value).getValue(Type.WEAKREFERENCE);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals("value", remoteValue.asWeakReference());
}
use of org.apache.jackrabbit.oak.api.ResultRow in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testMultiDateColumn.
@Test
public void testMultiDateColumn() {
Date first = new Date(4);
Date second = new Date(2);
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.DATES).when(value).getType();
doReturn(toFormattedDates(first, second)).when(value).getValue(Type.DATES);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(asList(4L, 2L), remoteValue.asMultiDate());
}
Aggregations