public abstract class AbstractJCRTest extends JUnitTest
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | isReadOnlyFlag that indicates if the current test is a read-only test, that is
 no content is written to the workspace by the test. | 
| protected String | jcrBaseVersionJCR Name jcr:baseVersion using the namespace resolver of the current session. | 
| protected String | jcrCopiedFromJCR Name jcr:copiedFrom using the namespace resolver of the current session. | 
| protected String | jcrCreatedJCR Name jcr:created using the namespace resolver of the current session. | 
| protected String | jcrFrozenNodeJCR Name jcr:frozenNode using the namespace resolver of the current session. | 
| protected String | jcrFrozenUuidJCR Name jcr:frozenUuid using the namespace resolver of the current session. | 
| protected String | jcrIsCheckedOutJCR Name jcr:isCheckedOut using the namespace resolver of the current session. | 
| protected String | jcrlockIsDeepJCR Name jcr:lockIsDeep using the namespace resolver of the current session. | 
| protected String | jcrLockOwnerJCR Name jcr:lockOwner using the namespace resolver of the current session. | 
| protected String | jcrMergeFailedJCR Name jcr:mergeFailed using the namespace resolver of the current session. | 
| protected String | jcrMixinTypesJCR Name jcr:mixinTypes using the namespace resolver of the current session. | 
| protected String | jcrPredecessorsJCR Name jcr:predecessors using the namespace resolver of the current session. | 
| protected String | jcrPrimaryTypeJCR Name jcr:primaryType using the namespace resolver of the current session. | 
| protected String | jcrRootVersionJCR Name jcr:rootVersion using the namespace resolver of the current session. | 
| protected String | jcrSuccessorsJCR Name jcr:successors using the namespace resolver of the current session. | 
| protected String | jcrSystemJCR Name jcr:system using the namespace resolver of the current session. | 
| protected String | jcrUUIDJCR Name jcr:uuid using the namespace resolver of the current session. | 
| protected String | jcrVersionHistoryJCR Name jcr:created using the namespace resolver of the current session. | 
| protected String | mixLockableJCR Name mix:lockable using the namespace resolver of the current session. | 
| protected String | mixReferenceableJCR Name mix:referenceable using the namespace resolver of the current session. | 
| protected String | mixShareableJCR Name mix:shareable using the namespace resolver of the current session. | 
| protected String | mixSimpleVersionableJCR Name mix:simpleVersionable using the namespace resolver of the current session. | 
| protected String | mixTitleJCR Name mix:title using the namespace resolver of the current session. | 
| protected String | mixVersionableJCR Name mix:versionable using the namespace resolver of the current session. | 
| protected String | nodeName1Name of a node that will be created during a test case. | 
| protected String | nodeName2Name of a node that will be created during a test case. | 
| protected String | nodeName3Name of a node that will be created during a test case. | 
| protected String | nodeName4Name of a node that will be created during a test case. | 
| static String | NS_JCR_URINamespace URI for jcr prefix. | 
| static String | NS_MIX_URINamespace URI for mix prefix. | 
| static String | NS_NT_URINamespace URI for nt prefix. | 
| static String | NS_SV_URINamespace URI for sv prefix | 
| protected String | ntActivityJCR Name nt:activity using the namespace resolver of the current session. | 
| protected String | ntBaseJCR Name nt:base using the namespace resolver of the current session. | 
| protected String | ntFrozenNodeJCR Name nt:frozenNode using the namespace resolver of the current session. | 
| protected String | ntQueryJCR Name nt:query using the namespace resolver of the current session. | 
| protected String | ntUnstructuredJCR Name nt:unstructured using the namespace resolver of the current session. | 
| protected String | ntVersionJCR Name nt:version using the namespace resolver of the current session. | 
| protected String | ntVersionHistoryJCR Name nt:versionHistory using the namespace resolver of the current session. | 
| protected String | ntVersionLabelsJCR Name nt:versionHistory using the namespace resolver of the current session. | 
| protected String | propertyName1Name of a property that will be used during a test case. | 
| protected String | propertyName2Name of a property that will be used during a test case. | 
| protected Session | superuserThe superuser session for the default workspace | 
| protected String | testNodeTypeThe node type name for newly created nodes. | 
| protected String | testNodeTypeNoChildrenA node type that does not allow any child nodes, such as nt:base. | 
| protected String | testNodeTypeTestRootThe node type name for the test root node. | 
| protected String | testPathRelative path to the test root node. | 
| protected String | testRootAbsolute path to the test root node. | 
| protected Node | testRootNodeThe root  Nodefor testing | 
| protected ValueFactory | vfThe value factory for  superuser. | 
| protected String | workspaceNameName of a workspace to use instead of the default workspace. | 
| Constructor and Description | 
|---|
| AbstractJCRTest() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | checkSupportedOption(String descriptorKey)Throws a  NotExecutableExceptionif the repository does
 not support the feature identified by the givendiscriptorKey. | 
| protected void | cleanUp() | 
| protected Node | cleanUpTestRoot(Session s)Reverts any pending changes made by  sand deletes any nodes
 undertestRoot. | 
| protected String | createRandomString(int numChars)Creates a  Stringwith a random sequence of characters
 using 'a' - 'z'. | 
| protected void | ensureCanSetProperty(Node node,
                    String propertyName,
                    int propertyType,
                    boolean isMultiple)Checks that the repository can set the property to the required type, otherwise aborts with
  NotExecutableException. | 
| protected void | ensureCanSetProperty(Node node,
                    String propertyName,
                    Value value)Checks that the repository can set the property to the required type, otherwise aborts with
  NotExecutableException. | 
| protected void | ensureCanSetProperty(Node node,
                    String propertyName,
                    Value[] values)Checks that the repository can set the property to the required type, otherwise aborts with
  NotExecutableException. | 
| protected void | ensureKnowsNodeType(Session session,
                   String nodetype)Checks that the repository supports the specified node type, otherwise aborts with
  NotExecutableException | 
| protected void | ensureLockingSupported()Checks that the repository supports locking, otherwise aborts with
  NotExecutableException. | 
| protected void | ensureMixinType(Node node,
               String mixin)Ensures that the given  nodeis of the given mixin type. | 
| protected void | ensureMultipleWorkspacesSupported()Checks that the repository supports multiple workspace, otherwise aborts with
  NotExecutableException. | 
| protected RepositoryHelper | getHelper() | 
| Value | getJcrValue(Session s,
           String valueProp,
           String typeProp,
           String defaultValue)Create a JCR value based on the configuration. | 
| protected static String | getLocalName(String jcrName)Returns the local name for the given  jcrName. | 
| protected String | getNonExistingWorkspaceName(Session session)Returns the name of a workspace that is not accessible from
  session. | 
| protected static String | getPrefix(String jcrName)Returns the prefix for the given  jcrName. | 
| String | getProperty(String propName)Returns the value of the configuration property with  propName. | 
| String | getProperty(String name,
           String defaultValue)Returns the value of the configuration property with specified
  name. | 
| protected static String | getQualifiedName(Session session,
                String jcrName)Returns the expanded name for the given  jcrName. | 
| protected long | getSize(RangeIterator it)Returns the size of the  RangeIteratorit. | 
| protected boolean | isSupported(String descriptorKey)Returns  trueif this repository support a certain optional
 feature; otherwisefalseis returned. | 
| protected boolean | needsMixin(Node node,
          String mixin)Checks whether the node already has the specified mixin node type | 
| void | run(junit.framework.TestResult testResult)Runs the test cases of this test class and reports the results to
  testResult. | 
| protected void | setUp() | 
| protected void | tearDown() | 
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, toStringpublic static final String NS_JCR_URI
public static final String NS_NT_URI
public static final String NS_MIX_URI
public static final String NS_SV_URI
protected String jcrPrimaryType
protected String jcrMixinTypes
protected String jcrPredecessors
protected String jcrSuccessors
protected String jcrCreated
protected String jcrVersionHistory
protected String jcrCopiedFrom
protected String jcrFrozenNode
protected String jcrFrozenUuid
protected String jcrRootVersion
protected String jcrIsCheckedOut
protected String jcrBaseVersion
protected String jcrUUID
protected String jcrLockOwner
protected String jcrlockIsDeep
protected String jcrMergeFailed
protected String jcrSystem
protected String ntBase
protected String ntUnstructured
protected String ntVersion
protected String ntVersionHistory
protected String ntVersionLabels
protected String ntFrozenNode
protected String mixReferenceable
protected String mixVersionable
protected String mixSimpleVersionable
protected String mixLockable
protected String mixTitle
protected String mixShareable
protected String ntQuery
protected String ntActivity
protected String testPath
protected String testRoot
protected String testNodeType
protected String testNodeTypeTestRoot
protected String testNodeTypeNoChildren
protected String nodeName1
protected String nodeName2
protected String nodeName3
protected String nodeName4
protected String propertyName1
protected String propertyName2
protected String workspaceName
protected Session superuser
protected boolean isReadOnly
protected Node testRootNode
Node for testingprotected ValueFactory vf
superuser.protected void tearDown()
                 throws Exception
public void run(junit.framework.TestResult testResult)
testResult. In contrast to the default implementation of
 TestCase.run() this method will suppress tests errors with
 a NotExecutableException. That is, test cases that throw this
 exception will still result as successful.run in interface junit.framework.Testrun in class junit.framework.TestCasetestResult - the test result.protected RepositoryHelper getHelper()
