|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.jackrabbit.test.JUnitTest
org.apache.jackrabbit.test.AbstractJCRTest
org.apache.jackrabbit.test.api.SessionTest
public class SessionTest
SessionTest
contains all test cases for the
javax.jcr.Session
class that are level 2 (modifing repository
content).
Field Summary |
---|
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
---|
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, workspaceName |
Fields inherited from class org.apache.jackrabbit.test.JUnitTest |
---|
log |
Constructor Summary | |
---|---|
SessionTest()
|
Method Summary | |
---|---|
void |
testHasPendingChanges()
Checks if Session.hasPendingChanges() works
properly.Procedure: Gets a session, checks inital flag setting Adds a node, checks flag Saves on session, checks flag Adds a property, checks flag Saves on session, checks flag Adds a child node, checks flag Saves on session, checks flag Removes child node, checks flag Saves on session, checks flag Removes property, checks flag Saves on session, checks flag Prerequisites: javax.jcr.tck.nodetype must accept
children of same nodetype javax.jcr.tck.propertyname1
must be the name of a String property that can be added to a node of type
set in javax.jcr.tck.nodetype |
void |
testMoveConstraintViolationExceptionDest()
Moves a node using , afterwards it tries to only save the destination parent
node.This should throw . |
void |
testMoveConstraintViolationExceptionSrc()
Moves a node using , afterwards it tries to only save the old parent node.This should throw . |
void |
testMoveItemExistsException()
Tries to move a node using to a location where a node already exists with
same name.Prerequisites: javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype2
must contain name of a nodetype that does not allow same name sibling
child nodes.
javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype3
must contain name of a valid nodetype that can be added as a child of
nodetype2
This should throw an . |
void |
testMoveLockException()
Calls
|
void |
testMoveNode()
Checks if works properly. |
void |
testMovePathNotFoundExceptionDestInvalid()
Calls
with invalid destination path.Should throw . |
void |
testMovePathNotFoundExceptionSrcInvalid()
Calls
|
void |
testMoveRepositoryException()
Calls with a destination path that has an index postfixed.This should throw an . |
void |
testRefreshBooleanFalse()
Checks if Session.refresh(boolean refresh) works
properly with refresh set to false .Procedure: Creates two nodes with session 1 Modifies node 1 with session 1 by adding a child node Get node 2 with session 2 Modifies node 2 with session 2 by adding a child node saves session 2 changes using Session.save() calls Session.refresh(false)
on session 1 Session 1 changes should be cleared and session 2
changes should now be visible to session 1. |
void |
testRefreshBooleanTrue()
Checks if Session.refresh(boolean refresh) works
properly with refresh set to true .Procedure: Creates two nodes with session 1 Modifies node 1 with session 1 by adding a child node Get node 2 with session 2 Modifies node 2 with session 2 by adding a child node saves session 2 changes using Session.save() calls Session.refresh(true)
on session 1 Session 1 changes and session 2 changes now be
visible to session 1. |
void |
testSaveContstraintViolationException()
Tries to create and save a node using Session.save()
with an mandatory property that is not set on saving time.Prerequisites: javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2
must reference a nodetype that has one at least one property that is
mandatory but not autocreated |
void |
testSaveInvalidStateException()
Tries to save a node using Session.save() that was
already deleted by an other session.Procedure: Creates a new node with session 1, saves it, adds a child node. Access new node with session 2,deletes the node, saves it. session 1 tries to save modifications . This should throw an InvalidItemStateException . |
void |
testSaveModifiedNode()
Checks if a modified node gets properly saved using .It creates a new node, saves it using session.save() , modifies the node by adding a child
node, saves again and finally verifies with a different session if
changes have been stored properly.Prerequisites: javax.jcr.tck.nodetype must accept children of same
nodetype |
void |
testSaveNewNode()
Checks if a newly created node gets properly saved using .It creates a new node, saves it using session.save() then uses a different session to
verify if the node has been properly saved. |
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest |
---|
cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureMultipleWorkspacesSupported, getNonExistingWorkspaceName, getProperty, getSize, isSupported, needsMixin, run, setUp, tearDown |
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 |
---|
public SessionTest()
Method Detail |
---|
public void testMoveItemExistsException() throws RepositoryException
Session.move(String src, String dest)
to a location where a node already exists with
same name.javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype2
must contain name of a nodetype that does not allow same name sibling
child nodes.javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype3
must contain name of a valid nodetype that can be added as a child of
nodetype2
ItemExistsException
.
RepositoryException
public void testMovePathNotFoundExceptionDestInvalid() throws RepositoryException
Session.move(String src, String dest)
with invalid destination path.PathNotFoundException
.
RepositoryException
public void testMovePathNotFoundExceptionSrcInvalid() throws RepositoryException
Session.move(String src, String dest)
with
invalid source path.
Should throw an PathNotFoundException
.
- Throws:
RepositoryException
public void testMoveRepositoryException() throws RepositoryException
Session.move(String src, String dest)
with a destination path that has an index postfixed.RepositoryException
.
RepositoryException
public void testMoveConstraintViolationExceptionSrc() throws RepositoryException
Session.move(String src, String dest)
, afterwards it tries to only save the old parent node.ConstraintViolationException
.
javax.jcr.tck.nodetype
must accept children of same nodetype
RepositoryException
public void testMoveConstraintViolationExceptionDest() throws RepositoryException
Session.move(String src, String dest)
, afterwards it tries to only save the destination parent
node.ConstraintViolationException
.
javax.jcr.tck.nodetype
must accept children of same nodetype
RepositoryException
public void testMoveLockException() throws NotExecutableException, RepositoryException
Session.move(String src, String dest)
where
the parent node of src is locked.
Should throw a LockException
immediately or on save.
- Throws:
NotExecutableException
RepositoryException
public void testMoveNode() throws RepositoryException
Session.move(String src, String dest)
works properly. To verify if node has been moved properly
it uses a second session to retrieve the moved node.
javax.jcr.tck.nodetype
must accept children of same nodetype
RepositoryException
public void testSaveNewNode() throws RepositoryException
Session.save()
.session.save()
then uses a different session to
verify if the node has been properly saved.
RepositoryException
public void testSaveModifiedNode() throws RepositoryException
Session.save()
.session.save()
, modifies the node by adding a child
node, saves again and finally verifies with a different session if
changes have been stored properly.javax.jcr.tck.nodetype
must accept children of same
nodetype
RepositoryException
public void testSaveContstraintViolationException() throws RepositoryException
Session.save()
with an mandatory property that is not set on saving time.javax.jcr.tck.SessionTest.testSaveContstraintViolationException.nodetype2
must reference a nodetype that has one at least one property that is
mandatory but not autocreated
RepositoryException
public void testSaveInvalidStateException() throws RepositoryException
Session.save()
that was
already deleted by an other session.InvalidItemStateException
. javax.jcr.tck.nodetype
must accept children of same
nodetype
RepositoryException
public void testRefreshBooleanFalse() throws RepositoryException
Session.refresh(boolean refresh)
works
properly with refresh
set to false
.Session.save()
Session.refresh(false)
on session 1javax.jcr.tck.nodetype
must accept children of same
nodetype
RepositoryException
public void testRefreshBooleanTrue() throws RepositoryException
Session.refresh(boolean refresh)
works
properly with refresh
set to true
.Session.save()
Session.refresh(true)
on session 1javax.jcr.tck.nodetype
must accept children of same
nodetype
RepositoryException
public void testHasPendingChanges() throws RepositoryException
Session.hasPendingChanges()
works
properly.javax.jcr.tck.nodetype
must accept
children of same nodetypejavax.jcr.tck.propertyname1
must be the name of a String property that can be added to a node of type
set in javax.jcr.tck.nodetype
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |