org.apache.jackrabbit.test.api
Class NodeOrderableChildNodesTest

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
                  extended by org.apache.jackrabbit.test.api.NodeOrderableChildNodesTest
All Implemented Interfaces:
junit.framework.Test

public class NodeOrderableChildNodesTest
extends AbstractJCRTest

NodeOrderableChildNodesTest contains all node writing tests (LEVEL 2) that require a node that allows child node ordering (tests therefore are optional).

If the repository does not support a node type with orderable child nodes a NotExecutableException exception is thrown.

Prerequisites:


Field Summary
 
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, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, vf, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
NodeOrderableChildNodesTest()
           
 
Method Summary
protected  void tearDown()
           
 void testOrderBeforeInvalidDest()
          Tries to reorder child nodes using Node.orderBefore(String, String) with an invalid destination reference.
 void testOrderBeforeInvalidSrc()
          Tries to reorder child nodes using Node.orderBefore(String, String) with an invalid source reference.
 void testOrderBeforePlaceAtEndParentSave()
          Creates two child nodes, reorders first node to end, uses parentNode's Item.save().
 void testOrderBeforePlaceAtEndSessionSave()
          Test Creates two child nodes, verifies that they are added propery.
 void testOrderBeforeSecondToFirstParentSave()
          Creates two child nodes, reorders second node before first, uses parentNode's Item.save().
 void testOrderBeforeSecondToFirstSessionSave()
          Creates two child nodes than reorders second node before first, saves using Session.save().
 void testOrderBeforeUnsupportedRepositoryOperationException()
          Tries to reorder on a node using Node.orderBefore(String, String) that does not support child reordering.
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, run, setUp
 
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
 

Constructor Detail

NodeOrderableChildNodesTest

public NodeOrderableChildNodesTest()
Method Detail

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class AbstractJCRTest
Throws:
Exception

testOrderBeforeInvalidDest

public void testOrderBeforeInvalidDest()
                                throws RepositoryException,
                                       NotExecutableException
Tries to reorder child nodes using Node.orderBefore(String, String) with an invalid destination reference.

This should throw an ItemNotFoundException.

Throws:
RepositoryException
NotExecutableException

testOrderBeforeInvalidSrc

public void testOrderBeforeInvalidSrc()
                               throws RepositoryException,
                                      NotExecutableException
Tries to reorder child nodes using Node.orderBefore(String, String) with an invalid source reference.

This should throw an ItemNotFoundException.

Throws:
RepositoryException
NotExecutableException

testOrderBeforeUnsupportedRepositoryOperationException

public void testOrderBeforeUnsupportedRepositoryOperationException()
                                                            throws RepositoryException,
                                                                   NotExecutableException
Tries to reorder on a node using Node.orderBefore(String, String) that does not support child reordering.

This should throw and UnsupportedRepositoryOperationException. Prequisites:

Throws:
RepositoryException
NotExecutableException

testOrderBeforePlaceAtEndParentSave

public void testOrderBeforePlaceAtEndParentSave()
                                         throws RepositoryException,
                                                NotExecutableException
Creates two child nodes, reorders first node to end, uses parentNode's Item.save().

Throws:
RepositoryException
NotExecutableException

testOrderBeforePlaceAtEndSessionSave

public void testOrderBeforePlaceAtEndSessionSave()
                                          throws RepositoryException,
                                                 NotExecutableException
Test Creates two child nodes, verifies that they are added propery. reorders first node to the end , checks again. uses session.save();

Throws:
RepositoryException
NotExecutableException

testOrderBeforeSecondToFirstParentSave

public void testOrderBeforeSecondToFirstParentSave()
                                            throws RepositoryException,
                                                   NotExecutableException
Creates two child nodes, reorders second node before first, uses parentNode's Item.save().

Throws:
RepositoryException
NotExecutableException

testOrderBeforeSecondToFirstSessionSave

public void testOrderBeforeSecondToFirstSessionSave()
                                             throws RepositoryException,
                                                    NotExecutableException
Creates two child nodes than reorders second node before first, saves using Session.save().

Throws:
RepositoryException
NotExecutableException


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