com.atlassian.crowd.acceptance.tests.directory
Class DbCachingLdapTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.test.AbstractTransactionalSpringContextTests
                              extended by org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
                                  extended by com.atlassian.crowd.acceptance.tests.directory.BaseTest
                                      extended by com.atlassian.crowd.acceptance.tests.directory.DbCachingLdapTest
All Implemented Interfaces:
junit.framework.Test

public class DbCachingLdapTest
extends BaseTest

Tests the caching functionality of the DbCachingRemoteDirectory. This test shouldn't be running in a single transaction, and loadTestData() intentionally commits the current transaction early so the remaining database interaction is non-transactional.


Field Summary
 
Fields inherited from class com.atlassian.crowd.acceptance.tests.directory.BaseTest
directory, directoryManager, sessionFactory
 
Fields inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
jdbcTemplate
 
Fields inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
transactionDefinition, transactionManager, transactionStatus
 
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO
 
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests
applicationContext
 
Fields inherited from class org.springframework.test.ConditionalTestCase
logger
 
Constructor Summary
DbCachingLdapTest()
           
 
Method Summary
protected  void configureDirectory(java.util.Properties directorySettings)
          Configures a runtime Crowd object that connects to the Sun instance.
protected  java.lang.String[] getConfigLocations()
           
protected  void loadTestData()
          Called before every test run to add data needed for test.
protected  void onSetUpBeforeTransaction()
           
protected  void removeTestData()
          Called before loadTestData() AND after every test run to remove data added for test.
 void testAddGroupViaCachingDirectory()
          Test adding a group.
 void testAddGroupViaLdap()
          Test adding a group.
 void testAddMembershipViaCachingDirectory()
          Test adding a membership.
 void testAddMembershipViaLdap()
          Test adding a membership.
 void testAddUserViaCachingDirectory()
          Test adding a user.
 void testAddUserViaLdap()
          Test adding a user.
 void testRemoveGroupViaCachingDirectory()
          Test removing a group.
 void testRemoveGroupViaLdap()
          Test removing a group.
 void testRemoveMembershipViaCachingDirectory()
          Test removing a membership.
 void testRemoveMembershipViaLdap()
          Test removing a membership.
 void testRemoveUserViaCachingDirectory()
          Test removing a user.
 void testRemoveUserViaLdap()
          Test removing a user.
 void testSearchOperations()
          Test the basic search operations to make sure the work normally.
 void testUpdateGroupViaCachingDirectory()
          Test Update a group.
 void testUpdateGroupViaLdap()
          Test Update a group.
 void testUpdateUserViaCachingDirectory()
          Test Update a user.
 void testUpdateUserViaLdap()
          Test Update a user.
 
Methods inherited from class com.atlassian.crowd.acceptance.tests.directory.BaseTest
addGroup, addGroup, addUser, addUser, buildGroup, buildUser, buildUser, customizeBeanFactory, deleteFromTables, getDirectoryConfigFile, getRemoteDirectory, onSetUpInTransaction, onTearDown, removeGroup, removeRole, removeUser, setDirectoryConfigFile, setLdapPropertiesHelper, setSessionFactory, setupSpring
 
Methods inherited from class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests
countRowsInTable, executeSqlScript, getJdbcTemplate, setComplete, setDataSource, setSqlScriptEncoding
 
Methods inherited from class org.springframework.test.AbstractTransactionalSpringContextTests
endTransaction, isDefaultRollback, isRollback, onSetUp, onTearDownAfterTransaction, onTearDownInTransaction, preventTransaction, setDefaultRollback, setTransactionDefinition, setTransactionManager, startNewTransaction
 
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables
 
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests
contextKey, createApplicationContext, createBeanDefinitionReader, getApplicationContext, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, prepareApplicationContext, setDirty, setUp, tearDown
 
Methods inherited from class org.springframework.test.AbstractSpringContextTests
addContext, contextKeyString, getContext, hasCachedContext, isContextKeyEmpty, setDirty
 
