org.alfresco.repo.avm
Class AVMServicePermissionsTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.alfresco.repo.avm.AVMServicePermissionsTest
All Implemented Interfaces:
junit.framework.Test

public class AVMServicePermissionsTest
extends junit.framework.TestCase

Specifically test AVM permissions with the updated ACL schema


Field Summary
protected  AuthenticationComponent authenticationComponent
           
protected  MutableAuthenticationService authenticationService
           
protected  AuthorityService authorityService
           
protected  org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
           
protected  org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver
           
protected  org.alfresco.service.cmr.repository.NodeService nodeService
           
protected  ModelDAO permissionModelDAO
           
protected  PermissionServiceSPI permissionService
           
protected  PersonService personService
           
protected  org.alfresco.service.cmr.repository.NodeRef rootNodeRef
           
protected  ServiceRegistry serviceRegistry
           
protected  org.springframework.orm.hibernate3.LocalSessionFactoryBean sessionFactory
           
protected  org.alfresco.service.cmr.repository.NodeRef systemNodeRef
           
 
Constructor Summary
AVMServicePermissionsTest()
           
 
Method Summary
 boolean checkHasPermission(java.lang.String user, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String permission, boolean allowed)
           
protected  PermissionReference getPermission(java.lang.String permission)
           
protected  void recursiveList(java.lang.String store)
          Helper to write a recursive listing of latest version of an AVMStore.
protected  java.lang.String recursiveList(java.lang.String repoName, int version, boolean followLinks)
          Helper to write a recursive listing of an AVMStore at a given version.
protected  java.lang.String recursiveList(java.lang.String path, int version, int indent, boolean followLinks)
          Recursive list the given path.
protected  void runAs(java.lang.String userName)
           
protected  void setUp()
           
protected  void tearDown()
           
 void test_ETWOTWO_457_NPE1()
           
 void test_ETWOTWO_457_NPE2()
           
 void test_ETWOTWO_457_NPE3()
           
 void testBranches()
           
 void testComplexStore_AddPermissionsToBottom()
           
 void testComplexStore_AddPermissionsToMiddle()
           
 void testComplexStore_AlterInheritance()
           
 void testCopy()
           
 void testMutationsWithSimpleLayers()
           
 void testRedirectLayeredDirectory()
           
 void testRenamePlainDirectory()
           
 void testRenamePlainDirectoryIntoLayer()
           
 void testRenamePlainFile()
           
 void testRenamePlainFileIntoLayer()
           
 void testSetInheritParentPermissions()
           
 void testSetup()
           
 void testSimpleDirectoryPermissionDiff0()
           
 void testSimpleDirectoryPermissionDiff1()
           
 void testSimpleDirectoryPermissionDiff2()
           
 void testSimpleDirectoryPermissionDiff3()
           
 void testSimpleDirectoryPermissionDiff4()
           
 void testSimpleDirectoryPermissionDiff5()
           
 void testSimpleDirectoryPermissionDiff6()
           
 void testSimpleExternalLayer()
           
 void testSimpleFilePermissionDiff()
           
 void testSimpleUpdate()
           
 void testStoreAcls()
           
 void testUpdateWithPermissions()
           
 void testWCMStyleTemplateAsBranch()
           
 void x_testSimpleInternalLayer()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeService

protected org.alfresco.service.cmr.repository.NodeService nodeService

dictionaryService

protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService

permissionService

protected PermissionServiceSPI permissionService

authenticationService

protected MutableAuthenticationService authenticationService

sessionFactory

protected org.springframework.orm.hibernate3.LocalSessionFactoryBean sessionFactory

rootNodeRef

protected org.alfresco.service.cmr.repository.NodeRef rootNodeRef

namespacePrefixResolver

protected org.alfresco.service.namespace.NamespacePrefixResolver namespacePrefixResolver

serviceRegistry

protected ServiceRegistry serviceRegistry

systemNodeRef

protected org.alfresco.service.cmr.repository.NodeRef systemNodeRef

authenticationComponent

protected AuthenticationComponent authenticationComponent

permissionModelDAO

protected ModelDAO permissionModelDAO

personService

protected PersonService personService

authorityService

protected AuthorityService authorityService
Constructor Detail

AVMServicePermissionsTest

public AVMServicePermissionsTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

runAs

protected void runAs(java.lang.String userName)

getPermission

protected PermissionReference getPermission(java.lang.String permission)

checkHasPermission

public boolean checkHasPermission(java.lang.String user,
                                  org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                  java.lang.String permission,
                                  boolean allowed)

testSetup

public void testSetup()
               throws java.lang.Exception
Throws:
java.lang.Exception

test_ETWOTWO_457_NPE1

public void test_ETWOTWO_457_NPE1()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_ETWOTWO_457_NPE2

public void test_ETWOTWO_457_NPE2()
                           throws java.lang.Exception
Throws:
java.lang.Exception

test_ETWOTWO_457_NPE3

public void test_ETWOTWO_457_NPE3()
                           throws java.lang.Exception
Throws:
java.lang.Exception

testStoreAcls

public void testStoreAcls()
                   throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleUpdate

public void testSimpleUpdate()
                      throws java.lang.Throwable
Throws:
java.lang.Throwable

testUpdateWithPermissions

public void testUpdateWithPermissions()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testComplexStore_AlterInheritance

public void testComplexStore_AlterInheritance()
                                       throws java.io.IOException
Throws:
java.io.IOException

testComplexStore_AddPermissionsToMiddle

public void testComplexStore_AddPermissionsToMiddle()
                                             throws java.io.IOException
Throws:
java.io.IOException

testComplexStore_AddPermissionsToBottom

public void testComplexStore_AddPermissionsToBottom()
                                             throws java.io.IOException
Throws:
java.io.IOException

testSimpleFilePermissionDiff

public void testSimpleFilePermissionDiff()
                                  throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff0

public void testSimpleDirectoryPermissionDiff0()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff1

public void testSimpleDirectoryPermissionDiff1()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff2

public void testSimpleDirectoryPermissionDiff2()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff3

public void testSimpleDirectoryPermissionDiff3()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff4

public void testSimpleDirectoryPermissionDiff4()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff5

public void testSimpleDirectoryPermissionDiff5()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testSimpleDirectoryPermissionDiff6

public void testSimpleDirectoryPermissionDiff6()
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

testRedirectLayeredDirectory

public void testRedirectLayeredDirectory()
                                  throws java.io.IOException
Throws:
java.io.IOException

testCopy

public void testCopy()

testBranches

public void testBranches()

testWCMStyleTemplateAsBranch

public void testWCMStyleTemplateAsBranch()

testSimpleExternalLayer

public void testSimpleExternalLayer()
                             throws java.lang.Exception
Throws:
java.lang.Exception

x_testSimpleInternalLayer

public void x_testSimpleInternalLayer()
                               throws java.io.IOException
Throws:
java.io.IOException

testMutationsWithSimpleLayers

public void testMutationsWithSimpleLayers()
                                   throws java.io.IOException
Throws:
java.io.IOException

testRenamePlainDirectory

public void testRenamePlainDirectory()

testRenamePlainFile

public void testRenamePlainFile()
                         throws java.io.IOException
Throws:
java.io.IOException

testRenamePlainDirectoryIntoLayer

public void testRenamePlainDirectoryIntoLayer()

testRenamePlainFileIntoLayer

public void testRenamePlainFileIntoLayer()
                                  throws java.io.IOException
Throws:
java.io.IOException

recursiveList

protected void recursiveList(java.lang.String store)
Helper to write a recursive listing of latest version of an AVMStore.

Parameters:
repoName - The name of the AVMStore.

recursiveList

protected java.lang.String recursiveList(java.lang.String repoName,
                                         int version,
                                         boolean followLinks)
Helper to write a recursive listing of an AVMStore at a given version.

Parameters:
repoName - The name of the AVMStore.
version - The version to look under.

recursiveList

protected java.lang.String recursiveList(java.lang.String path,
                                         int version,
                                         int indent,
                                         boolean followLinks)
Recursive list the given path.

Parameters:
path - The path.
version - The version.
indent - The current indent level.

testSetInheritParentPermissions

public void testSetInheritParentPermissions()
                                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.