mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Guest fixes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -425,7 +425,6 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing
|
||||
// TODO: Refactor and use the authentication service for this.
|
||||
User user = (User) auth.getPrincipal();
|
||||
auths.add(user.getUsername());
|
||||
auths.add(getAllAuthorities());
|
||||
for (GrantedAuthority authority : auth.getAuthorities())
|
||||
{
|
||||
auths.add(authority.getAuthority());
|
||||
|
@@ -65,6 +65,51 @@ public class PersonTest extends BaseSpringTest
|
||||
flushAndClear();
|
||||
}
|
||||
|
||||
public void xtestPerformance()
|
||||
{
|
||||
personService.setCreateMissingPeople(false);
|
||||
|
||||
personService.createPerson(createDefaultProperties("derek", "Derek", "Hulley", "dh@dh",
|
||||
"alfresco", rootNodeRef));
|
||||
|
||||
|
||||
|
||||
long create = 0;
|
||||
long count = 0;
|
||||
|
||||
long start;
|
||||
long end;
|
||||
|
||||
for(int i = 0; i < 10000; i++)
|
||||
{
|
||||
String id = "TestUser-"+i;
|
||||
start = System.nanoTime();
|
||||
personService.createPerson(createDefaultProperties(id, id, id, id,
|
||||
id, rootNodeRef));
|
||||
end = System.nanoTime();
|
||||
create += (end - start);
|
||||
|
||||
if((i > 0) && (i % 100 == 0))
|
||||
{
|
||||
System.out.println("Count = "+i);
|
||||
System.out.println("Average create : "+(create/i/1000000.0f));
|
||||
start = System.nanoTime();
|
||||
personService.personExists(id);
|
||||
end = System.nanoTime();
|
||||
System.out.println("Exists : "+((end-start)/1000000.0f));
|
||||
|
||||
start = System.nanoTime();
|
||||
int size = personService.getAllPeople().size();
|
||||
end = System.nanoTime();
|
||||
System.out.println("Size ("+size+") : "+((end-start)/1000000.0f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void testCreateMissingPeople1()
|
||||
{
|
||||
personService.setCreateMissingPeople(false);
|
||||
|
Reference in New Issue
Block a user