org.apache.jackrabbit.test.api
Class SetPropertyAssumeTypeTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.jackrabbit.test.JUnitTest
              extended byorg.apache.jackrabbit.test.AbstractJCRTest
                  extended byorg.apache.jackrabbit.test.api.SetPropertyAssumeTypeTest
All Implemented Interfaces:
junit.framework.Test

public class SetPropertyAssumeTypeTest
extends AbstractJCRTest

SetPropertyAssumeTypeTest tests if when setting a property of type PropertyType.UNDEFINED the type is assumed correctly. The signatures Node.setProperty(String, Value, int), Node.setProperty(String, String, int), Node.setProperty(String, Value[], int) and Node.setProperty(String, Node) are tested.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, 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, testPath, testRoot, testRootNode, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
SetPropertyAssumeTypeTest()
           
 
Method Summary
 void setUp()
           
 void testNodeAssumeTypeOfValue()
          Tests if Node.setProperty(String, Node) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.
 void testString()
          Tests if Node.setProperty(String, String, int) if the node type of this node does not indicate a specific property type, then the type parameter is used.
 void testStringConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
          Tests if Node.setProperty(String, String, int) throws a ConstraintViolationException if the type parameter and the type of the property do not match.
 void testValue()
          Tests if Node.setProperty(String, Value, int) if the node type of this node does not indicate a specific property type, then the type parameter is used.
 void testValueAssumeTypeOfValue()
          Tests if Node.setProperty(String, Value) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.
 void testValueConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
          Tests if Node.setProperty(String, Value, int) throws a ConstraintViolationException if the type parameter and the type of the property do not match.
 void testValues()
          Tests if Node.setProperty(String, Value[], int) if the node type of this node does not indicate a specific property type, then the type parameter is used.
 void testValuesAssumeTypeOfValue()
          Tests if Node.setProperty(String, Value[]) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.
 void testValuesConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
          Tests if Node.setProperty(String, Value[], int) throws a ConstraintViolationException if the type parameter and the type of the property do not match.
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
createRandomString, getNonExistingWorkspaceName, getProperty, getSize, run, 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

SetPropertyAssumeTypeTest

public SetPropertyAssumeTypeTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Overrides:
setUp in class AbstractJCRTest
Throws:
java.lang.Exception

testValue

public void testValue()
               throws NotExecutableException,
                      javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value, int) if the node type of this node does not indicate a specific property type, then the type parameter is used.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testValues

public void testValues()
                throws NotExecutableException,
                       javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value[], int) if the node type of this node does not indicate a specific property type, then the type parameter is used.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testString

public void testString()
                throws NotExecutableException,
                       javax.jcr.RepositoryException
Tests if Node.setProperty(String, String, int) if the node type of this node does not indicate a specific property type, then the type parameter is used.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testValueAssumeTypeOfValue

public void testValueAssumeTypeOfValue()
                                throws NotExecutableException,
                                       javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testNodeAssumeTypeOfValue

public void testNodeAssumeTypeOfValue()
                               throws NotExecutableException,
                                      javax.jcr.RepositoryException
Tests if Node.setProperty(String, Node) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testValuesAssumeTypeOfValue

public void testValuesAssumeTypeOfValue()
                                 throws NotExecutableException,
                                        javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value[]) if the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists (has previously been set) it assumes the new property type.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testValueConstraintVioloationExceptionBecauseOfInvalidTypeParameter

public void testValueConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
                                                                         throws NotExecutableException,
                                                                                javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value, int) throws a ConstraintViolationException if the type parameter and the type of the property do not match. The exception has to be thrown either immediately (by this method) or on save.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testStringConstraintVioloationExceptionBecauseOfInvalidTypeParameter

public void testStringConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
                                                                          throws NotExecutableException,
                                                                                 javax.jcr.RepositoryException
Tests if Node.setProperty(String, String, int) throws a ConstraintViolationException if the type parameter and the type of the property do not match. The exception has to be thrown either immediately (by this method) or on save.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testValuesConstraintVioloationExceptionBecauseOfInvalidTypeParameter

public void testValuesConstraintVioloationExceptionBecauseOfInvalidTypeParameter()
                                                                          throws NotExecutableException,
                                                                                 javax.jcr.RepositoryException
Tests if Node.setProperty(String, Value[], int) throws a ConstraintViolationException if the type parameter and the type of the property do not match. The exception has to be thrown either immediately (by this method) or on save.

Throws:
NotExecutableException
javax.jcr.RepositoryException


Copyright © -2005 . All Rights Reserved.