org.kuali.rice.krad.data.jpa
Class JpaPersistenceProviderTest

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.krad.test.KRADTestCase
                          extended by org.kuali.rice.krad.data.jpa.JpaPersistenceProviderTest
All Implemented Interfaces:
MethodAware

public class JpaPersistenceProviderTest
extends KRADTestCase

Tests JPAPersistenceProvider


Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.rice.krad.test.KRADTestCase
KRADTestCase.BootstrapTest, KRADTestCase.Legacy
 
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
 
Field Summary
protected  PersistenceProvider provider
          The PersistenceProvider being tested
 
Fields inherited from class org.kuali.rice.krad.test.KRADTestCase
dd, kradTestHarnessSpringResourceLoader
 
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
JpaPersistenceProviderTest()
           
 
Method Summary
protected  void addLinkedReferences(Object o)
           
protected  void addUnlinkedReferences(Object o)
           
protected  void assertTestObjectEquals(Object oExpected, Object oActual)
           
protected  void assertTestObjectIdentityEquals(Object oExpected, Object oActual)
           
protected  void assignPK(Object a)
          Assigns the next generated primary key value to the test object
protected  Map.Entry<Object,QueryByCriteria> createForQuery()
          Creates a test object and generates a matching query for it
protected  Map.Entry<List<Object>,QueryByCriteria.Builder> createForQuery(int count)
          Generates a batch of test objects and returns a single query that will select them all.
protected  Object createLinkedTestObject()
          Creates an unsaved test object
protected  Object createTopLevelObject()
           
protected  Object createUnlinkedTestObject()
          Creates an unsaved, unlinked test object
protected  Object getIdForLookup(Object o)
           
protected  String getNextTestObjectId()
           
protected  PersistenceProvider getPersistenceProvider()
           
protected  String[] getPropertiesForQuery()
           
protected  QueryByCriteria queryFor(Object a)
          Derives a QueryByCriteria for a test object
protected  void setTestObjectPK(Object o, Object key)
           
 void setup()
          Obtains PersistenceProvider.
 void testDeleteNonExistentEntity()
          Tests that deletion of a non-existent detached object does not result in a save of the object via merge.
 void testFindByCompoundKey()
           
 void testFindBySingleKey()
           
 void testFindMatching()
           
 void testFindWithResultsWindow()
           
 void testHandles()
           
 void testSaveLinkedSkipLinking()
           
 void testSaveUnlinkedSkipLinking()
           
 void testSimpleSave()
           
 
Methods inherited from class org.kuali.rice.krad.test.KRADTestCase
getKRADTestHarnessContext, getLoadApplicationLifecycle, getSuiteLifecycles, getTestDictionaryObject, loadSuiteTestData, setUp, setUpInternal, setUpLegacyContext, tearDown, tearDownLegacyContext
 
Methods inherited from class org.kuali.rice.test.BaselineTestCase
getClearDbPerTestLifecycles, getMode, getPerTestLifecycles, getPerTestTablesNotToClear, getPerTestTablesToClear, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles
 
Methods inherited from class org.kuali.rice.test.BaseModuleTestCase
getModuleName
 
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKRADDefaultSuiteTestData
 
Methods inherited from class org.kuali.rice.test.RiceTestCase
configureLogging, dumpMemory, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, getUserDir, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles
 
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase
getName, getPerTestDataLoaderLifecycle, getTestMethod, resetLogLevels, setLogLevel, setName, setTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

provider

protected PersistenceProvider provider
The PersistenceProvider being tested

Constructor Detail

JpaPersistenceProviderTest

public JpaPersistenceProviderTest()
Method Detail

setup

public void setup()
Obtains PersistenceProvider.


queryFor

protected QueryByCriteria queryFor(Object a)
Derives a QueryByCriteria for a test object


createLinkedTestObject

protected Object createLinkedTestObject()
Creates an unsaved test object


createUnlinkedTestObject

protected Object createUnlinkedTestObject()
Creates an unsaved, unlinked test object


assignPK

protected void assignPK(Object a)
Assigns the next generated primary key value to the test object


createForQuery

protected Map.Entry<Object,QueryByCriteria> createForQuery()
Creates a test object and generates a matching query for it


createForQuery

protected Map.Entry<List<Object>,QueryByCriteria.Builder> createForQuery(int count)
Generates a batch of test objects and returns a single query that will select them all. The order of the returned list of test objects should match the order of the results returned by the underlying platform (i.e., if they are returned in a sorted order, then the test object list should be sorted).


testSimpleSave

public void testSimpleSave()

testSaveLinkedSkipLinking

public void testSaveLinkedSkipLinking()

testSaveUnlinkedSkipLinking

public void testSaveUnlinkedSkipLinking()

testFindMatching

public void testFindMatching()

testFindBySingleKey

public void testFindBySingleKey()

testFindByCompoundKey

public void testFindByCompoundKey()

testFindWithResultsWindow

public void testFindWithResultsWindow()

testDeleteNonExistentEntity

public void testDeleteNonExistentEntity()
Tests that deletion of a non-existent detached object does not result in a save of the object via merge.


testHandles

public void testHandles()

createTopLevelObject

protected Object createTopLevelObject()

addLinkedReferences

protected void addLinkedReferences(Object o)

addUnlinkedReferences

protected void addUnlinkedReferences(Object o)

getPropertiesForQuery

protected String[] getPropertiesForQuery()

getIdForLookup

protected Object getIdForLookup(Object o)

getNextTestObjectId

protected String getNextTestObjectId()

setTestObjectPK

protected void setTestObjectPK(Object o,
                               Object key)

assertTestObjectIdentityEquals

protected void assertTestObjectIdentityEquals(Object oExpected,
                                              Object oActual)

assertTestObjectEquals

protected void assertTestObjectEquals(Object oExpected,
                                      Object oActual)

getPersistenceProvider

protected PersistenceProvider getPersistenceProvider()


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.