Package org.apache.jackrabbit.test.api
Class AddNodeTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.AddNodeTest
-
- All Implemented Interfaces:
junit.framework.Test
public class AddNodeTest extends AbstractJCRTest
AddNodeTestcontains the test cases for the methodNode.addNode(String, String).
-
-
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, 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, vf, workspaceName
-
-
Constructor Summary
Constructors Constructor Description AddNodeTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestAbstractNodeType()Tests if addNode() throws a ConstraintViolationException in case of an abstract node type.voidtestAddNodeParentSave()Creates a new node usingNode.addNode(String,String), saves usingItem.save()on parent node.voidtestAddNodeRepositoryExceptionSaveOnNewNode()Creates a new node usingNode.addNode(String, String), then tries to callItem.save()on the new node.voidtestAddNodeSessionSave()Creates a new node usingNode.addNode(String, String), saves usingSession.save().voidtestConstraintViolation()Tests if a ConstraintViolationException is thrown when one attempts to add a node at a path that references a property.voidtestMixinNodeType()Tests if addNode() throws a ConstraintViolationException in case of an mixin node type.voidtestName()Tests if the name of the created node is correct.voidtestNodeType()Tests if the node type of the created node is correct.voidtestPath()Tests if the path of the created node is correct.voidtestPathNotFound()Tests if addNode() throws a PathNotFoundException in case intermediary nodes do not exist.voidtestRepositoryException()Tests if a RepositoryException is thrown in case the path for the new node contains an index.voidtestSameNameSiblings()Tests if same name siblings have equal names or if same name siblings are not supported a ItemExistsException is thrown.voidtestSimilarNodeNamesNfcNfd()Tests the behavior with respect to Unicode normalizationvoidtestSimilarNodeNamesUpperLower()Tests the behavior with respect to case-sensitivityvoidtestUnknownNodeType()Tests if addNode() throws a NoSuchNodeTypeException in case of an unknown node type.-
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, setUp, tearDown
-
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
-
testName
public void testName() throws RepositoryExceptionTests if the name of the created node is correct.- Throws:
RepositoryException
-
testNodeType
public void testNodeType() throws RepositoryExceptionTests if the node type of the created node is correct.- Throws:
RepositoryException
-
testSameNameSiblings
public void testSameNameSiblings() throws RepositoryExceptionTests if same name siblings have equal names or if same name siblings are not supported a ItemExistsException is thrown.- Throws:
RepositoryException
-
testUnknownNodeType
public void testUnknownNodeType() throws RepositoryExceptionTests if addNode() throws a NoSuchNodeTypeException in case of an unknown node type.- Throws:
RepositoryException
-
testAbstractNodeType
public void testAbstractNodeType() throws RepositoryExceptionTests if addNode() throws a ConstraintViolationException in case of an abstract node type.- Throws:
RepositoryException
-
testMixinNodeType
public void testMixinNodeType() throws RepositoryException, NotExecutableExceptionTests if addNode() throws a ConstraintViolationException in case of an mixin node type.
-
testPath
public void testPath() throws RepositoryExceptionTests if the path of the created node is correct.- Throws:
RepositoryException
-
testPathNotFound
public void testPathNotFound() throws RepositoryExceptionTests if addNode() throws a PathNotFoundException in case intermediary nodes do not exist.- Throws:
RepositoryException
-
testConstraintViolation
public void testConstraintViolation() throws RepositoryExceptionTests if a ConstraintViolationException is thrown when one attempts to add a node at a path that references a property.- Throws:
RepositoryException
-
testRepositoryException
public void testRepositoryException()
Tests if a RepositoryException is thrown in case the path for the new node contains an index.
-
testAddNodeParentSave
public void testAddNodeParentSave() throws RepositoryExceptionCreates a new node usingNode.addNode(String,String), saves usingItem.save()on parent node. Uses a second session to verify if the node have been saved.- Throws:
RepositoryException
-
testAddNodeSessionSave
public void testAddNodeSessionSave() throws RepositoryExceptionCreates a new node usingNode.addNode(String, String), saves usingSession.save(). Uses a second session to verify if the node has been safed.- Throws:
RepositoryException
-
testAddNodeRepositoryExceptionSaveOnNewNode
public void testAddNodeRepositoryExceptionSaveOnNewNode() throws RepositoryExceptionCreates a new node usingNode.addNode(String, String), then tries to callItem.save()on the new node.This should throw an
RepositoryException.- Throws:
RepositoryException
-
testSimilarNodeNamesUpperLower
public void testSimilarNodeNamesUpperLower() throws RepositoryExceptionTests the behavior with respect to case-sensitivity- Throws:
RepositoryException
-
testSimilarNodeNamesNfcNfd
public void testSimilarNodeNamesNfcNfd() throws RepositoryExceptionTests the behavior with respect to Unicode normalization- Throws:
RepositoryException
-
-