beatngu13 commented on PR #658:
URL: https://github.com/apache/logging-log4j2/pull/658#issuecomment-1909041730

   Hey @vy & @garydgregory,
   
   JUnit Pioneer maintainer here. ✌️ I know this PR is old and the problem it 
was trying to solve might not relevant anymore, but regarding:
   
   > The reason I did not mention about `system-properties` of JUnit Pioneer is 
that it operates on an input list of properties, whereas I want to restore 
_all_ properties back to their original values. I think the former approach is 
more error-prone and there is no way to tell if a property was leaked.
   
   And:
   
   >The system stubs warning about Java16+ is not great and it seems like it's 
not really doing things as simple as I'd like to see. The JUnit Pioneer is cool 
but too minimal in feature. What I want is something like an 
@SaveSystemProperties and @RestoreSystemProperties and I do not think you need 
to do whatever reflection system stubs does.
   
   As of Pioneer 2.1.0, there is `@RestoreSystemProperties`. From the 
[docs](https://junit-pioneer.org/docs/system-properties/#restoresystemproperties):
   
   >`@RestoreSystemProperties` can be used to restore changes to system 
properties made directly in code. While `@ClearSystemProperty` and 
`@SetSystemProperty` set or clear specific properties and values, they don’t 
allow property values to be calculated or parameterized, thus there are times 
you may want to directly set properties in your test code. 
`@RestoreSystemProperties` can be placed on test methods or test classes and 
will completely restore all system properties to their original state after a 
test or test class is complete.


-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to