diff --git a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java index c7c09d6bfdb..4aeb4727eab 100644 --- a/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java +++ b/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/OrderByTest.java @@ -32,7 +32,7 @@ /** * Tests queries with order by. */ -public class OrderByTest extends AbstractIndexingTest { +public class OrderByTest extends AbstractQueryTest { public void testOrderByScore() throws RepositoryException { Node n1 = testRootNode.addNode("node1"); @@ -50,12 +50,12 @@ public void testOrderByScore() throws RepositoryException { String sql = "SELECT value FROM nt:unstructured WHERE " + "jcr:path LIKE '" + testRoot + "/%' ORDER BY jcr:score, value"; - Query q = session.getWorkspace().getQueryManager().createQuery(sql, Query.SQL); + Query q = qm.createQuery(sql, Query.SQL); QueryResult result = q.execute(); checkResult(result, 3); String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by jcr:score(), @value"; - q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH); + q = qm.createQuery(xpath, Query.XPATH); result = q.execute(); checkResult(result, 3); } @@ -104,7 +104,7 @@ public void testOrderByUpperCase() throws RepositoryException { testRootNode.save(); String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by fn:upper-case(@text)"; - Query q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH); + Query q = qm.createQuery(xpath, Query.XPATH); QueryResult result = q.execute(); checkResult(result, new Node[]{n1, n2, n3}); } @@ -121,7 +121,7 @@ public void testOrderByLowerCase() throws RepositoryException { testRootNode.save(); String xpath = "/" + testRoot + "/*[@jcr:primaryType='nt:unstructured'] order by fn:lower-case(@text)"; - Query q = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH); + Query q = qm.createQuery(xpath, Query.XPATH); QueryResult result = q.execute(); checkResult(result, new Node[]{n1, n2, n3}); } @@ -213,31 +213,31 @@ public void testChildAxisMixedTypes() throws RepositoryException { //------------------------------< helper >---------------------------------- private Value getValue(String value) throws RepositoryException { - return session.getValueFactory().createValue(value); + return superuser.getValueFactory().createValue(value); } private Value getValue(long value) throws RepositoryException { - return session.getValueFactory().createValue(value); + return superuser.getValueFactory().createValue(value); } private Value getValue(double value) throws RepositoryException { - return session.getValueFactory().createValue(value); + return superuser.getValueFactory().createValue(value); } private Value getValue(boolean value) throws RepositoryException { - return session.getValueFactory().createValue(value); + return superuser.getValueFactory().createValue(value); } private Value getValue(Calendar value) throws RepositoryException { - return session.getValueFactory().createValue(value); + return superuser.getValueFactory().createValue(value); } private Value getNameValue(String value) throws RepositoryException { - return session.getValueFactory().createValue(value, PropertyType.NAME); + return superuser.getValueFactory().createValue(value, PropertyType.NAME); } private Value getPathValue(String value) throws RepositoryException { - return session.getValueFactory().createValue(value, PropertyType.PATH); + return superuser.getValueFactory().createValue(value, PropertyType.PATH); } /** @@ -251,7 +251,7 @@ private void checkChildAxis(Value[] values) throws RepositoryException { // child/prop is part of the test indexing configuration, // this will use SimpleScoreDocComparator internally checkChildAxis(values, "child", "property"); - cleanUpTestRoot(session); + cleanUpTestRoot(superuser); // c/p is not in the indexing configuration, // this will use RelPathScoreDocComparator internally checkChildAxis(values, "c", "p");