Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
GTNPORTAL-3194 TestPlainCookieTokenService test is failed randomly
Browse files Browse the repository at this point in the history
  • Loading branch information
trongtt committed Aug 26, 2013
1 parent 3071ef1 commit 2530a67
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -69,15 +69,17 @@ public void testDeleteToken() throws Exception {

@Override
public void testCleanExpiredTokens() throws Exception {
assertEquals(service.getValidityTime(), 2);
assertEquals(2, service.getValidityTime());
String tokenId1 = service.createToken(new Credentials("user1", "gtn"));

Thread.sleep(1000);
String tokenId2 = service.createToken(new Credentials("user2", "gtn"));
assertEquals(service.size(), 2);
Thread.sleep(1500);
service.cleanExpiredTokens();
/* Here we should be cca 2.5 seconds after the creation of user1, so it should have been cleaned as expred already */
assertEquals(service.size(), 1);
assertEquals(2, service.size());

Thread.sleep(1000);
service.cleanExpiredTokens();
assertEquals(1, service.size());

service.deleteToken(tokenId1);
service.deleteToken(tokenId2);
Expand Down

0 comments on commit 2530a67

Please sign in to comment.