|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.jackrabbit.test.JUnitTest
org.apache.jackrabbit.test.AbstractJCRTest
org.apache.jackrabbit.test.api.query.AbstractQueryTest
public abstract class AbstractQueryTest
Abstract base class for query test cases.
Field Summary | |
---|---|
protected String |
jcrContains
Resolved Name for jcr:contains |
protected String |
jcrDeref
Resolved Name for jcr:deref |
protected String |
jcrPath
Resolved Name for jcr:path |
protected String |
jcrRoot
Resolved Name for jcr:root |
protected String |
jcrScore
Resolved Name for jcr:score |
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
---|
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, workspaceName |
Fields inherited from class org.apache.jackrabbit.test.JUnitTest |
---|
log |
Constructor Summary | |
---|---|
AbstractQueryTest()
|
Method Summary | |
---|---|
protected void |
checkResult(QueryResult result,
int hits)
Checks if the result contains a number of
hits . |
protected void |
checkResult(QueryResult result,
int hits,
int properties)
Checks if the result contains a number of hits
and properties . |
protected void |
checkResult(QueryResult result,
Node[] nodes)
Checks if the result set contains exactly the nodes . |
protected Query |
createQuery(org.apache.jackrabbit.test.api.query.Statement statement)
Create a Query for a given Statement . |
protected Query |
createQuery(String statement,
String language)
Creates a Query for the given statement in the requested
language |
protected String |
escapeIdentifierForSQL(String identifier)
Escape an identifier suitable for the SQL parser |
protected void |
evaluateResultOrder(QueryResult queryResult,
String propName,
boolean descending)
Checks if the QueryResult is ordered according order property in
direction of related argument. |
protected QueryResult |
execute(org.apache.jackrabbit.test.api.query.Statement statement)
Creates and executes a Query for the given Statement |
protected QueryResult |
execute(String statement,
String language)
Creates and executes a Query for a given Statement in a given
query language |
protected void |
executeSqlQuery(Session session,
String sql,
Node[] nodes)
Executes the sql query and checks the results against
the specified nodes . |
protected void |
executeXPathQuery(Session session,
String xpath,
Node[] nodes)
Executes the xpath query and checks the results against
the specified nodes . |
protected void |
setUp()
Set-up the configuration values used for the test. |
protected Node[] |
toArray(NodeIterator it)
Returns the nodes in it as an array of Nodes. |
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
---|
cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureMultipleWorkspacesSupported, getNonExistingWorkspaceName, getProperty, getSize, isSupported, needsMixin, run, tearDown |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String jcrScore
protected String jcrPath
protected String jcrRoot
protected String jcrContains
protected String jcrDeref
Constructor Detail |
---|
public AbstractQueryTest()
Method Detail |
---|
protected void setUp() throws Exception
setUp
in class AbstractJCRTest
Exception
protected Query createQuery(org.apache.jackrabbit.test.api.query.Statement statement) throws RepositoryException
Query
for a given Statement
.
statement
- the query should be created for
RepositoryException
createQuery(String, String)
protected Query createQuery(String statement, String language) throws RepositoryException
Query
for the given statement in the requested
language
statement
- the query should be created forlanguage
- query language to be used for Query creation
RepositoryException
protected QueryResult execute(org.apache.jackrabbit.test.api.query.Statement statement) throws RepositoryException
Query
for the given Statement
statement
- to execute
RepositoryException
execute(String, String)
protected QueryResult execute(String statement, String language) throws RepositoryException
Query
for a given Statement in a given
query language
statement
- the query should be build forlanguage
- query language the stement is written in
RepositoryException
protected void checkResult(QueryResult result, int hits) throws RepositoryException
result
contains a number of
hits
.
result
- the QueryResult
.hits
- the number of expected hits.
RepositoryException
- if an error occurs while iterating over the
result nodes.protected void checkResult(QueryResult result, int hits, int properties) throws RepositoryException
result
contains a number of hits
and properties
.
result
- the QueryResult
.hits
- the number of expected hits.properties
- the number of expected properties.
RepositoryException
- if an error occurs while iterating over the
result nodes.protected void evaluateResultOrder(QueryResult queryResult, String propName, boolean descending) throws RepositoryException, NotExecutableException
QueryResult
is ordered according order property in
direction of related argument.
queryResult
- to be testedpropName
- Name of the porperty to order bydescending
- if true
order has to be descending
RepositoryException
NotExecutableException
- in case of less than two results or all
results have same size of value in its
order-propertyprotected void executeXPathQuery(Session session, String xpath, Node[] nodes) throws RepositoryException
xpath
query and checks the results against
the specified nodes
.
session
- the session to use for the query.xpath
- the xpath query.nodes
- the expected result nodes.
RepositoryException
protected void executeSqlQuery(Session session, String sql, Node[] nodes) throws RepositoryException
sql
query and checks the results against
the specified nodes
.
session
- the session to use for the query.sql
- the sql query.nodes
- the expected result nodes.
RepositoryException
protected void checkResult(QueryResult result, Node[] nodes) throws RepositoryException
nodes
.
result
- the query result.nodes
- the expected nodes in the result set.
RepositoryException
protected Node[] toArray(NodeIterator it)
it
as an array of Nodes.
it
- the NodeIterator.
protected String escapeIdentifierForSQL(String identifier)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |