Fix for ALF-13535 Using CMIS, on-disk tickets cache can grow unbounded

- Single ticket per user (you can have a ticket per login via configuration)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54572 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2013-08-28 13:12:29 +00:00
parent 4e721b8636
commit 0d4d8c41d1
3 changed files with 28 additions and 5 deletions

View File

@@ -338,8 +338,14 @@ public class AuthenticationTest extends TestCase
pubAuthenticationService.authenticate("Andy", "auth1".toCharArray());
String ticket1 = pubAuthenticationService.getCurrentTicket();
pubAuthenticationService.authenticate("Andy", "auth1".toCharArray());
assertFalse(ticket1.equals(pubAuthenticationService.getCurrentTicket()));
if(ticketComponent.getUseSingleTicketPerUser())
{
assertTrue(ticket1.equals(pubAuthenticationService.getCurrentTicket()));
}
else
{
assertFalse(ticket1.equals(pubAuthenticationService.getCurrentTicket()));
}
}
public void testGuest()
@@ -736,7 +742,9 @@ public class AuthenticationTest extends TestCase
}
public void testTicketExpiryMode()
{
{
ticketsCache.clear();
InMemoryTicketComponentImpl tc = new InMemoryTicketComponentImpl();
tc.setOneOff(false);
tc.setTicketsExpire(true);
@@ -878,6 +886,7 @@ public class AuthenticationTest extends TestCase
public void testTicketExpires()
{
ticketsCache.clear();
InMemoryTicketComponentImpl tc = new InMemoryTicketComponentImpl();
tc.setOneOff(false);
tc.setTicketsExpire(true);
@@ -1036,7 +1045,14 @@ public class AuthenticationTest extends TestCase
String ticket2 = authenticationService.getCurrentTicket();
assertFalse(ticket1.equals(ticket2));
if(ticketComponent.getUseSingleTicketPerUser())
{
assertTrue(ticket1.equals(ticket2));
}
else
{
assertFalse(ticket1.equals(ticket2));
}
}
public void testAuthenticationService1()