org.apache.sling.commons.testing.jcr
Class MockNode
java.lang.Object
   org.apache.sling.commons.testing.jcr.MockNode
org.apache.sling.commons.testing.jcr.MockNode
- All Implemented Interfaces: 
- javax.jcr.Item, javax.jcr.Node
- public class MockNode 
- extends java.lang.Object- implements javax.jcr.Node
| Constructor Summary | 
| MockNode(java.lang.String path)
 | 
| MockNode(java.lang.String path,
         java.lang.String type)
 | 
 
| Method Summary | 
|  void | accept(javax.jcr.ItemVisitor visitor)
 | 
|  void | addMixin(java.lang.String mixinName)
 | 
|  javax.jcr.Node | addNode(java.lang.String relPath)
 | 
|  javax.jcr.Node | addNode(java.lang.String relPath,
        java.lang.String primaryNodeTypeName)
 | 
|  boolean | canAddMixin(java.lang.String mixinName)
 | 
|  void | cancelMerge(javax.jcr.version.Version version)
 | 
|  javax.jcr.version.Version | checkin()
 | 
|  void | checkout()
 | 
|  void | doneMerge(javax.jcr.version.Version version)
 | 
|  boolean | equals(java.lang.Object obj)
 | 
|  javax.jcr.Item | getAncestor(int depth)
 | 
|  javax.jcr.version.Version | getBaseVersion()
 | 
|  java.lang.String | getCorrespondingNodePath(java.lang.String workspaceName)
 | 
|  javax.jcr.nodetype.NodeDefinition | getDefinition()
 | 
|  int | getDepth()
 | 
|  int | getIndex()
 | 
|  javax.jcr.lock.Lock | getLock()
 | 
|  javax.jcr.nodetype.NodeType[] | getMixinNodeTypes()
 | 
|  java.lang.String | getName()
 | 
|  javax.jcr.Node | getNode(java.lang.String relPath)
 | 
|  javax.jcr.NodeIterator | getNodes()
 | 
|  javax.jcr.NodeIterator | getNodes(java.lang.String namePattern)
 | 
|  javax.jcr.Node | getParent()
 | 
|  java.lang.String | getPath()
 | 
|  javax.jcr.Item | getPrimaryItem()
 | 
|  javax.jcr.nodetype.NodeType | getPrimaryNodeType()
 | 
|  javax.jcr.PropertyIterator | getProperties()
 | 
|  javax.jcr.PropertyIterator | getProperties(java.lang.String namePattern)
 | 
|  javax.jcr.Property | getProperty(java.lang.String relPath)
 | 
|  javax.jcr.PropertyIterator | getReferences()
 | 
|  javax.jcr.Session | getSession()
 | 
|  java.lang.String | getUUID()
 | 
|  javax.jcr.version.VersionHistory | getVersionHistory()
 | 
|  int | hashCode()
 | 
|  boolean | hasNode(java.lang.String relPath)
 | 
|  boolean | hasNodes()
 | 
|  boolean | hasProperties()
 | 
|  boolean | hasProperty(java.lang.String relPath)
 | 
|  boolean | holdsLock()
 | 
|  boolean | isCheckedOut()
 | 
|  boolean | isLocked()
 | 
|  boolean | isModified()
 | 
|  boolean | isNew()
 | 
|  boolean | isNode()
 | 
|  boolean | isNodeType(java.lang.String nodeTypeName)
 | 
|  boolean | isSame(javax.jcr.Item otherItem)
 | 
|  javax.jcr.lock.Lock | lock(boolean isDeep,
     boolean isSessionScoped)
 | 
|  javax.jcr.NodeIterator | merge(java.lang.String srcWorkspace,
      boolean bestEffort)
 | 
|  void | orderBefore(java.lang.String srcChildRelPath,
            java.lang.String destChildRelPath)
 | 
|  void | refresh(boolean keepChanges)
 | 
|  void | remove()
 | 
