|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.util.TestUtils
A helper class that provides convienence methods for JUnit testing classes. This class is not meant to be distributed however there is nothing special that would cause problems if it was shipped.
| Constructor Summary | |
TestUtils()
|
|
| Method Summary | |
static void |
configureLog4J(String logsDirPath,
Object object)
Configure Log4j to run for the particular test class. |
static void |
configureLog4J(String logsDirPath,
String name,
Object object)
Configure Log4j to run for the particular test class. |
static Logger |
getLogger(String logsDirPath,
Object object)
Creates a new Logger for the specfied object. |
static void |
main(String[] args)
A simple test. |
static void |
pause(int seconds)
Have the current executing thread sleep for the specified amount of seconds |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TestUtils()
| Method Detail |
public static void configureLog4J(String logsDirPath,
Object object)
There is a very strange behavior with the JUnit tests. A new test case is created for each test. Without this method a new adapter would be added for each time the test case was created.
Therefore, this method will configure the Log4j tool once.
logsDirPath - the path where the resultant log file should be placedobject - the object that the logger is being configured for. This
will be translated into the objects class name which will become the
log files name as well.
public static void configureLog4J(String logsDirPath,
String name,
Object object)
There is a very strange behavior with the JUnit tests. A new test case is created for each test. Without this method a new adapter would be added for each time the test case was created.
Therefore, this method will configure the Log4j tool once.
logsDirPath - the path where the resultant log file should be placedobject - the object that the logger is being configured for. This
will be translated into the objects class name which will become the
log files name as well.
public static Logger getLogger(String logsDirPath,
Object object)
logsDirPath - the directory where the log will be writtenobject - the object requesting a logger
public static void main(String[] args)
args - contains command-line argumentspublic static void pause(int seconds)
seconds - The number of seconds to sleep
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||