mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
16780: Fix failing unit test - HeartBeat now needs to be constructed inside a transaction. 16765: Merged DEV/BELARUS/V3.2-2009_10_05 to V3.2 16754: ETHREEOH-2534: SPP does not authenticate when authentication chain contains both alfrescoNtlm and passthru types. - NTLM Authentication handler for Sharepoint module was implemented as singleton. But after it was integrated into Alfresco Authentication Subsystem, instance of this object is created for each type of NTLM authentication. As result static field with NTLM flags was rewrited for each instance. Bug was resolved by removing static indicator. 16751: LDAP sync improvements - Correction to the way retried transactional errors are reported - Addition of unit test for synchronization with a mock user registry generating a large volume of users, groups and associations 16749: Removed UserUsageBootstrapJob from scheduled jobs and moved UserUsageTrackingComponent to bootstrap - files missed from CHK-9619 16748: User Usage Tracking Component bootstrapped synchronously to avoid its expensive queries across all users 'stepping on top of' other bootstrap activity such as LDAP synchronization - Its startup messages are no longer masked out by log4j.properties - Logged ETHREEOH-3009 regarding upgrade impact of new faster queries 16747: Lower impact of HeartBeat service on server performance - More efficient AuthorityService APIs used to determine the total number of groups and users more efficiently - Queries of all users and groups done synchronously at startup only 16746: Improvements for faster user and group lookup and association on a large repository (unfortunately intertwined) - NodeService getChildAssocRefsByTypeQNames query rewritten to use a subquery to force a more logical evaluation order on MySQL - NodeService getChildAssocs method made to use more efficient getChildAssocRefsByTypeQNames DAO call when a type qname but no assoc qname is specified - NodeService getUsersWithoutUsage / getUsersWithUsage queries rewritten to avoid an expensive outer join on all users - PersonService getPersonIgnoreCase query corrected to include the type QName ID of the child associations it is querying (thus avoiding unnecessarily triggering duplicate person removal) - PersonService now supports an optional boolean argument to getPerson that indicates whether the auto-create + home folder creation behaviour should be triggered. - AuthorityDAOImpl now uses false argument to getPerson call to avoid lazy home folder creation during creation of group associations - AuthorityDAOImpl now specifies assoc type to getChildAssocs in getAllAuthoritiesInZone and findAuthorities calls so that the more efficient query variant is used - Redundant personExists() call removed from authorityServiceImpl git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16914 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -405,6 +405,31 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
tearDownTestUsersAndGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests synchronization of group associations in a zone with a larger volume of authorities.
|
||||
*
|
||||
* @throws Exception
|
||||
* the exception
|
||||
*/
|
||||
public void dontTestAssocs() throws Exception
|
||||
{
|
||||
this.retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
List<NodeDescription> groups = new ArrayList<NodeDescription>(new RandomGroupCollection(1000,
|
||||
ChainingUserRegistrySynchronizerTest.this.authorityService.getAllAuthoritiesInZone(
|
||||
AuthorityService.ZONE_AUTH_EXT_PREFIX + "Z0", null)));
|
||||
ChainingUserRegistrySynchronizerTest.this.applicationContextManager
|
||||
.setUserRegistries(new MockUserRegistry("Z0", Collections.<NodeDescription> emptyList(), groups));
|
||||
;
|
||||
ChainingUserRegistrySynchronizerTest.this.synchronizer.synchronize(true, true);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tearDownTestUsersAndGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a description of a test group.
|
||||
*
|
||||
@@ -719,12 +744,12 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
|
||||
public boolean hasNext()
|
||||
{
|
||||
return pos < size;
|
||||
return this.pos < RandomPersonCollection.this.size;
|
||||
}
|
||||
|
||||
public NodeDescription next()
|
||||
{
|
||||
pos++;
|
||||
this.pos++;
|
||||
return newPerson("U" + GUID.generate());
|
||||
}
|
||||
|
||||
@@ -743,7 +768,7 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
@Override
|
||||
public int size()
|
||||
{
|
||||
return size;
|
||||
return this.size;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -758,21 +783,39 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
/** The collection size. */
|
||||
private final int size;
|
||||
|
||||
/** The persons. */
|
||||
private final List<NodeDescription> persons;
|
||||
/** The authorities. */
|
||||
private final List<String> authorities;
|
||||
|
||||
/**
|
||||
* The Constructor.
|
||||
*
|
||||
* @param size
|
||||
* the collection size
|
||||
* @param persons
|
||||
* the persons
|
||||
* @param authorities
|
||||
* the authorities
|
||||
*/
|
||||
public RandomGroupCollection(int size, List<NodeDescription> persons)
|
||||
public RandomGroupCollection(int size, Set<String> authorities)
|
||||
{
|
||||
this.size = size;
|
||||
this.persons = persons;
|
||||
this.authorities = new ArrayList<String>(authorities);
|
||||
}
|
||||
|
||||
/**
|
||||
* The Constructor.
|
||||
*
|
||||
* @param size
|
||||
* the collection size
|
||||
* @param authorities
|
||||
* the authorities
|
||||
*/
|
||||
public RandomGroupCollection(int size, Collection<NodeDescription> persons)
|
||||
{
|
||||
this.size = size;
|
||||
this.authorities = new ArrayList<String>(persons.size());
|
||||
for (NodeDescription nodeDescription : persons)
|
||||
{
|
||||
this.authorities.add((String) nodeDescription.getProperties().get(ContentModel.PROP_USERNAME));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -789,19 +832,21 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
|
||||
public boolean hasNext()
|
||||
{
|
||||
return pos < size;
|
||||
return this.pos < RandomGroupCollection.this.size;
|
||||
}
|
||||
|
||||
public NodeDescription next()
|
||||
{
|
||||
pos++;
|
||||
String[] personNames = new String[10];
|
||||
for (int i = 0; i < personNames.length; i++)
|
||||
this.pos++;
|
||||
String[] authorityNames = new String[17];
|
||||
for (int i = 0; i < authorityNames.length; i++)
|
||||
{
|
||||
personNames[i] = (String) persons.get((int) (Math.random() * (double) (persons.size() - 1)))
|
||||
.getProperties().get(ContentModel.PROP_USERNAME);
|
||||
authorityNames[i] = ChainingUserRegistrySynchronizerTest.this.authorityService
|
||||
.getShortName((String) RandomGroupCollection.this.authorities
|
||||
.get((int) (Math.random() * (double) (RandomGroupCollection.this.authorities
|
||||
.size() - 1))));
|
||||
}
|
||||
return newGroup("G" + GUID.generate(), personNames);
|
||||
return newGroup("G" + GUID.generate(), authorityNames);
|
||||
}
|
||||
|
||||
public void remove()
|
||||
@@ -819,7 +864,7 @@ public class ChainingUserRegistrySynchronizerTest extends TestCase
|
||||
@Override
|
||||
public int size()
|
||||
{
|
||||
return size;
|
||||
return this.size;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user