|  void | removeMixin(java.lang.String mixinName)
 | 
|  void | restore(java.lang.String versionName,
        boolean removeExisting)
 | 
|  void | restore(javax.jcr.version.Version version,
        boolean removeExisting)
 | 
|  void | restore(javax.jcr.version.Version version,
        java.lang.String relPath,
        boolean removeExisting)
 | 
|  void | restoreByLabel(java.lang.String versionLabel,
               boolean removeExisting)
 | 
|  void | save()
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            boolean value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.util.Calendar value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            double value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.io.InputStream value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            long value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            javax.jcr.Node value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.lang.String value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.lang.String[] values)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.lang.String[] values,
            int type)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            java.lang.String value,
            int type)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            javax.jcr.Value value)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            javax.jcr.Value[] values)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            javax.jcr.Value[] values,
            int type)
 | 
|  javax.jcr.Property | setProperty(java.lang.String name,
            javax.jcr.Value value,
            int type)
 | 
|  java.lang.String | toString()
 | 
|  void | unlock()
 | 
|  void | update(java.lang.String srcWorkspaceName)
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
 
MockNode
public MockNode(java.lang.String path)
MockNode
public MockNode(java.lang.String path,
                java.lang.String type)
getName
public java.lang.String getName()
- 
- Specified by:
- getNamein interface- javax.jcr.Item
 
- 
 
getParent
public javax.jcr.Node getParent()
- 
- Specified by:
- getParentin interface- javax.jcr.Item
 
- 
 
getPath
public java.lang.String getPath()
- 
- Specified by:
- getPathin interface- javax.jcr.Item
 
- 
 
getPrimaryNodeType
public javax.jcr.nodetype.NodeType getPrimaryNodeType()
- 
- Specified by:
- getPrimaryNodeTypein interface- javax.jcr.Node
 
- 
 
isSame
public boolean isSame(javax.jcr.Item otherItem)
- 
- Specified by:
- isSamein interface- javax.jcr.Item
 
- 
 
equals
public boolean equals(java.lang.Object obj)
- 
- Overrides:
- equalsin class- java.lang.Object
 
- 
 
hashCode
public int hashCode()
- 
- Overrides:
- hashCodein class- java.lang.Object
 
- 
 
toString
public java.lang.String toString()
- 
- Overrides:
- toStringin class- java.lang.Object
 
- 
 
addMixin
public void addMixin(java.lang.String mixinName)
- 
- Specified by:
- addMixinin interface- javax.jcr.Node
 
- 
 
addNode
public javax.jcr.Node addNode(java.lang.String relPath)
- 
- Specified by:
- addNodein interface- javax.jcr.Node
 
- 
 
addNode
public javax.jcr.Node addNode(java.lang.String relPath,
                              java.lang.String primaryNodeTypeName)
- 
- Specified by:
- addNodein interface- javax.jcr.Node
 
- 
 
canAddMixin
public boolean canAddMixin(java.lang.String mixinName)
- 
- Specified by:
- canAddMixinin interface- javax.jcr.Node
 
- 
 
cancelMerge
public void cancelMerge(javax.jcr.version.Version version)
- 
- Specified by:
- cancelMergein interface- javax.jcr.Node
 
- 
 
checkin
public javax.jcr.version.Version checkin()
- 
- Specified by:
- checkinin interface- javax.jcr.Node
 
- 
 
checkout
public void checkout()
- 
- Specified by:
- checkoutin interface- javax.jcr.Node
 
- 
 
doneMerge
public void doneMerge(javax.jcr.version.Version version)
- 
- Specified by:
- doneMergein interface- javax.jcr.Node
 
- 
 
getBaseVersion
public javax.jcr.version.Version getBaseVersion()
- 
- Specified by:
- getBaseVersionin interface- javax.jcr.Node
 
- 
 
getCorrespondingNodePath
public java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
- 
- Specified by:
- getCorrespondingNodePathin interface- javax.jcr.Node
 
- 
 
