org.alfresco.repo.security.sync
Class ChainingUserRegistrySynchronizerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizerTest
All Implemented Interfaces:
junit.framework.Test

public class ChainingUserRegistrySynchronizerTest
extends junit.framework.TestCase

Tests the ChainingUserRegistrySynchronizer using a simulated ChainingUserRegistrySynchronizerTest.MockUserRegistry.


Nested Class Summary
static class ChainingUserRegistrySynchronizerTest.MockApplicationContextManager
          An ChildApplicationContextManager for a chain of application contexts containing mock user registries.
static class ChainingUserRegistrySynchronizerTest.MockUserRegistry
          A Mock UserRegistry that returns a fixed set of users and groups.
 class ChainingUserRegistrySynchronizerTest.RandomGroupCollection
          A collection whose iterator returns randomly generated groups with random associations to a given list of persons.
 class ChainingUserRegistrySynchronizerTest.RandomPersonCollection
          A collection whose iterator returns randomly generated persons.
 
Constructor Summary
ChainingUserRegistrySynchronizerTest()
           
 
Method Summary
 void dontTestAssocs()
          Tests synchronization of group associations in a zone with a larger volume of authorities.
protected  void setUp()
           
protected  void tearDown()
           
 void tearDownTestUsersAndGroups()
          Tear down test users and groups.
 void testCaseChange()
          Tests a forced update of the test users and groups where some of the users change their case and some groups appear with different case.
 void testDifferentialUpdate()
          Tests a differential update of the test users and groups.
 void testForcedUpdate()
          Tests a forced update of the test users and groups.
 void testVolume()
          Tests synchronization with a zone with a larger volume of authorities.
 
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
 

Constructor Detail

ChainingUserRegistrySynchronizerTest

public ChainingUserRegistrySynchronizerTest()
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

tearDownTestUsersAndGroups

public void tearDownTestUsersAndGroups()
                                throws java.lang.Exception
Tear down test users and groups.

Throws:
java.lang.Exception - the exception

testDifferentialUpdate

public void testDifferentialUpdate()
                            throws java.lang.Exception
Tests a differential update of the test users and groups. The layout is as follows
 Z1
 G2 - U1, G1 - U1, U6
 G3 - U2, G4, G5 - U6
 
 Z2
 G2 - U1, U3, U4, U6
 G6 - U3, U4, G7, G8 - U4, U8
 

Throws:
java.lang.Exception - the exception

testForcedUpdate

public void testForcedUpdate()
                      throws java.lang.Exception
Tests a forced update of the test users and groups. Also tests that groups and users that previously existed in Z2 get moved when they appear in Z1. Also tests that 'dangling references' to removed users (U4, U5) do not cause any problems. Also tests that case-sensitivity is not a problem when an occluded user is recreated with different case. The layout is as follows
 Z1
 G1 - U6
 G3 - U2, G5 - U6, G2 - G1
 G6 - u3
 
 Z2
 G2 - U1
 G6 - U3, G7
 G8 - U1, U8
 

Throws:
java.lang.Exception - the exception

testCaseChange

public void testCaseChange()
                    throws java.lang.Exception
Tests a forced update of the test users and groups where some of the users change their case and some groups appear with different case.

Throws:
java.lang.Exception

testVolume

public void testVolume()
                throws java.lang.Exception
Tests synchronization with a zone with a larger volume of authorities.

Throws:
java.lang.Exception - the exception

dontTestAssocs

public void dontTestAssocs()
                    throws java.lang.Exception
Tests synchronization of group associations in a zone with a larger volume of authorities.

Throws:
java.lang.Exception - the exception


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