|
|||||||||||
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
Abstract base class for query test cases.
Field Summary | |
protected java.lang.String |
jcrContains
Resolved QName for jcr:contains |
protected java.lang.String |
jcrDeref
Resolved QName for jcr:deref |
protected java.lang.String |
jcrPath
Resolved QName for jcr:path |
protected java.lang.String |
jcrRoot
Resolved QName for jcr:root |
protected java.lang.String |
jcrScore
Resolved QName for jcr:score |
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, 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, testPath, testRoot, testRootNode, workspaceName |
Fields inherited from class org.apache.jackrabbit.test.JUnitTest |
log |
Constructor Summary | |
AbstractQueryTest()
|
Method Summary | |
protected void |
checkResult(javax.jcr.query.QueryResult result,
int hits)
Checks if the result contains a number of
hits . |
protected void |
checkResult(javax.jcr.query.QueryResult result,
int hits,
int properties)
Checks if the result contains a number of hits
and properties . |
protected void |
checkResult(javax.jcr.query.QueryResult result,
javax.jcr.Node[] nodes)
Checks if the result set contains exactly the nodes . |
protected javax.jcr.query.Query |
createQuery(org.apache.jackrabbit.test.api.query.Statement statement)
Create a Query for a given Statement . |
protected javax.jcr.query.Query |
createQuery(java.lang.String statement,
java.lang.String language)
Creates a Query for the given statement in the requested
language |
protected void |
evaluateResultOrder(javax.jcr.query.QueryResult queryResult,
java.lang.String propName,
boolean descending)
Checks if the QueryResult is ordered according order property in
direction of related argument. |
protected javax.jcr.query.QueryResult |
execute(org.apache.jackrabbit.test.api.query.Statement statement)
Creates and executes a Query for the given Statement |
protected javax.jcr.query.QueryResult |
execute(java.lang.String statement,
java.lang.String language)
Creates and executes a Query for a given Statement in a given
query language |
protected void |
executeSqlQuery(javax.jcr.Session session,
java.lang.String sql,
javax.jcr.Node[] nodes)
Executes the sql query and checks the results against
the specified nodes . |
protected void |
executeXPathQuery(javax.jcr.Session session,
java.lang.String xpath,
javax.jcr.Node[] nodes)
Executes the xpath query and checks the results against
the specified nodes . |
protected boolean |
hasDescriptor(java.lang.String descriptor)
Test if the requested Descriptor is registred at repository |
protected void |
setUp()
Set-up the configuration values used for the test. |
protected javax.jcr.Node[] |
toArray(javax.jcr.NodeIterator it)
Returns the nodes in it as an array of Nodes. |
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
createRandomString, getNonExistingWorkspaceName, getProperty, getSize, 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 java.lang.String jcrScore
protected java.lang.String jcrPath
protected java.lang.String jcrRoot
protected java.lang.String jcrContains
protected java.lang.String jcrDeref
Constructor Detail |
public AbstractQueryTest()
Method Detail |
protected void setUp() throws java.lang.Exception
setUp
in class AbstractJCRTest
java.lang.Exception
protected javax.jcr.query.Query createQuery(org.apache.jackrabbit.test.api.query.Statement statement) throws javax.jcr.RepositoryException
Query
for a given Statement
.
statement
- the query should be created for
javax.jcr.RepositoryException
createQuery(String, String)
protected javax.jcr.query.Query createQuery(java.lang.String statement, java.lang.String language) throws javax.jcr.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
javax.jcr.RepositoryException
protected javax.jcr.query.QueryResult execute(org.apache.jackrabbit.test.api.query.Statement statement) throws javax.jcr.RepositoryException
Query
for the given Statement
statement
- to execute
javax.jcr.RepositoryException
execute(String, String)
protected javax.jcr.query.QueryResult execute(java.lang.String statement, java.lang.String language) throws javax.jcr.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
javax.jcr.RepositoryException
protected void checkResult(javax.jcr.query.QueryResult result, int hits) throws javax.jcr.RepositoryException
result
contains a number of
hits
.
result
- the QueryResult
.hits
- the number of expected hits.
javax.jcr.RepositoryException
- if an error occurs while iterating over the
result nodes.protected void checkResult(javax.jcr.query.QueryResult result, int hits, int properties) throws javax.jcr.RepositoryException
result
contains a number of hits
and properties
.
result
- the QueryResult
.hits
- the number of expected hits.properties
- the number of expected properties.
javax.jcr.RepositoryException
- if an error occurs while iterating over the
result nodes.protected void evaluateResultOrder(javax.jcr.query.QueryResult queryResult, java.lang.String propName, boolean descending) throws javax.jcr.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
javax.jcr.RepositoryException
NotExecutableException
- in case of less than two results or all
results have same size of value in its
order-propertyprotected void executeXPathQuery(javax.jcr.Session session, java.lang.String xpath, javax.jcr.Node[] nodes) throws javax.jcr.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.
javax.jcr.RepositoryException
protected void executeSqlQuery(javax.jcr.Session session, java.lang.String sql, javax.jcr.Node[] nodes) throws javax.jcr.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.
javax.jcr.RepositoryException
protected void checkResult(javax.jcr.query.QueryResult result, javax.jcr.Node[] nodes) throws javax.jcr.RepositoryException
nodes
.
result
- the query result.nodes
- the expected nodes in the result set.
javax.jcr.RepositoryException
protected boolean hasDescriptor(java.lang.String descriptor)
descriptor
- to be searched.
protected javax.jcr.Node[] toArray(javax.jcr.NodeIterator it)
it
as an array of Nodes.
it
- the NodeIterator.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |