| org.objectweb.util.monolog.TestHelper
All known Subclasses: org.objectweb.util.monolog.TestLogger, org.objectweb.util.monolog.TestConfigurability, org.objectweb.util.monolog.TestPw2Logger, org.objectweb.util.monolog.log4j.TestPattern, org.objectweb.util.monolog.file.monolog.TestPropertiesConfAccess, org.objectweb.util.monolog.TestIntermediateLevel, org.objectweb.util.monolog.TestAdditivity,
TestHelper | public class TestHelper extends TestCase (Code) | | This class is test helper which provides tool methods to check a log file.
It extends TestCase to support the use with JUnit.
author: Sebastien Chassande-Barrioz |
Method Summary | |
public void | assertInFileEquals(String message, String required) It checks that the last line of the default log file is equals to a
specified string. | public void | assertInFileEquals(String message, String filename, String required) It checks that the last line of the specified log file is equals to a
specified string. | public void | assertInFileEquals(String message, String[] required) It checks that the last lines of the default log file is equals to a
specified string string. | public void | assertInFileEquals(String message, String filename, String[] required) It checks that the last lines of the specified log file is equals to a
specified string string. | protected void | debug(String m) This methods is used to debug this helper. | public String[] | getFirstLines(int linenumber) Return the last lines of the default log file.
Parameters: linenumber - is the number of line which must be retrieved. | public String[] | getFirstLines(String filename, int linenumber) Return the first lines of the specified log file. | public String[] | getLastLines(int linenumber) Return the last lines of the default log file.
Parameters: linenumber - is the number of line which must be retrieved. | public String[] | getLastLines(String filename, int linenumber) Return the last lines of the specified log file. | public static TestSuite | getTestSuite(Class c, String[] methods, String params, String lfcn, String fn) It retrieves a test suite. | public static TestSuite | getTestSuite(Class c, String[] methods, String params, String lfcn) | public static void | main(String[] args) | public void | quietRootLogger() It removes all handlers of the root logger. | public static void | run(Class c, String[] methods, String params, String lfcn, String fn) It runs the test. | public static void | run(Class c, String[] methods, String params, String lfcn) It runs the test. | public void | setLoggerFactoryClassName(String lfcn) It assigns the LoggerFactory class name. | public void | setOutputFile(String filename) It assigns the default log file name. | protected void | setUp() |
SETTER_METHODS | final public static String[] SETTER_METHODS(Code) | | This constant field contains the list of the setter name needed to
initialize this class.
|
debug | static boolean debug(Code) | | |
fileName | protected String fileName(Code) | | The default file name specify by a setter method.
|
TestHelper | public TestHelper()(Code) | | |
assertInFileEquals | public void assertInFileEquals(String message, String required)(Code) | | It checks that the last line of the default log file is equals to a
specified string.
Parameters: message - is the error message if the string is not found. Parameters: required - is the string which must be file in the default log file |
assertInFileEquals | public void assertInFileEquals(String message, String filename, String required)(Code) | | It checks that the last line of the specified log file is equals to a
specified string.
Parameters: message - is the error message if the string is not found. Parameters: filename - is the log file name Parameters: required - is the string which must be file in the default log file |
assertInFileEquals | public void assertInFileEquals(String message, String[] required)(Code) | | It checks that the last lines of the default log file is equals to a
specified string string.
Parameters: message - is the error message if the string array is not found. Parameters: required - is the string array which must be file in the defaultlog file. |
assertInFileEquals | public void assertInFileEquals(String message, String filename, String[] required)(Code) | | It checks that the last lines of the specified log file is equals to a
specified string string.
Parameters: message - is the error message if the string array is not found. Parameters: filename - is the log file name Parameters: required - is the string array which must be file in the defaultlog file. |
debug | protected void debug(String m)(Code) | | This methods is used to debug this helper.
|
getFirstLines | public String[] getFirstLines(int linenumber)(Code) | | Return the last lines of the default log file.
Parameters: linenumber - is the number of line which must be retrieved. a string array which matches to the last line. |
getFirstLines | public String[] getFirstLines(String filename, int linenumber)(Code) | | Return the first lines of the specified log file.
Parameters: linenumber - is the number of line which must be retrieved. Parameters: filename - is the log file name a string array which matches to the last line. |
getLastLines | public String[] getLastLines(int linenumber)(Code) | | Return the last lines of the default log file.
Parameters: linenumber - is the number of line which must be retrieved. a string array which matches to the last line. |
getLastLines | public String[] getLastLines(String filename, int linenumber)(Code) | | Return the last lines of the specified log file.
Parameters: linenumber - is the number of line which must be retrieved. Parameters: filename - is the log file name a string array which matches to the last line. |
quietRootLogger | public void quietRootLogger()(Code) | | It removes all handlers of the root logger.
|
setLoggerFactoryClassName | public void setLoggerFactoryClassName(String lfcn)(Code) | | It assigns the LoggerFactory class name. This method tries to get an
instance with this class name.
|
setOutputFile | public void setOutputFile(String filename)(Code) | | It assigns the default log file name.
|
|
|