org.opencms.file
Class TestProperty

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opencms.test.OpenCmsTestCase
              extended by org.opencms.file.TestProperty
All Implemented Interfaces:
junit.framework.Test

public class TestProperty
extends OpenCmsTestCase

Unit test for the "writeProperty" method of the CmsObject.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.opencms.test.OpenCmsTestCase
OpenCmsTestCase.ConnectionData
 
Field Summary
 
Fields inherited from class org.opencms.test.OpenCmsTestCase
ARTICLE_TYPEID, DB_MYSQL, DB_ORACLE, m_additionalConnection, m_configuration, m_currentResourceStrorage, m_defaultConnection, m_defaultTablespace, m_indexTablespace, m_resourceStorages, m_setupConnection, m_tempTablespace
 
Constructor Summary
TestProperty(String arg0)
          Default JUnit constructor.
 
Method Summary
static void createProperties(OpenCmsTestCase tc, CmsObject cms, String resource1, List propertyList1)
          Test the writeProperty method to create a list of properties.
static void createProperty(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsProperty property1)
          Test the writeProperty method to create one property.
static void removeProperties(OpenCmsTestCase tc, CmsObject cms, String resource1, List propertyList1)
          Test the writeProperty method to remove a list of properties.
static void removeProperty(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsProperty property1)
          Test the writeProperty method to remove one property.
static junit.framework.Test suite()
          Test suite for this test class.
 void testCaseSensitiveProperties()
          Tests the proper behaviour for case sensitiveness in property definition names.
 void testCreateProperties()
          Tests the writePropertyObjects method for removing of properties.
 void testCreateProperty()
          Tests the writePropertyObject method for removing of properties.
 void testDefaultPropertyCreation()
          Test default property creation (from resource type configuration).
 void testFrozenProperty()
          Tests changing the values of a frozen property.
 void testNullProperty()
          Tests the NULL_PROPERTY.
 void testPropertyLists()
          Tests reading and writing property lists.
 void testPropertyMaps()
          Tests reading and writing property maps.
 void testReadResourcesWithProperty()
          Tests the writePropertyObject method for writing of a property on a folder.
 void testRemoveProperties()
          Tests the writePropertyObjects method for removing of multiple properties.
 void testRemoveProperty()
          Tests the writePropertyObject method for removing of a single property.
 void testSharedPropertyIssue1()
          Tests an issue with shared properties after deletion of the original sibling.
 void testWriteProperties()
          Tests the writeProperties method.
 void testWriteProperty()
          Tests the writePropertyObject method.
 void testWritePropertyOnFolder()
          Tests the writePropertyObject method for writing of a property on a folder.
static void writeProperties(OpenCmsTestCase tc, CmsObject cms, String resource1, List propertyList1)
          Test the writeProperty method with a list of properties.
static void writeProperty(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsProperty property1)
          Test the writeProperty method with one property.
 
Methods inherited from class org.opencms.test.OpenCmsTestCase
addTestDataPath, assertAce, assertAcl, assertAcl, assertContains, assertContainsNot, assertContent, assertDateContent, assertDateContentAfter, assertDateCreated, assertDateCreatedAfter, assertDateExpired, assertDateLastModified, assertDateLastModifiedAfter, assertDateReleased, assertEquals, assertEquals, assertEquals, assertFilter, assertFilter, assertFilter, assertFilter, assertFlags, assertHistory, assertHistoryForRestored, assertIsFolder, assertIsIdentical, assertIsNotIdentical, assertLock, assertLock, assertLock, assertModifiedInCurrentProject, assertPermissionString, assertProject, assertPropertyChanged, assertPropertyChanged, assertPropertydefinitionExist, assertPropertydefinitions, assertPropertyEqual, assertPropertyNew, assertPropertyNew, assertPropertyRemoved, assertPropertyRemoved, assertRelation, assertResourceId, assertResourceType, assertSiblingCount, assertSiblingCountIncremented, assertState, assertStructureId, assertType, assertUserCreated, assertUserLastModified, assertVersion, checkErrors, createStorage, deleteFile, echo, generateContent, generateContent, generateName, generateProperties, generateResources, generateSetupTestWrapper, generateUsers, getCmsObject, getConnectionName, getDatabaseProduct, getDbProduct, getPreCalculatedState, getReplacer, getSetupDataPath, getSetupDb, getTestDataPath, importData, importResources, importTestResource, initTestDataPath, removeDatabase, removeDatabase, removeOpenCms, removeStorage, resetMapping, restart, restartOpenCms, setMapping, setupDatabase, setupDatabase, setupOpenCms, setupOpenCms, setupOpenCms, setupOpenCms, setupOpenCms, storeResources, storeResources, switchStorage
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

TestProperty

public TestProperty(String arg0)
Default JUnit constructor.

