org.apache.jackrabbit.test
Class AbstractJCRTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractAccessControlTest, AbstractLockTest, AbstractMergeTest, AbstractObservationTest, AbstractQueryTest, AbstractRetentionTest, AbstractVersionTest, AbstractVersionTest, AddNodeTest, BinaryPropertyTest, BooleanPropertyTest, CanAddChildNodeCallWithNodeTypeTest, CanAddChildNodeCallWithoutNodeTypeTest, CanRemoveItemTest, CanSetPropertyBinaryTest, CanSetPropertyBooleanTest, CanSetPropertyDateTest, CanSetPropertyDoubleTest, CanSetPropertyLongTest, CanSetPropertyMultipleTest, CanSetPropertyNameTest, CanSetPropertyPathTest, CanSetPropertyStringTest, CanSetPropertyTest, CheckPermissionTest, DatePropertyTest, DocumentViewImportTest, DoublePropertyTest, ExportDocViewTest, ExportSysViewTest, GetReferencesNodeTest, GetWeakReferencesTest, HasPermissionTest, ImpersonateTest, LifecycleTest, LockManagerTest, LockTest, LongPropertyTest, NamePropertyTest, NamespaceRegistryReadMethodsTest, NamespaceRegistryTest, NamespaceRemappingTest, NameTest, NodeAddMixinTest, NodeCanAddMixinTest, NodeDefTest, NodeDiscoveringNodeTypesTest, NodeItemIsModifiedTest, NodeItemIsNewTest, NodeIteratorTest, NodeOrderableChildNodesTest, NodeReadMethodsTest, NodeRemoveMixinTest, NodeSetPrimaryTypeTest, NodeTest, NodeTypeCreationTest, NodeTypeManagerTest, NodeTypeTest, NodeUUIDTest, PathPropertyTest, PathTest, PredefinedNodeTypeTest, PropertyDefTest, PropertyItemIsModifiedTest, PropertyItemIsNewTest, PropertyReadMethodsTest, PropertyTest, PropertyTypeTest, ReferenceableRootNodesTest, ReferencePropertyTest, ReferencesTest, RepositoryDescriptorTest, RepositoryFactoryTest, RepositoryLoginTest, RootNodeTest, RSessionAccessControlTest, SaveTest, SerializationTest, SessionReadMethodsTest, SessionRemoveItemTest, SessionTest, SessionUUIDTest, SetPropertyAssumeTypeTest, SetPropertyBooleanTest, SetPropertyCalendarTest, SetPropertyConstraintViolationExceptionTest, SetPropertyDecimalTest, SetPropertyDoubleTest, SetPropertyInputStreamTest, SetPropertyLongTest, SetPropertyNodeTest, SetPropertyStringTest, SetPropertyValueTest, SetValueBinaryTest, SetValueBooleanTest, SetValueConstraintViolationExceptionTest, SetValueDateTest, SetValueDecimalTest, SetValueDoubleTest, SetValueLockExceptionTest, SetValueLongTest, SetValueReferenceTest, SetValueStringTest, SetValueValueFormatExceptionTest, SetValueVersionExceptionTest, ShareableNodeTest, StringPropertyTest, UndefinedPropertyTest, ValueFactoryTest, WorkspaceCloneReferenceableTest, WorkspaceCloneSameNameSibsTest, WorkspaceCloneTest, WorkspaceCloneVersionableTest, WorkspaceCopyBetweenWorkspacesReferenceableTest, WorkspaceCopyBetweenWorkspacesSameNameSibsTest, WorkspaceCopyBetweenWorkspacesTest, WorkspaceCopyBetweenWorkspacesVersionableTest, WorkspaceCopyReferenceableTest, WorkspaceCopySameNameSibsTest, WorkspaceCopyTest, WorkspaceCopyVersionableTest, WorkspaceManagementTest, WorkspaceMoveReferenceableTest, WorkspaceMoveSameNameSibsTest, WorkspaceMoveTest, WorkspaceMoveVersionableTest, WorkspaceReadMethodsTest, WorkspaceTest

public abstract class AbstractJCRTest
extends JUnitTest

Abstract base class for all JCR test classes.


Field Summary
protected  boolean isReadOnly
          Flag that indicates if the current test is a read-only test, that is no content is written to the workspace by the test.
protected  java.lang.String jcrBaseVersion
          JCR Name jcr:baseVersion using the namespace resolver of the current session.
protected  java.lang.String jcrCopiedFrom
          JCR Name jcr:copiedFrom using the namespace resolver of the current session.
protected  java.lang.String jcrCreated
          JCR Name jcr:created using the namespace resolver of the current session.
protected  java.lang.String jcrFrozenNode
          JCR Name jcr:frozenNode using the namespace resolver of the current session.
protected  java.lang.String jcrFrozenUuid
          JCR Name jcr:frozenUuid using the namespace resolver of the current session.
protected  java.lang.String jcrIsCheckedOut
          JCR Name jcr:isCheckedOut using the namespace resolver of the current session.
protected  java.lang.String jcrlockIsDeep
          JCR Name jcr:lockIsDeep using the namespace resolver of the current session.
protected  java.lang.String jcrLockOwner
          JCR Name jcr:lockOwner using the namespace resolver of the current session.
protected  java.lang.String jcrMergeFailed
          JCR Name jcr:mergeFailed using the namespace resolver of the current session.
protected  java.lang.String jcrMixinTypes
          JCR Name jcr:mixinTypes using the namespace resolver of the current session.
protected  java.lang.String jcrPredecessors
          JCR Name jcr:predecessors using the namespace resolver of the current session.
protected  java.lang.String jcrPrimaryType
          JCR Name jcr:primaryType using the namespace resolver of the current session.
protected  java.lang.String jcrRootVersion
          JCR Name jcr:rootVersion using the namespace resolver of the current session.
protected  java.lang.String jcrSuccessors
          JCR Name jcr:successors using the namespace resolver of the current session.
protected  java.lang.String jcrSystem
          JCR Name jcr:system using the namespace resolver of the current session.
protected  java.lang.String jcrUUID
          JCR Name jcr:uuid using the namespace resolver of the current session.
protected  java.lang.String jcrVersionHistory
          JCR Name jcr:created using the namespace resolver of the current session.
protected  java.lang.String mixLockable
          JCR Name mix:lockable using the namespace resolver of the current session.
protected  java.lang.String mixReferenceable
          JCR Name mix:referenceable using the namespace resolver of the current session.
protected  java.lang.String mixShareable
          JCR Name mix:shareable using the namespace resolver of the current session.
protected  java.lang.String mixSimpleVersionable
          JCR Name mix:simpleVersionable using the namespace resolver of the current session.
protected  java.lang.String mixVersionable
          JCR Name mix:versionable using the namespace resolver of the current session.
protected  java.lang.String nodeName1
          Name of a node that will be created during a test case.
protected  java.lang.String nodeName2
          Name of a node that will be created during a test case.
protected  java.lang.String nodeName3
          Name of a node that will be created during a test case.
protected  java.lang.String nodeName4
          Name of a node that will be created during a test case.
static java.lang.String NS_JCR_URI
          Namespace URI for jcr prefix.
static java.lang.String NS_MIX_URI
          Namespace URI for mix prefix.
static java.lang.String NS_NT_URI
          Namespace URI for nt prefix.
static java.lang.String NS_SV_URI
          Namespace URI for sv prefix
protected  java.lang.String ntBase
          JCR Name nt:base using the namespace resolver of the current session.
protected  java.lang.String ntFrozenNode
          JCR Name nt:frozenNode using the namespace resolver of the current session.
protected  java.lang.String ntQuery
          JCR Name nt:query using the namespace resolver of the current session.
protected  java.lang.String ntUnstructured
          JCR Name nt:unstructured using the namespace resolver of the current session.
protected  java.lang.String ntVersion
          JCR Name nt:version using the namespace resolver of the current session.
protected  java.lang.String ntVersionHistory
          JCR Name nt:versionHistory using the namespace resolver of the current session.
protected  java.lang.String ntVersionLabels
          JCR Name nt:versionHistory using the namespace resolver of the current session.
protected  java.lang.String propertyName1
          Name of a property that will be used during a test case.
protected  java.lang.String propertyName2
          Name of a property that will be used during a test case.
protected  javax.jcr.Session superuser
          The superuser session for the default workspace
protected  java.lang.String testNodeType
          The node type name for newly created nodes.
protected  java.lang.String testNodeTypeNoChildren
          A node type that does not allow any child nodes, such as nt:base.
protected  java.lang.String testPath
          Relative path to the test root node.
protected  java.lang.String testRoot
          Absolute path to the test root node.
protected  javax.jcr.Node testRootNode
          The root Node for testing
protected  javax.jcr.ValueFactory vf
          The value factory for superuser.
protected  java.lang.String workspaceName
          Name of a workspace to use instead of the default workspace.
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
AbstractJCRTest()
           
 
Method Summary
protected  void checkSupportedOption(java.lang.String descriptorKey)
          Throws a NotExecutableException if the repository does not support the feature identified by the given discriptorKey.
protected  void cleanUp()
           
protected  javax.jcr.Node cleanUpTestRoot(javax.jcr.Session s)
          Reverts any pending changes made by s and deletes any nodes under testRoot.
protected  java.lang.String createRandomString(int numChars)
          Creates a String with a random sequence of characters using 'a' - 'z'.