Methods inherited from class org.springframework.test.ConditionalTestCase
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled, runBare
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbCachingLdapTest

public DbCachingLdapTest()
Method Detail

getConfigLocations

protected java.lang.String[] getConfigLocations()
Overrides:
getConfigLocations in class BaseTest

onSetUpBeforeTransaction

protected void onSetUpBeforeTransaction()
                                 throws java.lang.Exception
Overrides:
onSetUpBeforeTransaction in class BaseTest
Throws:
java.lang.Exception

configureDirectory

protected void configureDirectory(java.util.Properties directorySettings)
Description copied from class: BaseTest
Configures a runtime Crowd object that connects to the Sun instance.

Overrides:
configureDirectory in class BaseTest

loadTestData

protected void loadTestData()
                     throws java.lang.Exception
Description copied from class: BaseTest
Called before every test run to add data needed for test.

Specified by:
loadTestData in class BaseTest
Throws:
java.lang.Exception

removeTestData

protected void removeTestData()
Description copied from class: BaseTest
Called before loadTestData() AND after every test run to remove data added for test.

Specified by:
removeTestData in class BaseTest

testSearchOperations

public void testSearchOperations()
                          throws java.lang.Exception
Test the basic search operations to make sure the work normally.

Throws:
java.lang.Exception

testAddUserViaLdap

public void testAddUserViaLdap()
                        throws java.lang.Exception
Test adding a user. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testRemoveUserViaLdap

public void testRemoveUserViaLdap()
                           throws java.lang.Exception
Test removing a user. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testUpdateUserViaLdap

public void testUpdateUserViaLdap()
                           throws java.lang.Exception
Test Update a user. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testAddGroupViaLdap

public void testAddGroupViaLdap()
                         throws java.lang.Exception
Test adding a group. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testRemoveGroupViaLdap

public void testRemoveGroupViaLdap()
                            throws java.lang.Exception
Test removing a group. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testUpdateGroupViaLdap

public void testUpdateGroupViaLdap()
                            throws java.lang.Exception
Test Update a group. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testAddMembershipViaLdap

public void testAddMembershipViaLdap()
                              throws java.lang.Exception
Test adding a membership. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testRemoveMembershipViaLdap

public void testRemoveMembershipViaLdap()
                                 throws java.lang.Exception
Test removing a membership. This test directly updates the ldap directory and checks the correct results are seen after the sync is done, but not before.

Throws:
java.lang.Exception

testAddUserViaCachingDirectory

public void testAddUserViaCachingDirectory()
                                    throws java.lang.Exception
Test adding a user. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testRemoveUserViaCachingDirectory

public void testRemoveUserViaCachingDirectory()
                                       throws java.lang.Exception
Test removing a user. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testUpdateUserViaCachingDirectory

public void testUpdateUserViaCachingDirectory()
                                       throws java.lang.Exception
Test Update a user. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testAddGroupViaCachingDirectory

public void testAddGroupViaCachingDirectory()
                                     throws java.lang.Exception
Test adding a group.

Throws:
java.lang.Exception

testRemoveGroupViaCachingDirectory

public void testRemoveGroupViaCachingDirectory()
                                        throws java.lang.Exception
Test removing a group. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testUpdateGroupViaCachingDirectory

public void testUpdateGroupViaCachingDirectory()
                                        throws java.lang.Exception
Test Update a group. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testAddMembershipViaCachingDirectory

public void testAddMembershipViaCachingDirectory()
                                          throws java.lang.Exception
Test adding a membership. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception

testRemoveMembershipViaCachingDirectory

public void testRemoveMembershipViaCachingDirectory()
                                             throws java.lang.Exception
Test removing a membership. This test performs updates via the dbCachingDirectory and checks the correct results are seen both before and after the sync is done.

Throws:
java.lang.Exception


Copyright © 2012 Atlassian. All Rights Reserved.