getDefinition
public javax.jcr.nodetype.NodeDefinition getDefinition()
- 
- Specified by:
- getDefinitionin interface- javax.jcr.Node
 
- 
 
getIndex
public int getIndex()
- 
- Specified by:
- getIndexin interface- javax.jcr.Node
 
- 
 
getLock
public javax.jcr.lock.Lock getLock()
- 
- Specified by:
- getLockin interface- javax.jcr.Node
 
- 
 
getMixinNodeTypes
public javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
- 
- Specified by:
- getMixinNodeTypesin interface- javax.jcr.Node
 
- 
 
getNode
public javax.jcr.Node getNode(java.lang.String relPath)
- 
- Specified by:
- getNodein interface- javax.jcr.Node
 
- 
 
getNodes
public javax.jcr.NodeIterator getNodes()
- 
- Specified by:
- getNodesin interface- javax.jcr.Node
 
- 
 
getNodes
public javax.jcr.NodeIterator getNodes(java.lang.String namePattern)
- 
- Specified by:
- getNodesin interface- javax.jcr.Node
 
- 
 
getPrimaryItem
public javax.jcr.Item getPrimaryItem()
- 
- Specified by:
- getPrimaryItemin interface- javax.jcr.Node
 
- 
 
getProperties
public javax.jcr.PropertyIterator getProperties()
- 
- Specified by:
- getPropertiesin interface- javax.jcr.Node
 
- 
 
getProperties
public javax.jcr.PropertyIterator getProperties(java.lang.String namePattern)
- 
- Specified by:
- getPropertiesin interface- javax.jcr.Node
 
- 
 
getProperty
public javax.jcr.Property getProperty(java.lang.String relPath)
- 
- Specified by:
- getPropertyin interface- javax.jcr.Node
 
- 
 
getReferences
public javax.jcr.PropertyIterator getReferences()
- 
- Specified by:
- getReferencesin interface- javax.jcr.Node
 
- 
 
getUUID
public java.lang.String getUUID()
- 
- Specified by:
- getUUIDin interface- javax.jcr.Node
 
- 
 
getVersionHistory
public javax.jcr.version.VersionHistory getVersionHistory()
- 
- Specified by:
- getVersionHistoryin interface- javax.jcr.Node
 
- 
 
hasNode
public boolean hasNode(java.lang.String relPath)
- 
- Specified by:
- hasNodein interface- javax.jcr.Node
 
- 
 
hasNodes
public boolean hasNodes()
- 
- Specified by:
- hasNodesin interface- javax.jcr.Node
 
- 
 
hasProperties
public boolean hasProperties()
- 
- Specified by:
- hasPropertiesin interface- javax.jcr.Node
 
- 
 
hasProperty
public boolean hasProperty(java.lang.String relPath)
- 
- Specified by:
- hasPropertyin interface- javax.jcr.Node
 
- 
 
holdsLock
public boolean holdsLock()
- 
- Specified by:
- holdsLockin interface- javax.jcr.Node
 
- 
 
isCheckedOut
public boolean isCheckedOut()
- 
- Specified by:
- isCheckedOutin interface- javax.jcr.Node
 
- 
 
isLocked
public boolean isLocked()
- 
- Specified by:
- isLockedin interface- javax.jcr.Node
 
- 
 
isNodeType
public boolean isNodeType(java.lang.String nodeTypeName)
- 
- Specified by:
- isNodeTypein interface- javax.jcr.Node
 
- 
 
lock
public javax.jcr.lock.Lock lock(boolean isDeep,
                                boolean isSessionScoped)
- 
- Specified by:
- lockin interface- javax.jcr.Node
 
- 
 
merge
public javax.jcr.NodeIterator merge(java.lang.String srcWorkspace,
                                    boolean bestEffort)
- 
- Specified by:
- mergein interface- javax.jcr.Node
 
- 
 
orderBefore
public void orderBefore(java.lang.String srcChildRelPath,
                        java.lang.String destChildRelPath)
