org.opencms.file
Class TestChacc

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

public class TestChacc
extends OpenCmsTestCase

Unit test for the "chacc" 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
TestChacc(String arg0)
          Default JUnit constructor.
 
Method Summary
static void chaccFileGroup(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsGroup group, CmsPermissionSet permissions, int flags)
          Test the chacc method on a file and a group.
static void chaccFileUser(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsUser user, CmsPermissionSet permissions, int flags)
          Test the chacc method on a file and a user.
static void chaccFolderGroup(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsGroup group, CmsPermissionSet permissions, int flags)
          Test the chacc method on a file and a group.
static junit.framework.Test suite()
          Test suite for this test class.
 void testChaccAddRemove()
          Test the creation and deletion of access control entries and checks permissions of a test user.
 void testChaccFileAllOthers()
          Test the chacc method for the special 'all others' principal.
 void testChaccFileGroup()
          Test the chacc method on a file and a group.
 void testChaccFileOverwriteAll()
          Test the chacc method for the special 'overwrite all' principal.
 void testChaccFileUser()
          Test the chacc method on a file and a user.
 void testChaccFolderGroup()
          Test the chacc method on a folder and a group.
 
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

TestChacc

public TestChacc(String arg0)
Default JUnit constructor.

Parameters:
arg0 - JUnit parameters
Method Detail

chaccFileGroup

public static void chaccFileGroup(OpenCmsTestCase tc,
                                  CmsObject cms,
                                  String resource1,
                                  CmsGroup group,
                                  CmsPermissionSet permissions,
                                  int flags)
                           throws Throwable
Test the chacc method on a file and a group.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to change permissions
group - the group to change the permissions from
permissions - the new permission set for this group
flags - the flags for modifying the permission set
Throws:
Throwable - if something goes wrong

chaccFileUser

public static void chaccFileUser(OpenCmsTestCase tc,
                                 CmsObject cms,
                                 String resource1,
                                 CmsUser user,
                                 CmsPermissionSet permissions,
                                 int flags)
                          throws Throwable
Test the chacc method on a file and a user.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to change permissions
user - the user to change the permissions from
permissions - the new permission set for this group
flags - the flags for modifying the permission set
Throws:
Throwable - if something goes wrong

chaccFolderGroup

public static void chaccFolderGroup(OpenCmsTestCase tc,
                                    CmsObject cms,
                                    String resource1,
                                    CmsGroup group,
                                    CmsPermissionSet permissions,
                                    int flags)
                             throws Throwable
Test the chacc method on a file and a group.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to change permissions
group - the group to change the permissions from
permissions - the new permission set for this group
flags - the flags for modifying the permission set
Throws:
Throwable - if something goes wrong

suite

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

Returns:
the test suite

testChaccAddRemove

public void testChaccAddRemove()
                        throws Throwable
Test the creation and deletion of access control entries and checks permissions of a test user.

Throws:
Throwable - if something goes wrong

testChaccFileAllOthers

public void testChaccFileAllOthers()
                            throws Throwable
Test the chacc method for the special 'all others' principal.

Throws:
Throwable - if something goes wrong

testChaccFileGroup

public void testChaccFileGroup()
                        throws Throwable
Test the chacc method on a file and a group.

Throws:
Throwable - if something goes wrong

testChaccFileOverwriteAll

public void testChaccFileOverwriteAll()
                               throws Throwable
Test the chacc method for the special 'overwrite all' principal.

Throws:
Throwable - if something goes wrong

testChaccFileUser

public void testChaccFileUser()
                       throws Throwable
Test the chacc method on a file and a user.

Throws:
Throwable - if something goes wrong

testChaccFolderGroup

public void testChaccFolderGroup()
                          throws Throwable
Test the chacc method on a folder and a group.

Throws:
Throwable - if something goes wrong