ppkarwasz commented on PR #1214:
URL: https://github.com/apache/logging-log4j2/pull/1214#issuecomment-1386639067

   `StackLocator` is a complex feature with several different paths, so maybe 
I'll add a cheatsheet for the unity tests:
   
    * the 
[`StackLocator#getCurrentStackTrace`](https://github.com/apache/logging-log4j2/blob/543bc664a88558f5a0bb523cbe7bbbc448e8d0e5/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/StackLocator.java#L84)
 version in `log4j-api-java9` is used when running Java 9+. The tests are in 
the same module.
    * the 
[`StackLocator#getCurrentStackTrace`](https://github.com/apache/logging-log4j2/blob/543bc664a88558f5a0bb523cbe7bbbc448e8d0e5/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java#L197)
 version in `log4j-api` is used when running Java 8. It uses two 
implementations:
      * the _fast path_ provided by 
[`PrivateSecurityManagerStackTraceUtil`](https://github.com/apache/logging-log4j2/blob/543bc664a88558f5a0bb523cbe7bbbc448e8d0e5/log4j-api/src/main/java/org/apache/logging/log4j/util/PrivateSecurityManagerStackTraceUtil.java#L65)
 needs to be tested in the `log4j-api-test` module (in a "normal" `*Test` 
class),
      * the _slow path_ requires running the test with a security manager 
enabled. The test should be in the `log4j-api-test` module and be named `*IT`. 
The reason behind this is that "normal" tests in `log4j-api-test` run in 
parallel. Setting a security manager is a very disruptive operation, so we have 
a second test execution that runs `*IT` classes with a JVM-per-test 
configuration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to