Package org.djutils.logger
Class LoggerTest
java.lang.Object
org.djutils.logger.LoggerTest
LoggerTest.java.
Copyright (c) 2003-2024 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.
Copyright (c) 2003-2024 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Test whether Logger works correctly.void
Test varying the logging level for the AllLogLevel levels.void
Test varying the default message format for all writers.void
Filter with multiple categories.void
Test varying the logging level per writer, when AllLogLevels is different.void
Test varying the message format for individual writers.
-
Constructor Details
-
LoggerTest
public LoggerTest()
-
-
Method Details
-
loggerTest
@Test public final void loggerTest()Test whether Logger works correctly. -
testAllLogLevels
@Test public void testAllLogLevels() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetExceptionTest 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
@Test public void testWriterLogLevels() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetExceptionTest 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
@Test public void testFilterOnCategories()Filter with multiple categories. -
testAllLogMessageFormat
@Test public void testAllLogMessageFormat()Test varying the default message format for all writers. -
testWriterLogMessageFormat
@Test public void testWriterLogMessageFormat()Test varying the message format for individual writers. The writer's message format always takes precedence over the default message format.
-