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

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
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ApacheDS154Test.SynchroniseMembershipsWithNonCnAttributeForGroupNames, BasicTest, EnabledDisabledUserTest, GroupRoleTest, LdapDirectoryMappersWithRequiredAttributesTest, LdapDirectoryWithEscapedDnsTest, LocalAttributesTest, LocalGroupsTest, NestedGroupsTest, PageAndRangeTest, PrimaryGroupTest, Rfc2307Test

public abstract class BaseTest
extends org.springframework.test.AbstractTransactionalDataSourceSpringContextTests

Sets properties and connects to a directory for testing. The RemoteDirectory interface is exercised by a subclass. This now includes support for the database to allow testing of internal-backed LDAP directories.


Field Summary
protected  DirectoryImpl directory
           
protected  MockDirectoryManager directoryManager
           
protected  org.hibernate.SessionFactory 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
protected BaseTest()
           
protected BaseTest(String name)
           
 
Method Summary
protected  void configureDirectory(Properties directorySettings)
          Configures a runtime Crowd object that connects to the Sun instance.
protected  void customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
           
protected  void deleteFromTables(String[] names)
          Delete tables without setting the 'zapped' flag so we can commit.
protected  String[] getConfigLocations()
           
 String getDirectoryConfigFile()
           
protected  RemoteDirectory getRemoteDirectory()
           
protected abstract  void loadTestData()
          Called before every test run to add data needed for test.
protected  void onSetUpBeforeTransaction()
           
protected  void onSetUpInTransaction()
           
 void onTearDown()
           
protected abstract  void removeTestData()
          Called before loadTestData() AND after every test run to remove data added for test.
 void setDirectoryConfigFile(String directoryConfigFile)
           
 void setLdapPropertiesHelper(LDAPPropertiesHelperImpl ldapPropertiesHelperImpl)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 void 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
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

directory

protected DirectoryImpl directory

directoryManager

protected MockDirectoryManager directoryManager

sessionFactory

protected org.hibernate.SessionFactory sessionFactory
Constructor Detail

BaseTest

protected BaseTest()

BaseTest

protected BaseTest(String name)
Method Detail

customizeBeanFactory

protected void customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
Overrides:
customizeBeanFactory in class org.springframework.test.AbstractSingleSpringContextTests

getConfigLocations

protected String[] getConfigLocations()
Overrides:
getConfigLocations in class org.springframework.test.AbstractSingleSpringContextTests

configureDirectory

protected void configureDirectory(Properties directorySettings)
Configures a runtime Crowd object that connects to the Sun instance.


setupSpring

public void setupSpring()

onSetUpBeforeTransaction

protected void onSetUpBeforeTransaction()
                                 throws Exception
Overrides:
onSetUpBeforeTransaction in class org.springframework.test.AbstractTransactionalSpringContextTests
Throws:
Exception

onSetUpInTransaction

protected void onSetUpInTransaction()
                             throws Exception
Overrides:
onSetUpInTransaction in class org.springframework.test.AbstractTransactionalSpringContextTests
Throws:
Exception

onTearDown

public void onTearDown()
                throws Exception
Overrides:
onTearDown in class org.springframework.test.AbstractTransactionalSpringContextTests
Throws:
Exception

removeTestData

protected abstract void removeTestData()
                                throws DirectoryInstantiationException
Called before loadTestData() AND after every test run to remove data added for test.

Throws:
DirectoryInstantiationException

loadTestData

protected abstract void loadTestData()
                              throws Exception
Called before every test run to add data needed for test.

Throws:
Exception

setLdapPropertiesHelper

public void setLdapPropertiesHelper(LDAPPropertiesHelperImpl ldapPropertiesHelperImpl)

setDirectoryConfigFile

public void setDirectoryConfigFile(String directoryConfigFile)

getDirectoryConfigFile

public String getDirectoryConfigFile()

getRemoteDirectory

protected RemoteDirectory getRemoteDirectory()
                                      throws DirectoryInstantiationException
Throws:
DirectoryInstantiationException

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

deleteFromTables

protected void deleteFromTables(String[] names)
Delete tables without setting the 'zapped' flag so we can commit.

Overrides:
deleteFromTables in class org.springframework.test.AbstractTransactionalDataSourceSpringContextTests


Copyright © 2013 Atlassian. All Rights Reserved.