com.bm.testsuite
Class BaseEntityFixture<T>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jmock.core.VerifyingTestCase
              extended by org.jmock.core.MockObjectSupportTestCase
                  extended by org.jmock.MockObjectTestCase
                      extended by com.bm.testsuite.BaseTest
                          extended by com.bm.testsuite.BaseEntityFixture<T>
Type Parameters:
T - - the type of the entity bean
All Implemented Interfaces:
junit.framework.Test

public abstract class BaseEntityFixture<T>
extends BaseTest

This class is the base executes for all entity beans the automated test cases.

Since:
07.10.2005
Author:
Daniel Wiese

Field Summary
 
Fields inherited from class org.jmock.core.MockObjectSupportTestCase
ANYTHING, NOT_NULL, NULL
 
Constructor Summary
BaseEntityFixture(java.lang.Class<T> entityToTest)
          Default constructor.
BaseEntityFixture(java.lang.Class<T> entityToTest, Generator[] additionalGenerators)
          Additional constructor.
BaseEntityFixture(java.lang.Class<T> entityToTest, Generator<?>[] additionalGenerators, java.lang.Class<?>[] referencedEntities)
          Additional constructor.
 
Method Summary
 void disabled_testWriteWithNullFields()
          This test writes n random generated beans into the database - all nullable fields are setted to null.
protected  void setUp()
           
protected  void tearDown()
           
 void testGetterSetter()
          This test tests the simpe getter-/ setter methods.
 void testWrite()
          This test writes n random generated beans into the database.
 void testWriteRead()
          This test writes n random generated beans into the database Reads all beans agin form the database and test if the reded beans are equal 1) by introspectin all persistent fields 2) by callung the eqals method.
 
Methods inherited from class com.bm.testsuite.BaseTest
assertCollectionsEqual, assertFalse, assertFalse, assertInstanceOf, assertInstanceOf, setValueForField, testNothing
 
Methods inherited from class org.jmock.MockObjectTestCase
atLeastOnce, defaultMockNameForType, mock, mock, never, newCoreMock, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException
 
Methods inherited from class org.jmock.core.MockObjectSupportTestCase
and, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, isA, newDummy, newDummy, newDummy, not, or, same, stringContains
 
Methods inherited from class org.jmock.core.VerifyingTestCase
registerToVerify, runBare, unregisterToVerify, verify
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, 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, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseEntityFixture

public BaseEntityFixture(java.lang.Class<T> entityToTest)
Default constructor.

Parameters:
entityToTest - - the entity to test

BaseEntityFixture

public BaseEntityFixture(java.lang.Class<T> entityToTest,
                         Generator[] additionalGenerators)
Additional constructor.

Parameters:
entityToTest - - the entity to test
additionalGenerators - -a dditional generators (plug in)

BaseEntityFixture

public BaseEntityFixture(java.lang.Class<T> entityToTest,
                         Generator<?>[] additionalGenerators,
                         java.lang.Class<?>[] referencedEntities)
Additional constructor.

Parameters:
entityToTest - - the entity to test
additionalGenerators - -additional generators (plug in)
referencedEntities - referenced persitence classes
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.setUp()

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.tearDown()

testWrite

public void testWrite()
               throws java.lang.Exception
This test writes n random generated beans into the database.

Throws:
java.lang.Exception - - in an error case

testGetterSetter

public void testGetterSetter()
This test tests the simpe getter-/ setter methods.


disabled_testWriteWithNullFields

public void disabled_testWriteWithNullFields()
                                      throws java.lang.Exception
This test writes n random generated beans into the database - all nullable fields are setted to null.

Throws:
java.lang.Exception - - in an error case

testWriteRead

public void testWriteRead()
                   throws java.lang.Exception
This test writes n random generated beans into the database Reads all beans agin form the database and test if the reded beans are equal 1) by introspectin all persistent fields 2) by callung the eqals method. Additionaly the hash-code implementation will be checked

Throws:
java.lang.Exception - - in an error case


Copyright © 2008. All Rights Reserved.