You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/12/26 14:33:03 UTC

[GitHub] [logging-log4j2] garydgregory edited a comment on pull request #658: Fix tests not restoring system properties

garydgregory edited a comment on pull request #658:
URL: https://github.com/apache/logging-log4j2/pull/658#issuecomment-1001191452


   > > The issue is that currently some tests are still using JUnit 4. For that there is the [System Rules](https://github.com/stefanbirkner/system-rules) project, but I did not want to add two separate extensions / rules without knowing what the migration plans are.
   > 
   > As @garydgregory noted, all tests need to be migrated to JUnit 5. Given this, maybe we can leverage [system-stubs](https://github.com/webcompere/system-stubs)?
   
   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. Since sys props is global, having the annotation also use a global would be OK. One could also imagine saving and restoring named savepoints, like in a database transaction, `@SaveSystemProperties("Savepoint1")`. Such a thing does not exist, but we can write it, just like we have custom JUnit 4 rules.
    


-- 
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-unsubscribe@logging.apache.org

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