Parameters:
arg0 - JUnit parameters
Method Detail

suite

public static junit.framework.Test suite()
Test suite for this test class.

Returns:
the test suite

testPropertyLists

public void testPropertyLists()
                       throws Exception
Tests reading and writing property lists.

Throws:
Exception - if the test fails

testPropertyMaps

public void testPropertyMaps()
                      throws Exception
Tests reading and writing property maps.

Throws:
Exception - if the test fails

createProperties

public static void createProperties(OpenCmsTestCase tc,
                                    CmsObject cms,
                                    String resource1,
                                    List propertyList1)
                             throws Throwable
Test the writeProperty method to create a list of properties.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to create the properies
propertyList1 - the properties to create
Throws:
Throwable - if something goes wrong

createProperty

public static void createProperty(OpenCmsTestCase tc,
                                  CmsObject cms,
                                  String resource1,
                                  CmsProperty property1)
                           throws Throwable
Test the writeProperty method to create one property.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to add a propery
property1 - the property to create
Throws:
Throwable - if something goes wrong

removeProperties

public static void removeProperties(OpenCmsTestCase tc,
                                    CmsObject cms,
                                    String resource1,
                                    List propertyList1)
                             throws Throwable
Test the writeProperty method to remove a list of properties.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to remove the properies
propertyList1 - the properties to remove
Throws:
Throwable - if something goes wrong

removeProperty

public static void removeProperty(OpenCmsTestCase tc,
                                  CmsObject cms,
                                  String resource1,
                                  CmsProperty property1)
                           throws Throwable
Test the writeProperty method to remove one property.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to remove a propery
property1 - the property to remove
Throws:
Throwable - if something goes wrong

writeProperties

public static void writeProperties(OpenCmsTestCase tc,
                                   CmsObject cms,
                                   String resource1,
                                   List propertyList1)
                            throws Throwable
Test the writeProperty method with a list of properties.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to write the properies
propertyList1 - the properties to write
Throws:
Throwable - if something goes wrong

writeProperty

public static void writeProperty(OpenCmsTestCase tc,
                                 CmsObject cms,
                                 String resource1,
                                 CmsProperty property1)
                          throws Throwable
Test the writeProperty method with one property.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to write a propery
property1 - the property to write
Throws:
Throwable - if something goes wrong

testCreateProperties

public void testCreateProperties()
                          throws Throwable
Tests the writePropertyObjects method for removing of properties.

Throws:
Throwable - if something goes wrong

testCaseSensitiveProperties

public void testCaseSensitiveProperties()
                                 throws Throwable
Tests the proper behaviour for case sensitiveness in property definition names.

Throws:
Throwable - if something goes wrong

testCreateProperty

public void testCreateProperty()
                        throws Throwable
Tests the writePropertyObject method for removing of properties.

Throws:
Throwable - if something goes wrong

testRemoveProperties

public void testRemoveProperties()
                          throws Throwable
Tests the writePropertyObjects method for removing of multiple properties.

Throws:
Throwable - if something goes wrong

testRemoveProperty

public void testRemoveProperty()
                        throws Throwable
Tests the writePropertyObject method for removing of a single property.

Throws:
Throwable - if something goes wrong

testWriteProperties

public void testWriteProperties()
                         throws Throwable
Tests the writeProperties method.

Throws:
Throwable - if something goes wrong

testWriteProperty

public void testWriteProperty()
                       throws Throwable
Tests the writePropertyObject method.

Throws:
Throwable - if something goes wrong

testWritePropertyOnFolder

public void testWritePropertyOnFolder()
                               throws Throwable
Tests the writePropertyObject method for writing of a property on a folder.

Throws:
Throwable - if something goes wrong

testReadResourcesWithProperty

public void testReadResourcesWithProperty()
                                   throws Throwable
Tests the writePropertyObject method for writing of a property on a folder.

Throws:
Throwable - if something goes wrong

testDefaultPropertyCreation

public void testDefaultPropertyCreation()
                                 throws Throwable
Test default property creation (from resource type configuration).

Throws:
Throwable - if something goes wrong

testSharedPropertyIssue1

public void testSharedPropertyIssue1()
                              throws Throwable
Tests an issue with shared properties after deletion of the original sibling.

Scenario: A file A has property P set with value V as shared property. Now A is renamed to B. Then B is published directly with all siblings (A is now deleted and removed). Issue: Property P is now empty in B, but should still have the V value.

Throws:
Throwable - if something goes wrong

testNullProperty

public void testNullProperty()
                      throws Exception
Tests the NULL_PROPERTY.

Throws:
Exception - if the test fails

testFrozenProperty

public void testFrozenProperty()
                        throws Throwable
Tests changing the values of a frozen property.

Throws:
Throwable - if something goes wrong