Class SaveTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.query.SaveTest
-
- All Implemented Interfaces:
junit.framework.Test
public class SaveTest extends AbstractJCRTest
Tests the methodQuery.storeAsNode(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 SaveTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setUp()
void
testConstraintViolationException()
Tests if aConstraintViolationException
is thrown if a query is stored under a node which does not allow child nodes.void
testItemExistsException()
Tests if anItemExistsException
is thrown when a query is stored on an existing node and same name siblings are not allowed.void
testLockException()
Tests if aLockException
is thrown if a query is stored under a node locked by anotherSession
.void
testPathNotFoundException()
Tests if aPathNotFoundException
is thrown when a query is stored to a non existent path.void
testRepositoryException()
Tests if the aRepositoryException
is thrown when an malformed path is passed inQuery.storeAsNode(String)
.void
testSave()
Stores aQuery.XPATH
query at:testRoot + "/" + nodeName1
.void
testVersionException()
Tests if aVersionException
is thrown when a query is stored under a checked in node.-
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, 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
-
setUp
protected void setUp() throws Exception
- Overrides:
setUp
in classAbstractJCRTest
- Throws:
Exception
-
testSave
public void testSave() throws RepositoryException, NotExecutableException
Stores aQuery.XPATH
query at:testRoot + "/" + nodeName1
.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testItemExistsException
public void testItemExistsException() throws RepositoryException, NotExecutableException
Tests if anItemExistsException
is thrown when a query is stored on an existing node and same name siblings are not allowed.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testPathNotFoundException
public void testPathNotFoundException() throws RepositoryException, NotExecutableException
Tests if aPathNotFoundException
is thrown when a query is stored to a non existent path.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testVersionException
public void testVersionException() throws RepositoryException, NotExecutableException
Tests if aVersionException
is thrown when a query is stored under a checked in node.The tests creates a node under
testRoot
with namenodeName1
and adds a mix:versionable mixin if the node is not already versionable. Then the test tries to store a query asnodeName2
under nodenodeName1
.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testConstraintViolationException
public void testConstraintViolationException() throws RepositoryException, NotExecutableException
Tests if aConstraintViolationException
is thrown if a query is stored under a node which does not allow child nodes.The test creates a node
nodeName1
of typetestNodeType
undertestRoot
. Then the test tries to store a query asnodeName2
undernodeName1
.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testLockException
public void testLockException() throws RepositoryException, NotExecutableException
Tests if aLockException
is thrown if a query is stored under a node locked by anotherSession
.The test creates a node
nodeName1
of typetestNodeType
undertestRoot
and locks the node with the superuser session. Then the test tries to store a query asnodeName2
undernodeName1
with the readWriteSession
.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
testRepositoryException
public void testRepositoryException() throws RepositoryException, NotExecutableException
Tests if the aRepositoryException
is thrown when an malformed path is passed inQuery.storeAsNode(String)
.- Throws:
NotExecutableException
- if nt:query is not supported.RepositoryException
-
-