public String getProperty(String propName) throws RepositoryException
propName.
 The sequence how configuration properties are read is the follwoing:
 javax.jcr.tck.<testClassName>.<testCaseName>.<propName>javax.jcr.tck.<testClassName>.<propName>javax.jcr.tck.<packageName>.<propName>javax.jcr.tck.<propName><testClassName> is the name of the test class without package prefix.<testMethodName> is the name of the test method<packageName> is the name of the package of the test class.
 Example: packageName for org.apache.jackrabbit.test.api.BooleanPropertyTest: apipropName - the propName of the configration property.null if the property
  does not exist.RepositoryException - if an error occurs while reading from
  the configuration.public String getProperty(String name, String defaultValue) throws RepositoryException
name. If the property does not exist defaultValue is
 returned.
 
 Configuration properties are defined in the file:
 repositoryStubImpl.properties.
name - the name of the property to retrieve.defaultValue - the default value if the property does not exist.defaultValue if non existent.RepositoryException - if the configuration file cannot be found.public Value getJcrValue(Session s, String valueProp, String typeProp, String defaultValue) throws RepositoryException
s - valueProp - Name of the config property that contains the property value.typeProp - Name of the config property that contains the property type.
 If the config parameter is missing, PropertyType.STRING is used
 to create the JCR value.defaultValue - Default value to be used if the config does not define
 the value property.RepositoryExceptionprotected long getSize(RangeIterator it)
RangeIterator it.
 Note, that the RangeIterator might get consumed, because
 RangeIterator.getSize() might return -1 (information unavailable).it - a RangeIterator.protected static String getLocalName(String jcrName)
jcrName.jcrName - the name.protected static String getPrefix(String jcrName)
jcrName.jcrName - the name.protected static String getQualifiedName(Session session, String jcrName) throws RepositoryException
jcrName.jcrName - the name.RepositoryExceptionNamespaceExceptionprotected String getNonExistingWorkspaceName(Session session) throws RepositoryException
session.session - the session.RepositoryException - if an error occurs.protected String createRandomString(int numChars)
String with a random sequence of characters
 using 'a' - 'z'.numChars - number of characters.protected boolean isSupported(String descriptorKey) throws RepositoryException
true if this repository support a certain optional
 feature; otherwise false is returned. If there is no
 such descriptorKey present in the repository, this method
 also returns false.descriptorKey - the descriptor key.true if the option is supported.RepositoryException - if an error occurs.protected void checkSupportedOption(String descriptorKey) throws RepositoryException, NotExecutableException
NotExecutableException if the repository does
 not support the feature identified by the given discriptorKey.descriptorKey - the descriptor key.RepositoryException - if an error occurs.NotExecutableException - If the feature is not supported.protected void ensureMultipleWorkspacesSupported()
                                          throws RepositoryException,
                                                 NotExecutableException
NotExecutableException.NotExecutableException - when the repository only supports a single
 workspaceRepositoryExceptionprotected void ensureLockingSupported()
                               throws RepositoryException,
                                      NotExecutableException
NotExecutableException.NotExecutableException - when the repository does not support lockingRepositoryExceptionprotected void ensureCanSetProperty(Node node, String propertyName, int propertyType, boolean isMultiple) throws NotExecutableException, RepositoryException
NotExecutableException.NotExecutableException - when setting the property to the required
 type is not supportedRepositoryExceptionprotected void ensureCanSetProperty(Node node, String propertyName, Value value) throws NotExecutableException, RepositoryException
NotExecutableException.NotExecutableException - when setting the property to the required
 type is not supportedRepositoryExceptionprotected void ensureCanSetProperty(Node node, String propertyName, Value[] values) throws NotExecutableException, RepositoryException
NotExecutableException.NotExecutableException - when setting the property to the required
 type is not supportedRepositoryExceptionprotected void ensureKnowsNodeType(Session session, String nodetype) throws NotExecutableException, RepositoryException
NotExecutableExceptionNotExecutableException - when the specified node type is unknownRepositoryExceptionprotected void ensureMixinType(Node node, String mixin) throws NotExecutableException, RepositoryException
node is of the given mixin type.node - a node.mixin - the name of a mixin type.NotExecutableException - if the node is not of type mixin and the
                                mixin cannot be added.RepositoryException - if an error occurs.protected boolean needsMixin(Node node, String mixin) throws RepositoryException
RepositoryExceptionprotected Node cleanUpTestRoot(Session s) throws RepositoryException
s and deletes any nodes
 under testRoot. If there is no node at testRoot then
 the necessary nodes are created.s - the session to clean up.Node that represents the test root.RepositoryException - if an error occurs.Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.