org.apache.geronimo.testsupport
Class TestSupport

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.geronimo.testsupport.TestSupport
All Implemented Interfaces:
Test
Direct Known Subclasses:
SeleniumTestSupport, XmlBeansTestSupport

public abstract class TestSupport
extends TestCase

Provides support for tests.


Field Summary
protected  File BASEDIR
          The base-directory which tests should be run from.
protected  Log log
          Instance logger which tests should use to produce tracing information.
 
Constructor Summary
protected TestSupport()
          Default constructor.
protected TestSupport(String name)
          Constructor for tests that specify a specific test name.
 
Method Summary
protected  File getBaseDir()
          Determine the value of ${basedir}, which should be the base directory of the module which the concreate test class is defined in.
protected  File resolveFile(String path)
          Resolve the given path to a file rooted to BASEDIR.
protected  String resolvePath(String path)
          Resolve the given path to a path rooted to BASEDIR.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASEDIR

protected final File BASEDIR
The base-directory which tests should be run from.

See Also:
This field is initialized from the return of this method on instance construction.

log

protected Log log
Instance logger which tests should use to produce tracing information.

Unless you have a really good reason to, do not change this field from your sub-class. And if you do, please document why you have done so.

Constructor Detail

TestSupport

protected TestSupport(String name)
Constructor for tests that specify a specific test name.

See Also:
This is the prefered constructor for sub-classes to use.

TestSupport

protected TestSupport()
Default constructor.

Method Detail

getBaseDir

protected final File getBaseDir()
Determine the value of ${basedir}, which should be the base directory of the module which the concreate test class is defined in.

If The system property basedir is already set, then that value is used, otherwise we determine the value from the codesource of the containing concrete class and set the basedir system property to that value.

Returns:
The base directory of the module which contains the concreate test class.
See Also:
This field is always initialized to the value which this method returns.

resolveFile

protected final File resolveFile(String path)
Resolve the given path to a file rooted to BASEDIR.

Parameters:
path - The path to resolve.
Returns:
The resolved file for the given path.

resolvePath

protected final String resolvePath(String path)
Resolve the given path to a path rooted to BASEDIR.

Parameters:
path - The path to resolve.
Returns:
The resolved path for the given path.
See Also:
resolveFile(String)


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.