Package org.djutils.logger
Class LoggerTest
- java.lang.Object
-
- org.djutils.logger.LoggerTest
-
public class LoggerTest extends Object
LoggerTest.java.
Copyright (c) 2003-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.- Author:
- Alexander Verbraeck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
LoggerTest.StringWriter
...
-
Constructor Summary
Constructors Constructor Description LoggerTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
loggerTest()
Test whether Logger works correctly.void
testAllLogLevels()
Test varying the logging level for the AllLogLevel levels.void
testAllLogMessageFormat()
Test varying the default message format for all writers.void
testFilterOnCategories()
Filter with multiple categories.void
testWriterLogLevels()
Test varying the logging level per writer, when AllLogLevels is different.void
testWriterLogMessageFormat()
Test varying the message format for individual writers.
-
-
-
Method Detail
-
loggerTest
public final void loggerTest()
Test whether Logger works correctly.
-
testAllLogLevels
public void testAllLogLevels() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
Test varying the logging level for the AllLogLevel levels.- Throws:
SecurityException
- when a logging method can not be found (should not happen)NoSuchMethodException
- when a logging method can not be found (should not happen)InvocationTargetException
- when calling a logging method through reflection fails (should not happen)IllegalArgumentException
- when calling a logging method through reflection fails (should not happen)IllegalAccessException
- when calling a logging method through reflection fails (should not happen)
-
testWriterLogLevels
public void testWriterLogLevels() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
Test varying the logging level per writer, when AllLogLevels is different. The way CategoryLogger has been set up, the Writer's log level should always take precedence of the default log level, independent on the relative ranking of the writer's log level and the default log level.- Throws:
SecurityException
- when a logging method can not be found (should not happen)NoSuchMethodException
- when a logging method can not be found (should not happen)InvocationTargetException
- when calling a logging method through reflection fails (should not happen)IllegalArgumentException
- when calling a logging method through reflection fails (should not happen)IllegalAccessException
- when calling a logging method through reflection fails (should not happen)
-
testFilterOnCategories
public void testFilterOnCategories()
Filter with multiple categories.
-
testAllLogMessageFormat
public void testAllLogMessageFormat()
Test varying the default message format for all writers.
-
testWriterLogMessageFormat
public void testWriterLogMessageFormat()
Test varying the message format for individual writers. The writer's message format always takes precedence over the default message format.
-
-