com.banda.serverbase.test
Class BasicDaoTest<T,PK extends Serializable>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.banda.serverbase.test.Spring4Test
              extended by com.banda.serverbase.test.AbstractDaoTest<T,PK>
                  extended by com.banda.serverbase.test.BasicDaoTest<T,PK>
Type Parameters:
T - Object handled by DAO
PK - Primary key of the object handled by DAO
All Implemented Interfaces:
junit.framework.Test

public abstract class BasicDaoTest<T,PK extends Serializable>
extends AbstractDaoTest<T,PK>

An abstract class that tests the core DAO functionality integrated with the random test object generation.

Since:
2012
Author:
© Peter Banda
See Also:
GenericDAO

Constructor Summary
BasicDaoTest()
           
 
Method Summary
protected  GenericDAO<T,PK> getDao()
          Gets the DAO class tested by this class.
protected  PK getExistingTestKey()
          Gets the key existing in database for testing.
protected  T getTestObject()
          Gets the test data for DAO testing.
protected  void setUp(GenericDAO<T,PK> dao, Class<? extends T> clazz, PK existingTestKey)
           
abstract  void setUpTestData()
           
 
Methods inherited from class com.banda.serverbase.test.AbstractDaoTest
assertObjectEquals, getKey, testExists, testGet, testGetAll, testGetLast, testRemove, testSave
 
Methods inherited from class com.banda.serverbase.test.Spring4Test
assertNotEmpty, createRandomObject, createRandomObjects, reportValues
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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

BasicDaoTest

public BasicDaoTest()
Method Detail

setUp

protected void setUp(GenericDAO<T,PK> dao,
                     Class<? extends T> clazz,
                     PK existingTestKey)

setUpTestData

public abstract void setUpTestData()

getTestObject

protected T getTestObject()
Description copied from class: AbstractDaoTest
Gets the test data for DAO testing.

Specified by:
getTestObject in class AbstractDaoTest<T,PK extends Serializable>
Returns:
The data for testing

getExistingTestKey

protected PK getExistingTestKey()
Description copied from class: AbstractDaoTest
Gets the key existing in database for testing.

Specified by:
getExistingTestKey in class AbstractDaoTest<T,PK extends Serializable>
Returns:
The key for testing

getDao

protected GenericDAO<T,PK> getDao()
Description copied from class: AbstractDaoTest
Gets the DAO class tested by this class.

Specified by:
getDao in class AbstractDaoTest<T,PK extends Serializable>
Returns:
The DAO class to test


Copyright © 2013. All Rights Reserved.