Package org.djutils.logger
Class LoggerTest
java.lang.Object
org.djutils.logger.LoggerTest
LoggerTest.java.
Copyright (c) 2003-2025 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-2025 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 ClassesModifier and TypeClassDescriptionprotected static class
An extra logger call depth for the FQCN barrier test.protected static class
The in-memory StringAppender class for testing whether the correct information has been logged.protected static class
The factory to return a StringAppender. -
Constructor Summary
Constructors -
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
Test formatter and callback.void
Test FQCN barrier.void
Test setters and getters for log level and pattern.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)
-
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. -
testGetSetPerCategory
@Test public void testGetSetPerCategory()Test setters and getters for log level and pattern. -
testFormatterCallback
@Test public void testFormatterCallback()Test formatter and callback. -
testFqcnBarrier
@Test public void testFqcnBarrier()Test FQCN barrier.
-