com.atlassian.crowd.acceptance.tests.persistence.dao.token
Class TokenDAOTester

java.lang.Object
  extended by com.atlassian.crowd.acceptance.tests.persistence.dao.token.TokenDAOTester
Direct Known Subclasses:
TokenDAOHibernateTest, TokenDAOMemoryTest

@Transactional
public abstract class TokenDAOTester
extends Object

Base class for TokenDAO tests. It contains the tests that are shared by the implementations of TokenDAO. Note the @Transactional annotation at the class level. This is necessary because the annotation must be in the same class as the @Test annotations, or it won't take effect.


Field Summary
protected static long DIRECTORY_ID
           
 org.junit.rules.ExpectedException expectedException
           
protected static long RANDOM_NUMBER
           
protected static Long TOKEN_ID
           
protected static String TOKEN_KEY
           
protected static String TOKEN1_ID_HASH
           
protected static String TOKEN2_ID_HASH
           
protected static String TOKEN3_ID_HASH
           
 
Constructor Summary
TokenDAOTester()
           
 
Method Summary
protected abstract  TokenDAO getTokenDAO()
           
 void testAdd()
           
 void testAddWithDuplicateIdentifierHash()
           
 void testFindByIdentifierHash()
           
 void testFindByKey()
           
 void testLoadAll()
           
 void testRemove()
           
 void testRemoveAll()
           
 void testRemoveAllByDirectory()
           
 void testRemoveAllExpiredTokens()
           
 void testRemoveByName()
           
 void testRemoveExpiredTokensWithSpecificDurationGreaterThanSessionMaxLife()
           
 void testRemoveExpiredTokensWithSpecificDurationLessThanSessionMaxLife()
           
 void testSaveAllWithNoTokens()
           
 void testSaveAllWithTestTokens()
           
 void testSearch()
           
 void testSearchByLastAccessedTime()
           
 void testSearchForApplicationTokens()
           
 void testSearchForPrincipalTokenByName()
           
 void testSearchForPrincipalTokensByDirectoryId()
           
 void testSearchForSecretNumberWhereSecretNumberIsEmpty()
           
 void testSearchForTokenBySecretNumber()
           
 void testSearchWithIndexConstraints()
           
 void testSearchWithIndexConstraintsSkippingTheFirstResult()
           
 void testUpdate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_KEY

protected static final String TOKEN_KEY
See Also:
Constant Field Values

DIRECTORY_ID

protected static final long DIRECTORY_ID
See Also:
Constant Field Values

RANDOM_NUMBER

protected static final long RANDOM_NUMBER
See Also:
Constant Field Values

TOKEN_ID

protected static final Long TOKEN_ID

TOKEN1_ID_HASH

protected static final String TOKEN1_ID_HASH
See Also:
Constant Field Values

TOKEN2_ID_HASH

protected static final String TOKEN2_ID_HASH
See Also:
Constant Field Values

TOKEN3_ID_HASH

protected static final String TOKEN3_ID_HASH
See Also:
Constant Field Values

expectedException

public final org.junit.rules.ExpectedException expectedException
Constructor Detail

TokenDAOTester

public TokenDAOTester()
Method Detail

testAdd

public void testAdd()
             throws Exception
Throws:
Exception

testAddWithDuplicateIdentifierHash

public void testAddWithDuplicateIdentifierHash()
                                        throws Exception
Throws:
Exception

testUpdate

public void testUpdate()
                throws Exception
Throws:
Exception

testRemove

public void testRemove()
                throws Exception
Throws:
Exception

testRemoveByName

public void testRemoveByName()

testSearch

public void testSearch()
                throws PersistenceException
Throws:
PersistenceException

testSearchForPrincipalTokensByDirectoryId

public void testSearchForPrincipalTokensByDirectoryId()
                                               throws Exception
Throws:
Exception

testSearchForApplicationTokens

public void testSearchForApplicationTokens()
                                    throws Exception
Throws:
Exception

testSearchForPrincipalTokenByName

public void testSearchForPrincipalTokenByName()
                                       throws Exception
Throws:
Exception

testSearchByLastAccessedTime

public void testSearchByLastAccessedTime()
                                  throws Exception
Throws:
Exception

testSearchWithIndexConstraints

public void testSearchWithIndexConstraints()

testSearchWithIndexConstraintsSkippingTheFirstResult

public void testSearchWithIndexConstraintsSkippingTheFirstResult()

testSearchForTokenBySecretNumber

public void testSearchForTokenBySecretNumber()

testSearchForSecretNumberWhereSecretNumberIsEmpty

public void testSearchForSecretNumberWhereSecretNumberIsEmpty()
                                                       throws Exception
Throws:
Exception

testRemoveAllByDirectory

public void testRemoveAllByDirectory()

testRemoveAllExpiredTokens

public void testRemoveAllExpiredTokens()
                                throws Exception
Throws:
Exception

testRemoveExpiredTokensWithSpecificDurationLessThanSessionMaxLife

public void testRemoveExpiredTokensWithSpecificDurationLessThanSessionMaxLife()
                                                                       throws Exception
Throws:
Exception

testRemoveExpiredTokensWithSpecificDurationGreaterThanSessionMaxLife

public void testRemoveExpiredTokensWithSpecificDurationGreaterThanSessionMaxLife()
                                                                          throws Exception
Throws:
Exception

testFindByKey

public void testFindByKey()
                   throws Exception
Throws:
Exception

testFindByIdentifierHash

public void testFindByIdentifierHash()
                              throws Exception
Throws:
Exception

testRemoveAll

public void testRemoveAll()

testLoadAll

public void testLoadAll()
                 throws Exception
Throws:
Exception

testSaveAllWithNoTokens

public void testSaveAllWithNoTokens()
                             throws Exception
Throws:
Exception

testSaveAllWithTestTokens

public void testSaveAllWithTestTokens()
                               throws Exception
Throws:
Exception

getTokenDAO

protected abstract TokenDAO getTokenDAO()


Copyright © 2013 Atlassian. All Rights Reserved.