Class AbstractQueryLevel2Test
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.query.AbstractQueryTest
-
- org.apache.jackrabbit.test.api.query.AbstractQueryLevel2Test
-
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
SQLQueryLevel2Test
,XPathQueryLevel2Test
public abstract class AbstractQueryLevel2Test extends AbstractQueryTest
Implements common setup methods for level 2 queries.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.test.api.query.AbstractQueryTest
jcrContains, jcrDeref, jcrPath, jcrRoot, jcrScore, qf, qm, qsSQL, qsXPATH, vf, xpathRoot
-
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest
isReadOnly, jcrBaseVersion, jcrCopiedFrom, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrIsCheckedOut, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixShareable, mixSimpleVersionable, mixTitle, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntActivity, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testNodeTypeTestRoot, testPath, testRoot, testRootNode, workspaceName
-
-
Constructor Summary
Constructors Constructor Description AbstractQueryLevel2Test()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkValue(NodeIterator itr, String propertyName, String expectedValue)
Checks if all nodes initr
have a property with namepropertyName
and have theexpectedValue
.protected void
checkValue(RowIterator itr, String propertyName, String expectedValue)
Tests if all results contain only the searched value is contained in the selected propertyprotected void
setUpFullTextTest()
Creates two nodes with nameAbstractJCRTest.nodeName1
andAbstractJCRTest.nodeName2
with nodetypeAbstractJCRTest.testNodeType
.protected void
setUpMultiValueTest()
Creates three nodes with names:AbstractJCRTest.nodeName1
,AbstractJCRTest.nodeName2
andAbstractJCRTest.nodeName3
.protected void
setUpRangeTest()
Creates three nodes with names:AbstractJCRTest.nodeName1
,AbstractJCRTest.nodeName2
andAbstractJCRTest.nodeName3
.-
Methods inherited from class org.apache.jackrabbit.test.api.query.AbstractQueryTest
checkResult, checkResult, checkResult, checkResult, createQuery, createQuery, createQuery, escapeIdentifierForSQL, evaluateResultOrder, execute, execute, executeSqlQuery, executeSqlQuery, executeXPathQuery, isSupportedLanguage, setUp, tearDown, toArray
-
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, run
-
Methods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, runBare, runTest, setName, toString
-
-
-
-
Method Detail
-
setUpFullTextTest
protected void setUpFullTextTest() throws RepositoryException
Creates two nodes with nameAbstractJCRTest.nodeName1
andAbstractJCRTest.nodeName2
with nodetypeAbstractJCRTest.testNodeType
. The node type must allow a String property with nameAbstractJCRTest.propertyName1
which is fulltext indexed.- Throws:
RepositoryException
-
setUpRangeTest
protected void setUpRangeTest() throws RepositoryException
Creates three nodes with names:AbstractJCRTest.nodeName1
,AbstractJCRTest.nodeName2
andAbstractJCRTest.nodeName3
. All nodes are of node typeAbstractJCRTest.testNodeType
. the node type must allow a String property with nameAbstractJCRTest.propertyName1
.- Throws:
RepositoryException
-
setUpMultiValueTest
protected void setUpMultiValueTest() throws RepositoryException, NotExecutableException
Creates three nodes with names:AbstractJCRTest.nodeName1
,AbstractJCRTest.nodeName2
andAbstractJCRTest.nodeName3
. All nodes are of node typeAbstractJCRTest.testNodeType
. the node type must allow a String property with nameAbstractJCRTest.propertyName1
and a multi valued String property with nameAbstractJCRTest.propertyName2
.If the node type does not support multi values for
AbstractJCRTest.propertyName2
aNotExecutableException
is thrown.
-
checkValue
protected void checkValue(RowIterator itr, String propertyName, String expectedValue) throws RepositoryException
Tests if all results contain only the searched value is contained in the selected property- Parameters:
itr
- rows of the query result.propertyName
- selected property, that should contain the value.expectedValue
- the value that is expected to be found- Throws:
RepositoryException
-
checkValue
protected void checkValue(NodeIterator itr, String propertyName, String expectedValue) throws RepositoryException
Checks if all nodes initr
have a property with namepropertyName
and have theexpectedValue
.- Parameters:
itr
- the nodes to check.propertyName
- the name of the property.expectedValue
- the exected value of the property.- Throws:
RepositoryException
- if an error occurs.
-
-