org.kuali.rice.ken.dao
Class BusinessObjectPersistenceTestCaseBase

java.lang.Object
  extended by org.kuali.rice.test.BaseRiceTestCase
      extended by org.kuali.rice.test.RiceTestCase
          extended by org.kuali.rice.test.RiceInternalSuiteDataTestCase
              extended by org.kuali.rice.test.BaseModuleTestCase
                  extended by org.kuali.rice.test.BaselineTestCase
                      extended by org.kuali.rice.ken.test.KENTestCase
                          extended by org.kuali.rice.ken.dao.BusinessObjectDaoTestCaseBase
                              extended by org.kuali.rice.ken.dao.BusinessObjectPersistenceTestCaseBase
All Implemented Interfaces:
MethodAware
Direct Known Subclasses:
NotificationChannelDaoTest, NotificationChannelReviewerDaoTest, NotificationContentTypeDaoTest, NotificationDaoTest, NotificationPriorityDaoTest, NotificationProducerDaoTest, NotificationRecipientListDaoTest, UserChannelSubscriptionDaoTest

public abstract class BusinessObjectPersistenceTestCaseBase
extends BusinessObjectDaoTestCaseBase

This abstract class puts forward a simple framework for testing the basic persistence of business objects in the system.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.rice.ken.test.KENTestCase
KENTestCase.ClearCacheLifecycle
 
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
 
Field Summary
 
Fields inherited from class org.kuali.rice.ken.dao.BusinessObjectDaoTestCaseBase
businessObjectDao
 
Fields inherited from class org.kuali.rice.ken.test.KENTestCase
services, transactionManager
 
Fields inherited from class org.kuali.rice.test.BaselineTestCase
dirty
 
Fields inherited from class org.kuali.rice.test.BaseModuleTestCase
LOG, moduleName
 
Fields inherited from class org.kuali.rice.test.RiceTestCase
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles
 
Fields inherited from class org.kuali.rice.test.BaseRiceTestCase
log, method
 
Constructor Summary
BusinessObjectPersistenceTestCaseBase()
           
 
Method Summary
protected abstract  boolean delete()
          This method must be implemented to return true if a record was properly delted from the database.
protected abstract  boolean insert()
          This method must be implemented to return true if a record was properly inserted into the database.
protected abstract  boolean retrieve()
          This method must be implemented to return true if a record was properly retreived from the database.
protected  void setup()
          This method should be overridden and implemented to perform a setup of any dependent objects that business object may need to reference.
 void testBasicPersistence()
          This method is responsible for testing the basic persistence of a business object.
protected abstract  boolean update()
          This method must be implemented to return true if a record was properly updated in the database.
protected abstract  boolean validateChanges()
          This method should be implemented to retrieve the objects that were just updated, and validate that their changes took effect.
 
Methods inherited from class org.kuali.rice.ken.dao.BusinessObjectDaoTestCaseBase
setUp
 
Methods inherited from class org.kuali.rice.ken.test.KENTestCase
disableQuartzJobs, enableQuartzJobs, getLoadApplicationLifecycle, getNotificationPerTestLifecycles, getPerTestLifecycles, getPerTestTablesToClear, getSuiteLifecycles
 
Methods inherited from class org.kuali.rice.test.BaselineTestCase
getClearDbPerTestLifecycles, getMode, getPerTestTablesNotToClear, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles
 
Methods inherited from class org.kuali.rice.test.BaseModuleTestCase
getModuleName
 
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKNSDefaultSuiteTestData, loadSuiteTestData
 
Methods inherited from class org.kuali.rice.test.RiceTestCase
configureLogging, dumpMemory, getBaseDir, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, setUpInternal, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles, tearDown
 
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusinessObjectPersistenceTestCaseBase

public BusinessObjectPersistenceTestCaseBase()
Method Detail

testBasicPersistence

public void testBasicPersistence()
This method is responsible for testing the basic persistence of a business object.


setup

protected void setup()
This method should be overridden and implemented to perform a setup of any dependent objects that business object may need to reference. Since we are using Spring's automated transaction rollback, we do not need to worry about tearing stuff down.


insert

protected abstract boolean insert()
This method must be implemented to return true if a record was properly inserted into the database.

Returns:
boolean

retrieve

protected abstract boolean retrieve()
This method must be implemented to return true if a record was properly retreived from the database.

Returns:
boolean

update

protected abstract boolean update()
This method must be implemented to return true if a record was properly updated in the database.

Returns:
boolean

validateChanges

protected abstract boolean validateChanges()
This method should be implemented to retrieve the objects that were just updated, and validate that their changes took effect.

Returns:
boolean

delete

protected abstract boolean delete()
This method must be implemented to return true if a record was properly delted from the database.

Returns:
boolean


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.