Package org.apache.jackrabbit.test.api
Class PropertyReadMethodsTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.PropertyReadMethodsTest
-
- All Implemented Interfaces:
junit.framework.Test
public class PropertyReadMethodsTest extends AbstractJCRTest
PropertyReadMethodsTest
...
-
-
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 PropertyReadMethodsTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setUp()
Sets up the fixture for this test.protected void
tearDown()
Releases the session aquired insetUp()
.void
testAccept()
Tests if a Property calls the correct visit method on anItemVisitor
.void
testGetAncestorOfGreaterDepth()
Test if getting the ancestor of depth = n, where n is greater than depth of thisProperty
, throws anItemNotFoundException
.void
testGetAncestorOfItemDepth()
Test if the ancestor at depth = n, where n is the depth of thisItem
, returns thisProperty
itself.void
testGetAncestorOfNegativeDepth()
Test if getting the ancestor of negative depth throws anItemNotFoundException
.void
testGetDepth()
Tests if depth of a property of depth of node + 1void
testGetName()
Tests if getName() returns same as last name returned by getPath()void
testGetNode()
Tests if Property.getNode() fails with ValueFormatException for multivalued properties.void
testGetParent()
Tests if getParent() returns parent nodevoid
testGetPath()
Tests if getPath() returns the correct path.void
testGetSession()
Tests if getSession() is same as through which the Property was acquiredvoid
testGetValue()
Tests failure of Property.getValue() method for a multivalue property.void
testGetValueCopyStoredValues()
Tests ifProperty.getValues()
returns an array that is a copy of the stored values, so changes to it are not reflected in internal storage.void
testGetValues()
Tests failure of Property.getValues() method for a single value property.void
testIsMultiple()
Tests if isMultiple() is consistent with PropertyDefinition.isMultiple().void
testIsNode()
Tests if isNode() returns falsevoid
testIsSame()
Tests if isSame() returns true when retrieving a property through different sessionsvoid
testMultiValueType()
Tests that all values of a multivalue property have the same property type.void
testNoNullValue()
Tests that no null value property exists in a given node tree.-
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 Exception
Sets up the fixture for this test.- Overrides:
setUp
in classAbstractJCRTest
- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception
Releases the session aquired insetUp()
.- Overrides:
tearDown
in classAbstractJCRTest
- Throws:
Exception
-
testGetPath
public void testGetPath() throws NotExecutableException, RepositoryException
Tests if getPath() returns the correct path.
-
testGetName
public void testGetName() throws RepositoryException
Tests if getName() returns same as last name returned by getPath()- Throws:
RepositoryException
-
testGetAncestorOfItemDepth
public void testGetAncestorOfItemDepth() throws RepositoryException
Test if the ancestor at depth = n, where n is the depth of thisItem
, returns thisProperty
itself.- Throws:
RepositoryException
-
testGetAncestorOfGreaterDepth
public void testGetAncestorOfGreaterDepth() throws RepositoryException
Test if getting the ancestor of depth = n, where n is greater than depth of thisProperty
, throws anItemNotFoundException
.- Throws:
RepositoryException
-
testGetAncestorOfNegativeDepth
public void testGetAncestorOfNegativeDepth() throws RepositoryException
Test if getting the ancestor of negative depth throws anItemNotFoundException
.- Throws:
RepositoryException
-
testGetParent
public void testGetParent() throws RepositoryException
Tests if getParent() returns parent node- Throws:
RepositoryException
-
testGetDepth
public void testGetDepth() throws RepositoryException
Tests if depth of a property of depth of node + 1- Throws:
RepositoryException
-
testGetSession
public void testGetSession() throws RepositoryException
Tests if getSession() is same as through which the Property was acquired- Throws:
RepositoryException
-
testIsMultiple
public void testIsMultiple() throws RepositoryException
Tests if isMultiple() is consistent with PropertyDefinition.isMultiple().- Throws:
RepositoryException
-
testIsNode
public void testIsNode()
Tests if isNode() returns false
-
testIsSame
public void testIsSame() throws RepositoryException
Tests if isSame() returns true when retrieving a property through different sessions- Throws:
RepositoryException
-
testAccept
public void testAccept() throws RepositoryException
Tests if a Property calls the correct visit method on anItemVisitor
.- Throws:
RepositoryException
-
testNoNullValue
public void testNoNullValue() throws RepositoryException
Tests that no null value property exists in a given node tree.- Throws:
RepositoryException
-
testMultiValueType
public void testMultiValueType() throws RepositoryException, NotExecutableException
Tests that all values of a multivalue property have the same property type.
-
testGetValue
public void testGetValue() throws RepositoryException, NotExecutableException
Tests failure of Property.getValue() method for a multivalue property.
-
testGetValues
public void testGetValues() throws RepositoryException, NotExecutableException
Tests failure of Property.getValues() method for a single value property.
-
testGetValueCopyStoredValues
public void testGetValueCopyStoredValues() throws NotExecutableException, RepositoryException
Tests ifProperty.getValues()
returns an array that is a copy of the stored values, so changes to it are not reflected in internal storage.
-
testGetNode
public void testGetNode() throws RepositoryException, NotExecutableException
Tests if Property.getNode() fails with ValueFormatException for multivalued properties.
-
-