Class NodeTypeTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.nodetype.NodeTypeTest
-
- All Implemented Interfaces:
junit.framework.Test
public class NodeTypeTest extends AbstractJCRTest
Tests if the node type hierarchy is correctly mapped to the methods defined inNodeType.
-
-
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 NodeTypeTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()Sets up the fixture for the test cases.protected voidtearDown()Releases the session aquired insetUp().voidtestGetDeclaredChildNodeDefs()Test if all node defs returned by getDeclaredChildNodeDefs() are also returned by getChildNodeDefs().voidtestGetDeclaredPropertyDefs()Test if all property defs returned by getDeclatedPropertyDefs() are also returned by getPropertyDefs().voidtestGetDeclaredSubtypes()Test if all node types returned by getDeclaredSubtypes() are also returned by getSubtypes(), and that the information is consistent with getSuperTypes/getDeclaredSuperTypes.voidtestGetDeclaredSupertypes()Test if all node types returned by getDeclaredSupertypes() are also returned by getSupertypes().voidtestGetName()Test if getNode() returns the name of a node type.voidtestGetPrimaryItemName()Test if node.getPrimaryItemName() returns the same name as node.getPrimaryItem().getName()voidtestGetPrimaryItemNameNotExisting()Test if node.getPrimaryItemName() returns null if no primary item is definedvoidtestGetPropertyDefs()Test if getPropertyDefs() of a primary node returns also "jcr:primaryType" which is inherited from "nt:base".voidtestGetSupertypes()Test if getSupertypes() of a primary node that is not "nt:base" returns at least "nt:base".voidtestIsMixin()Test if isMixin() returns false if applied on a primary node type and true on a mixin node type.voidtestIsNodeType()Test if isNodeType(String nodeTypeName) returns true if nodeTypeName is the name of the node itself.voidtestIsNodeTypeQName()LiketestIsNodeType(), but using qualified names-
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
-
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
-
setUp
protected void setUp() throws ExceptionSets up the fixture for the test cases.- Overrides:
setUpin classAbstractJCRTest- Throws:
Exception
-
tearDown
protected void tearDown() throws ExceptionReleases the session aquired insetUp().- Overrides:
tearDownin classAbstractJCRTest- Throws:
Exception
-
testGetName
public void testGetName() throws RepositoryExceptionTest if getNode() returns the name of a node type.- Throws:
RepositoryException
-
testIsMixin
public void testIsMixin() throws RepositoryExceptionTest if isMixin() returns false if applied on a primary node type and true on a mixin node type.- Throws:
RepositoryException
-
testGetPrimaryItemName
public void testGetPrimaryItemName() throws NotExecutableException, RepositoryExceptionTest if node.getPrimaryItemName() returns the same name as node.getPrimaryItem().getName()
-
testGetPrimaryItemNameNotExisting
public void testGetPrimaryItemNameNotExisting() throws NotExecutableException, RepositoryExceptionTest if node.getPrimaryItemName() returns null if no primary item is defined
-
testGetSupertypes
public void testGetSupertypes() throws NotExecutableException, RepositoryExceptionTest if getSupertypes() of a primary node that is not "nt:base" returns at least "nt:base". NotExecutableException is thrown if no primary node type apart from "nt:base".
-
testGetDeclaredSupertypes
public void testGetDeclaredSupertypes() throws RepositoryExceptionTest if all node types returned by getDeclaredSupertypes() are also returned by getSupertypes(). All existing node types are tested.- Throws:
RepositoryException
-
testGetDeclaredSubtypes
public void testGetDeclaredSubtypes() throws RepositoryExceptionTest if all node types returned by getDeclaredSubtypes() are also returned by getSubtypes(), and that the information is consistent with getSuperTypes/getDeclaredSuperTypes. All existing node types are tested.- Throws:
RepositoryException- Since:
- JCR 2.0
-
testIsNodeType
public void testIsNodeType() throws RepositoryExceptionTest if isNodeType(String nodeTypeName) returns true if nodeTypeName is the name of the node itself. Also, primary node types must return true if nodeTypeName is "nt:base", and mixin node types must return false in that case.- Throws:
RepositoryException
-
testIsNodeTypeQName
public void testIsNodeTypeQName() throws RepositoryExceptionLiketestIsNodeType(), but using qualified names- Throws:
RepositoryException
-
testGetDeclaredPropertyDefs
public void testGetDeclaredPropertyDefs() throws RepositoryExceptionTest if all property defs returned by getDeclatedPropertyDefs() are also returned by getPropertyDefs(). All existing node types are tested.- Throws:
RepositoryException
-
testGetPropertyDefs
public void testGetPropertyDefs() throws NotExecutableException, RepositoryExceptionTest if getPropertyDefs() of a primary node returns also "jcr:primaryType" which is inherited from "nt:base".
-
testGetDeclaredChildNodeDefs
public void testGetDeclaredChildNodeDefs() throws RepositoryExceptionTest if all node defs returned by getDeclaredChildNodeDefs() are also returned by getChildNodeDefs(). All existing node types are tested.- Throws:
RepositoryException
-
-