com.atlassian.crowd.acceptance.tests.persistence.migration
Class SchemaCreationIntegrationTest
java.lang.Object
com.atlassian.crowd.acceptance.tests.persistence.migration.AbstractDaoIntegrationTest
com.atlassian.crowd.acceptance.tests.persistence.migration.SchemaCreationIntegrationTest
@ContextConfiguration(locations={"classpath:/applicationContext-schemahelper-config.xml","classpath:/applicationContext-CrowdDAO.xml"})
@TestExecutionListeners(value={org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class,org.springframework.test.context.transaction.TransactionalTestExecutionListener.class,org.springframework.test.context.support.DirtiesContextTestExecutionListener.class})
@TransactionConfiguration(defaultRollback=true)
@DirtiesContext(classMode=AFTER_CLASS)
public class SchemaCreationIntegrationTest- extends AbstractDaoIntegrationTest
This test is HSQLDB-specific because it uses a HSQLDB-specific statement
to delete any existing previous schema.
The DirtiesContext annotation ensures that the Spring context created for this
test is not reused by any other test (such as SchemaUpgradeIntegrationTest).
Each test class requires a fresh instance of the HSQL database, a fresh instance
of the SessionFactory and a reset of the auto-increment ID generators.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SchemaCreationIntegrationTest
public SchemaCreationIntegrationTest()
createSchema
@BeforeTransaction
public void createSchema()
throws Exception
- The database schema must be created before a transaction is started, because
otherwise Hibernate's SessionFactory will initialise it for us (or
validate it, depending on how it is configured).
- Throws:
Exception
testDaosCanInsertNewDataAfterSchemaCreation
@Transactional
public void testDaosCanInsertNewDataAfterSchemaCreation()
throws Exception
- DAOs must be run within a transaction.
- Throws:
Exception
getTokenDao
public com.atlassian.crowd.dao.token.TokenDAOHibernate getTokenDao()
- Specified by:
getTokenDao in class AbstractDaoIntegrationTest
getApplicationDao
public com.atlassian.crowd.dao.application.ApplicationDAO getApplicationDao()
- Specified by:
getApplicationDao in class AbstractDaoIntegrationTest
getUserDao
public com.atlassian.crowd.embedded.spi.UserDao getUserDao()
- Specified by:
getUserDao in class AbstractDaoIntegrationTest
getGroupDao
public com.atlassian.crowd.embedded.spi.GroupDao getGroupDao()
- Specified by:
getGroupDao in class AbstractDaoIntegrationTest
getMembershipDao
public com.atlassian.crowd.embedded.spi.MembershipDao getMembershipDao()
- Specified by:
getMembershipDao in class AbstractDaoIntegrationTest
getDirectoryDao
public com.atlassian.crowd.embedded.spi.DirectoryDao getDirectoryDao()
- Specified by:
getDirectoryDao in class AbstractDaoIntegrationTest
getAliasDao
public com.atlassian.crowd.dao.alias.AliasDAO getAliasDao()
- Specified by:
getAliasDao in class AbstractDaoIntegrationTest
getPropertyDao
public com.atlassian.crowd.dao.property.PropertyDAO getPropertyDao()
- Specified by:
getPropertyDao in class AbstractDaoIntegrationTest
Copyright © 2014 Atlassian. All Rights Reserved.