org.hibernate.junit
Class UnitTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.hibernate.junit.UnitTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractClassLoaderIsolatedTestCase, FunctionalTestCase

public abstract class UnitTestCase
extends junit.framework.TestCase

A basic JUnit TestCase subclass for adding some Hibernate specific behavior and functionality.

Author:
Steve Ebersole

Constructor Summary
UnitTestCase(String string)
           
 
Method Summary
static void assertClassAssignability(Class source, Class target)
           
static void assertElementTypeAssignability(Collection collection, Class clazz)
           
static junit.framework.TestSuite createFailureExpectedSuite(Class testClass)
          Supports easy creation of TestSuites where a subclass' "FailureExpected" version of a base test is included in the suite, while the base test is excluded.
 String fullTestName()
           
protected  void reportSkip(String reason, String testDescription)
           
 void runBare()
          runBare overridden in order to apply FailureExpected validations as well as start/complete logging
protected  void skipExpectedFailure(Throwable error)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnitTestCase

public UnitTestCase(String string)
Method Detail

runBare

public void runBare()
             throws Throwable
runBare overridden in order to apply FailureExpected validations as well as start/complete logging

Overrides:
runBare in class junit.framework.TestCase
Throws:
Throwable

skipExpectedFailure

protected void skipExpectedFailure(Throwable error)

assertElementTypeAssignability

public static void assertElementTypeAssignability(Collection collection,
                                                  Class clazz)
                                           throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

assertClassAssignability

public static void assertClassAssignability(Class source,
                                            Class target)
                                     throws junit.framework.AssertionFailedError
Throws:
junit.framework.AssertionFailedError

fullTestName

public String fullTestName()

reportSkip

protected void reportSkip(String reason,
                          String testDescription)

createFailureExpectedSuite

public static junit.framework.TestSuite createFailureExpectedSuite(Class testClass)
Supports easy creation of TestSuites where a subclass' "FailureExpected" version of a base test is included in the suite, while the base test is excluded. E.g. test class FooTestCase includes method testBar(), while test class SubFooTestCase extends FooTestCase includes method testBarFailureExcluded(). Passing SubFooTestCase.class to this method will return a suite that does not include testBar().



Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.