- 
- Specified by:
- orderBeforein interface- javax.jcr.Node
 
- 
 
removeMixin
public void removeMixin(java.lang.String mixinName)
- 
- Specified by:
- removeMixinin interface- javax.jcr.Node
 
- 
 
restore
public void restore(java.lang.String versionName,
                    boolean removeExisting)
- 
- Specified by:
- restorein interface- javax.jcr.Node
 
- 
 
restore
public void restore(javax.jcr.version.Version version,
                    boolean removeExisting)
- 
- Specified by:
- restorein interface- javax.jcr.Node
 
- 
 
restore
public void restore(javax.jcr.version.Version version,
                    java.lang.String relPath,
                    boolean removeExisting)
- 
- Specified by:
- restorein interface- javax.jcr.Node
 
- 
 
restoreByLabel
public void restoreByLabel(java.lang.String versionLabel,
                           boolean removeExisting)
- 
- Specified by:
- restoreByLabelin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Value value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Value[] values)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String[] values)
                               throws javax.jcr.ValueFormatException,
                                      javax.jcr.version.VersionException,
                                      javax.jcr.lock.LockException,
                                      javax.jcr.nodetype.ConstraintViolationException,
                                      javax.jcr.RepositoryException
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
- Throws:
- javax.jcr.ValueFormatException
- javax.jcr.version.VersionException
- javax.jcr.lock.LockException
- javax.jcr.nodetype.ConstraintViolationException
- javax.jcr.RepositoryException
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String value)
                               throws javax.jcr.ValueFormatException,
                                      javax.jcr.version.VersionException,
                                      javax.jcr.lock.LockException,
                                      javax.jcr.nodetype.ConstraintViolationException,
                                      javax.jcr.RepositoryException
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
- Throws:
- javax.jcr.ValueFormatException
- javax.jcr.version.VersionException
- javax.jcr.lock.LockException
- javax.jcr.nodetype.ConstraintViolationException
- javax.jcr.RepositoryException
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.io.InputStream value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      boolean value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      double value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      long value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.util.Calendar value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Node value)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Value value,
                                      int type)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Value[] values,
                                      int type)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String[] values,
                                      int type)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
setProperty
public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String value,
                                      int type)
- 
- Specified by:
- setPropertyin interface- javax.jcr.Node
 
- 
 
unlock
public void unlock()
- 
- Specified by:
- unlockin interface- javax.jcr.Node
 
- 
 
update
public void update(java.lang.String srcWorkspaceName)
- 
- Specified by:
- updatein interface- javax.jcr.Node
 
- 
 
accept
public void accept(javax.jcr.ItemVisitor visitor)
- 
- Specified by:
- acceptin interface- javax.jcr.Item
 
- 
 
getAncestor
public javax.jcr.Item getAncestor(int depth)
- 
- Specified by:
- getAncestorin interface- javax.jcr.Item
 
- 
 
getDepth
public int getDepth()
- 
- Specified by:
- getDepthin interface- javax.jcr.Item
 
- 
 
getSession
public javax.jcr.Session getSession()
- 
- Specified by:
- getSessionin interface- javax.jcr.Item
 
- 
 
isModified
public boolean isModified()
- 
- Specified by:
- isModifiedin interface- javax.jcr.Item
 
- 
 
isNew
public boolean isNew()
- 
- Specified by:
- isNewin interface- javax.jcr.Item
 
- 
 
isNode
public boolean isNode()
- 
- Specified by:
- isNodein interface- javax.jcr.Item
 
- 
 
refresh
public void refresh(boolean keepChanges)
- 
- Specified by:
- refreshin interface- javax.jcr.Item
 
- 
 
remove
public void remove()
- 
- Specified by:
- removein interface- javax.jcr.Item
 
- 
 
save
public void save()
- 
- Specified by:
- savein interface- javax.jcr.Item
 
- 
 
Copyright © 2007-2009. All Rights Reserved.