protected  void ensureCanSetProperty(javax.jcr.Node node, java.lang.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(javax.jcr.Node node, java.lang.String propertyName, javax.jcr.Value value)
          Checks that the repository can set the property to the required type, otherwise aborts with NotExecutableException.
protected  void ensureCanSetProperty(javax.jcr.Node node, java.lang.String propertyName, javax.jcr.Value[] values)
          Checks that the repository can set the property to the required type, otherwise aborts with NotExecutableException.
protected  void ensureKnowsNodeType(javax.jcr.Session session, java.lang.String nodetype)
          Checks that the repository supports the specified node type, otherwise aborts with NotExecutableException
protected  void ensureMixinType(javax.jcr.Node node, java.lang.String mixin)
          Ensures that the given node is of the given mixin type.
protected  void ensureMultipleWorkspacesSupported()
          Checks that the repository supports multiple workspace, otherwise aborts with NotExecutableException.
protected  RepositoryHelper getHelper()
           
 javax.jcr.Value getJcrValue(javax.jcr.Session s, java.lang.String valueProp, java.lang.String typeProp, java.lang.String defaultValue)
          Create a JCR value based on the configuration.
protected static java.lang.String getLocalName(java.lang.String name)
          Returns the local name for the given name.
protected  java.lang.String getNonExistingWorkspaceName(javax.jcr.Session session)
          Returns the name of a workspace that is not accessible from session.
 java.lang.String getProperty(java.lang.String propName)
          Returns the value of the configuration property with propName.
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Returns the value of the configuration property with specified name.
protected  long getSize(javax.jcr.RangeIterator it)
          Returns the size of the RangeIterator it.
protected  boolean isSupported(java.lang.String descriptorKey)
          Returns true if this repository support a certain optional feature; otherwise false is returned.
protected  boolean needsMixin(javax.jcr.Node node, java.lang.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()
           
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NS_JCR_URI

public static final java.lang.String NS_JCR_URI
Namespace URI for jcr prefix.

See Also:
Constant Field Values

NS_NT_URI

public static final java.lang.String NS_NT_URI
Namespace URI for nt prefix.

See Also:
Constant Field Values

NS_MIX_URI

public static final java.lang.String NS_MIX_URI
Namespace URI for mix prefix.

See Also:
Constant Field Values

NS_SV_URI

public static final java.lang.String NS_SV_URI
Namespace URI for sv prefix

See Also:
Constant Field Values

jcrPrimaryType

protected java.lang.String jcrPrimaryType
JCR Name jcr:primaryType using the namespace resolver of the current session.


jcrMixinTypes

protected java.lang.String jcrMixinTypes
JCR Name jcr:mixinTypes using the namespace resolver of the current session.


jcrPredecessors

protected java.lang.String jcrPredecessors
JCR Name jcr:predecessors using the namespace resolver of the current session.


jcrSuccessors

protected java.lang.String jcrSuccessors
JCR Name jcr:successors using the namespace resolver of the current session.


jcrCreated

protected java.lang.String jcrCreated
JCR Name jcr:created using the namespace resolver of the current session.


jcrVersionHistory

protected java.lang.String jcrVersionHistory
JCR Name jcr:created using the namespace resolver of the current session.


jcrCopiedFrom

protected java.lang.String jcrCopiedFrom
JCR Name jcr:copiedFrom using the namespace resolver of the current session.


jcrFrozenNode

protected java.lang.String jcrFrozenNode
JCR Name jcr:frozenNode using the namespace resolver of the current session.


jcrFrozenUuid

protected java.lang.String jcrFrozenUuid
JCR Name jcr:frozenUuid using the namespace resolver of the current session.


jcrRootVersion

protected java.lang.String jcrRootVersion
JCR Name jcr:rootVersion using the namespace resolver of the current session.


jcrIsCheckedOut

protected java.lang.String jcrIsCheckedOut
JCR Name jcr:isCheckedOut using the namespace resolver of the current session.


jcrBaseVersion

protected java.lang.String jcrBaseVersion
JCR Name jcr:baseVersion using the namespace resolver of the current session.


jcrUUID

protected java.lang.String jcrUUID
JCR Name jcr:uuid using the namespace resolver of the current session.


jcrLockOwner

protected java.lang.String jcrLockOwner
JCR Name jcr:lockOwner using the namespace resolver of the current session.


jcrlockIsDeep

protected java.lang.String jcrlockIsDeep
JCR Name jcr:lockIsDeep using the namespace resolver of the current session.


jcrMergeFailed

protected java.lang.String jcrMergeFailed
JCR Name jcr:mergeFailed using the namespace resolver of the current session.


jcrSystem

protected java.lang.String jcrSystem
JCR Name jcr:system using the namespace resolver of the current session.


ntBase

protected java.lang.String ntBase
JCR Name nt:base using the namespace resolver of the current session.


ntUnstructured

protected java.lang.String ntUnstructured
JCR Name nt:unstructured using the namespace resolver of the current session.


ntVersion

protected java.lang.String ntVersion
JCR Name nt:version using the namespace resolver of the current session.


ntVersionHistory

protected java.lang.String ntVersionHistory
JCR Name nt:versionHistory using the namespace resolver of the current session.


ntVersionLabels

protected java.lang.String ntVersionLabels
JCR Name nt:versionHistory using the namespace resolver of the current session.


ntFrozenNode

protected java.lang.String ntFrozenNode
JCR Name nt:frozenNode using the namespace resolver of the current session.


mixReferenceable

protected java.lang.String mixReferenceable
JCR Name mix:referenceable using the namespace resolver of the current session.


mixVersionable

protected java.lang.String mixVersionable
JCR Name mix:versionable using the namespace resolver of the current session.


mixSimpleVersionable

protected java.lang.String mixSimpleVersionable
JCR Name mix:simpleVersionable using the namespace resolver of the current session.


mixLockable

protected java.lang.String mixLockable
JCR Name mix:lockable using the namespace resolver of the current session.


mixShareable

protected java.lang.String mixShareable
JCR Name mix:shareable using the namespace resolver of the current session.


ntQuery

protected java.lang.String ntQuery
JCR Name nt:query using the namespace resolver of the current session.


testPath

protected java.lang.String testPath
Relative path to the test root node.


testRoot

protected java.lang.String testRoot
Absolute path to the test root node.


testNodeType

protected java.lang.String testNodeType
The node type name for newly created nodes.


testNodeTypeNoChildren

protected java.lang.String testNodeTypeNoChildren
A node type that does not allow any child nodes, such as nt:base.


nodeName1

protected java.lang.String nodeName1
Name of a node that will be created during a test case.


nodeName2

protected java.lang.String nodeName2
Name of a node that will be created during a test case.


nodeName3

protected java.lang.String nodeName3
Name of a node that will be created during a test case.


nodeName4

protected java.lang.String nodeName4
Name of a node that will be created during a test case.


propertyName1

protected java.lang.String propertyName1
Name of a property that will be used during a test case.


propertyName2

protected java.lang.String propertyName2
Name of a property that will be used during a test case.


workspaceName

protected java.lang.String workspaceName
Name of a workspace to use instead of the default workspace.


superuser

protected javax.jcr.Session superuser
The superuser session for the default workspace


isReadOnly

protected boolean isReadOnly
Flag that indicates if the current test is a read-only test, that is no content is written to the workspace by the test.


testRootNode

protected javax.jcr.Node testRootNode
The root Node for testing


vf

protected javax.jcr.ValueFactory vf
The value factory for superuser.

Constructor Detail

AbstractJCRTest

public AbstractJCRTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

cleanUp

protected void cleanUp()
                throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

run

public void run(junit.framework.TestResult testResult)
Runs the test cases of this test class and reports the results to 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.

Specified by:
run in interface junit.framework.Test
Overrides:
run in class junit.framework.TestCase
Parameters:
testResult - the test result.

getHelper

protected RepositoryHelper getHelper()
Returns:
the repository helper instance that is associated with this test.

getProperty

public java.lang.String getProperty(java.lang.String propName)
                             throws javax.jcr.RepositoryException
Returns the value of the configuration property with propName. The sequence how configuration properties are read is the follwoing:
  1. javax.jcr.tck.<testClassName>.<testCaseName>.<propName>
  2. javax.jcr.tck.<testClassName>.<propName>
  3. javax.jcr.tck.<packageName>.<propName>
  4. javax.jcr.tck.<propName>
Where:

Parameters:
propName - the propName of the configration property.
Returns:
the value of the property or null if the property does not exist.
Throws:
javax.jcr.RepositoryException - if an error occurs while reading from the configuration.

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    java.lang.String defaultValue)
                             throws javax.jcr.RepositoryException
Returns the value of the configuration property with specified name. If the property does not exist defaultValue is returned.

Configuration properties are defined in the file: repositoryStubImpl.properties.

Parameters:
name - the name of the property to retrieve.
defaultValue - the default value if the property does not exist.
Returns:
the value of the property or defaultValue if non existent.
Throws:
javax.jcr.RepositoryException - if the configuration file cannot be found.

getJcrValue

public javax.jcr.Value getJcrValue(javax.jcr.Session s,
                                   java.lang.String valueProp,
                                   java.lang.String typeProp,
                                   java.lang.String defaultValue)
                            throws javax.jcr.RepositoryException
Create a JCR value based on the configuration.

Parameters:
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.
Returns:
JCR value to be used for a test.
Throws:
javax.jcr.RepositoryException

getSize

protected long getSize(javax.jcr.RangeIterator it)
Returns the size of the RangeIterator it. Note, that the RangeIterator might get consumed, because RangeIterator.getSize() might return -1 (information unavailable).

Parameters:
it - a RangeIterator.
Returns:
the size of the iterator (number of elements).

getLocalName

protected static java.lang.String getLocalName(java.lang.String name)
Returns the local name for the given name.

Parameters:
name - the name.
Returns:
the local name part.

getNonExistingWorkspaceName

protected java.lang.String getNonExistingWorkspaceName(javax.jcr.Session session)
                                                throws javax.jcr.RepositoryException
Returns the name of a workspace that is not accessible from session.

Parameters:
session - the session.
Returns:
name of a non existing workspace.
Throws:
javax.jcr.RepositoryException - if an error occurs.

createRandomString

protected java.lang.String createRandomString(int numChars)
Creates a String with a random sequence of characters using 'a' - 'z'.

Parameters:
numChars - number of characters.
Returns:
the generated String.

isSupported

protected boolean isSupported(java.lang.String descriptorKey)
                       throws javax.jcr.RepositoryException
Returns 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.

Parameters:
descriptorKey - the descriptor key.
Returns:
true if the option is supported.
Throws:
javax.jcr.RepositoryException - if an error occurs.

checkSupportedOption

protected void checkSupportedOption(java.lang.String descriptorKey)
                             throws javax.jcr.RepositoryException,
                                    NotExecutableException
Throws a NotExecutableException if the repository does not support the feature identified by the given discriptorKey.

Parameters:
descriptorKey - the descriptor key.
Throws:
javax.jcr.RepositoryException - if an error occurs.
NotExecutableException - If the feature is not supported.

ensureMultipleWorkspacesSupported

protected void ensureMultipleWorkspacesSupported()
                                          throws javax.jcr.RepositoryException,
                                                 NotExecutableException
Checks that the repository supports multiple workspace, otherwise aborts with NotExecutableException.

Throws:
NotExecutableException - when the repository only supports a single workspace
javax.jcr.RepositoryException

ensureCanSetProperty

protected void ensureCanSetProperty(javax.jcr.Node node,
                                    java.lang.String propertyName,
                                    int propertyType,
                                    boolean isMultiple)
                             throws NotExecutableException,
                                    javax.jcr.RepositoryException
Checks that the repository can set the property to the required type, otherwise aborts with NotExecutableException.

Throws:
NotExecutableException - when setting the property to the required type is not supported
javax.jcr.RepositoryException

ensureCanSetProperty

protected void ensureCanSetProperty(javax.jcr.Node node,
                                    java.lang.String propertyName,
                                    javax.jcr.Value value)
                             throws NotExecutableException,
                                    javax.jcr.RepositoryException
Checks that the repository can set the property to the required type, otherwise aborts with NotExecutableException.

Throws:
NotExecutableException - when setting the property to the required type is not supported
javax.jcr.RepositoryException

ensureCanSetProperty

protected void ensureCanSetProperty(javax.jcr.Node node,
                                    java.lang.String propertyName,
                                    javax.jcr.Value[] values)
                             throws NotExecutableException,
                                    javax.jcr.RepositoryException
Checks that the repository can set the property to the required type, otherwise aborts with NotExecutableException.

Throws:
NotExecutableException - when setting the property to the required type is not supported
javax.jcr.RepositoryException

ensureKnowsNodeType

protected void ensureKnowsNodeType(javax.jcr.Session session,
                                   java.lang.String nodetype)
                            throws NotExecutableException,
                                   javax.jcr.RepositoryException
Checks that the repository supports the specified node type, otherwise aborts with NotExecutableException

Throws:
NotExecutableException - when the specified node type is unknown
javax.jcr.RepositoryException

ensureMixinType

protected void ensureMixinType(javax.jcr.Node node,
                               java.lang.String mixin)
                        throws NotExecutableException,
                               javax.jcr.RepositoryException
Ensures that the given node is of the given mixin type.

Parameters:
node - a node.
mixin - the name of a mixin type.
Throws:
NotExecutableException - if the node is not of type mixin and the mixin cannot be added.
javax.jcr.RepositoryException - if an error occurs.

needsMixin

protected boolean needsMixin(javax.jcr.Node node,
                             java.lang.String mixin)
                      throws javax.jcr.RepositoryException
Checks whether the node already has the specified mixin node type

Throws:
javax.jcr.RepositoryException

cleanUpTestRoot

protected javax.jcr.Node cleanUpTestRoot(javax.jcr.Session s)
                                  throws javax.jcr.RepositoryException
Reverts any pending changes made by s and deletes any nodes under testRoot. If there is no node at testRoot then the necessary nodes are created.

Parameters:
s - the session to clean up.
Returns:
the Node that represents the test root.
Throws:
javax.jcr.RepositoryException - if an error occurs.


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.