|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.hibernate.junit.UnitTestCase org.hibernate.junit.functional.FunctionalTestCase
public abstract class FunctionalTestCase
Most of the Hibernate test suite in fact is a series of functional tests, not unit tests. Here is a base class for these functional tests.
Constructor Summary | |
---|---|
FunctionalTestCase(String string)
|
Method Summary | |
---|---|
void |
afterConfigurationBuilt(Mappings mappings,
Dialect dialect)
|
void |
afterSessionFactoryBuilt(SessionFactoryImplementor sfi)
|
protected boolean |
allowsPhysicalColumnNameInHaving(String testDescription)
Does the db/dialect support using a column's physical name in the having clause even after it has been aliased in the select/group-by clause. |
protected boolean |
allowsPhysicalColumnNameInOrderby(String testDescription)
Does the db/dialect support using a column's physical name in the order-by clause even after it has been aliased in the select clause. |
boolean |
appliesTo(Dialect dialect)
Intended to indicate that this test class as a whole is intended for a dialect or series of dialects. |
protected void |
assertAllDataRemoved()
|
protected void |
cleanupTest()
|
void |
configure(Configuration cfg)
|
boolean |
createSchema()
|
protected boolean |
dialectIs(Class dialectClass)
|
protected boolean |
dialectIsCaseSensitive(String testDescription)
Is the db/dialect sensitive in terms of string comparisons? |
protected boolean |
dialectIsNot(Class dialectClass)
|
protected boolean |
dialectIsNot(Class[] dialectClasses)
|
protected boolean |
dialectIsOneOf(Class[] dialectClasses)
|
protected boolean |
dialectSupportsEmptyInList(String testDescription)
Does the db/dialect support empty lists in the IN operator? For example, is "... |
String |
getBaseForMappings()
|
String |
getCacheConcurrencyStrategy()
|
protected Configuration |
getCfg()
|
protected Dialect |
getDialect()
|
ExecutionEnvironment |
getEnvironment()
|
protected SessionFactory |
getSessions()
Get the factory for this test environment. |
protected boolean |
isSerializableIsolationEnforced()
Do connections enforce SERIALIZABLE isolation... |
Session |
openSession()
|
Session |
openSession(Interceptor interceptor)
|
boolean |
overrideCacheStrategy()
|
protected void |
prepareTest()
|
protected boolean |
readCommittedIsolationMaintained(String scenario)
Is connection at least read committed? Not, that this skip check relies on the JDBC driver reporting the true isolation level correctly. |
boolean |
recreateSchemaAfterFailure()
|
protected void |
runTest()
runTest is overridden in order to apply session closure assertions. |
void |
setEnvironment(ExecutionEnvironment environment)
|
protected void |
setUp()
Override TestCase.setUp() to check if we need
to build a locally managed execution environment. |
protected SessionFactoryImplementor |
sfi()
Get the factory for this test environment, casted to SessionFactoryImplementor . |
protected void |
skipExpectedFailure(Throwable error)
|
protected boolean |
supportsCircularCascadeDelete()
|
protected boolean |
supportsExpectedLobUsagePattern()
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes... |
protected boolean |
supportsLobValueChangePropogation()
Does the current dialect support propogating changes to LOB values back to the database? Talking about mutating the underlying value as opposed to supplying a new LOB instance... |
protected boolean |
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
|
protected boolean |
supportsSubqueryOnMutatingTable()
|
protected boolean |
supportsSubselectOnLeftSideIn()
|
protected boolean |
supportsUnboundedLobLocatorMaterialization()
Is it supported to materialize a LOB locator outside the transaction in which it was created? Again, part of the trickiness here is the fact that this is largely driver dependent. |
protected void |
tearDown()
Override TestCase.tearDown() to tear down
the execution environment if it is locally managed. |
Methods inherited from class org.hibernate.junit.UnitTestCase |
---|
assertClassAssignability, assertElementTypeAssignability, createFailureExpectedSuite, fullTestName, reportSkip, runBare |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, 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, 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 |
Methods inherited from interface org.hibernate.junit.functional.ExecutionEnvironment.Settings |
---|
getMappings |
Constructor Detail |
---|
public FunctionalTestCase(String string)
Method Detail |
---|
public ExecutionEnvironment getEnvironment()
public void setEnvironment(ExecutionEnvironment environment)
protected void prepareTest() throws Exception
Exception
protected void cleanupTest() throws Exception
Exception
protected final void setUp() throws Exception
TestCase.setUp()
to check if we need
to build a locally managed execution environment.
setUp
in class junit.framework.TestCase
Exception
protected final void tearDown() throws Exception
TestCase.tearDown()
to tear down
the execution environment if it is locally managed.
tearDown
in class junit.framework.TestCase
Exception
protected void runTest() throws Throwable
runTest
in class junit.framework.TestCase
Throwable
protected void assertAllDataRemoved()
protected void skipExpectedFailure(Throwable error)
skipExpectedFailure
in class UnitTestCase
public String getBaseForMappings()
getBaseForMappings
in interface ExecutionEnvironment.Settings
public boolean createSchema()
createSchema
in interface ExecutionEnvironment.Settings
public boolean recreateSchemaAfterFailure()
recreateSchemaAfterFailure
in interface ExecutionEnvironment.Settings
public void configure(Configuration cfg)
configure
in interface ExecutionEnvironment.Settings
public boolean overrideCacheStrategy()
overrideCacheStrategy
in interface ExecutionEnvironment.Settings
public String getCacheConcurrencyStrategy()
getCacheConcurrencyStrategy
in interface ExecutionEnvironment.Settings
public void afterSessionFactoryBuilt(SessionFactoryImplementor sfi)
afterSessionFactoryBuilt
in interface ExecutionEnvironment.Settings
public void afterConfigurationBuilt(Mappings mappings, Dialect dialect)
afterConfigurationBuilt
in interface ExecutionEnvironment.Settings
public boolean appliesTo(Dialect dialect)
appliesTo
in interface ExecutionEnvironment.Settings
dialect
- The dialect to be checked.
protected SessionFactory getSessions()
protected SessionFactoryImplementor sfi()
SessionFactoryImplementor
.
Shorthand for ( SessionFactoryImplementor
) getSessions()
...
protected Dialect getDialect()
protected Configuration getCfg()
public Session openSession() throws HibernateException
HibernateException
public Session openSession(Interceptor interceptor) throws HibernateException
HibernateException
protected boolean isSerializableIsolationEnforced() throws Exception
Exception
protected boolean readCommittedIsolationMaintained(String scenario)
scenario
- text description of the scenario being tested.
protected boolean allowsPhysicalColumnNameInOrderby(String testDescription)
testDescription
- description of the scenario being tested.
protected boolean allowsPhysicalColumnNameInHaving(String testDescription)
testDescription
- description of the scenario being tested.
protected boolean dialectSupportsEmptyInList(String testDescription)
testDescription
- description of the scenario being tested.
protected boolean dialectIsCaseSensitive(String testDescription)
testDescription
- description of the scenario being tested.
protected boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
protected boolean supportsCircularCascadeDelete()
protected boolean supportsSubselectOnLeftSideIn()
protected boolean supportsExpectedLobUsagePattern()
protected boolean supportsLobValueChangePropogation()
protected boolean supportsUnboundedLobLocatorMaterialization()
supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction...
protected boolean supportsSubqueryOnMutatingTable()
protected boolean dialectIs(Class dialectClass)
protected boolean dialectIsOneOf(Class[] dialectClasses)
protected boolean dialectIsNot(Class dialectClass)
protected boolean dialectIsNot(Class[] dialectClasses)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |