Methods Summary |
---|
public void | addTest(junit.framework.Test test)
log.trace( "adding test [" + test + "]" );
if ( settings == null ) {
if ( test instanceof ExecutionEnvironment.Settings ) {
settings = ( ExecutionEnvironment.Settings ) test;
// todo : we could also centralize the skipping of "database specific" tests here
// instead of duplicating this notion in AllTests and DatabaseSpecificFunctionalTestCase.
// as a test gets added, simply check to see if we should really add it via
// DatabaseSpecificFunctionalTestCase.appliesTo( ExecutionEnvironment.DIALECT )...
}
}
testCount++;
super.addTest( test );
|
public void | run(junit.framework.TestResult testResult)
if ( testCount == 0 ) {
// might be zero if database-specific...
return;
}
try {
log.info( "Starting test-suite [" + getName() + "]" );
setUp();
testPosition = 0;
super.run( testResult );
}
finally {
try {
tearDown();
}
catch( Throwable ignore ) {
}
log.info( "Completed test-suite [" + getName() + "]" );
}
|
public void | runTest(junit.framework.Test test, junit.framework.TestResult testResult)
testPosition++;
if ( environmentSetupError != null ) {
testResult.startTest( test );
testResult.addError( test, environmentSetupError );
testResult.endTest( test );
return;
}
if ( ! ( test instanceof FunctionalTestCase ) ) {
super.runTest( test, testResult );
}
else {
FunctionalTestCase functionalTest = ( ( FunctionalTestCase ) test );
try {
// disallow rebuilding the schema because this is the last test
// in this suite, thus it is about to get dropped immediately
// afterwards anyway...
environment.setAllowRebuild( testPosition < testCount );
functionalTest.setEnvironment( environment );
super.runTest( functionalTest, testResult );
}
finally {
functionalTest.setEnvironment( null );
}
}
|
protected void | setUp()
if ( settings == null ) {
return;
}
log.info( "Building aggregated execution environment" );
try {
environment = new ExecutionEnvironment( settings );
environment.initialize();
}
catch( Throwable t ) {
environmentSetupError = t;
}
|
protected void | tearDown()
if ( environment != null ) {
log.info( "Destroying aggregated execution environment" );
environment.complete();
this.environment = null;
}
|