-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ModuleClassLoader to optionally delegate class-loading to parent #60
Conversation
So, principally, I understand this idea. |
No since this should also apply to testing libraries added by users in userdev, and we cannot know those packages/libraries apriori. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have thought about this for a while.
Allthough I am convinced that the JUnit API provides other, more standardized, ways of doing testing in a modularly isolated environment, right now we do not have the time.
As such this is at least a bridge and a gap to allow for this to work.
However, since I want to be clear that this should not be used in production, what so ever, I want a very load warning in the source code, in the form of previously mentioned annotations and documentation. As well as, a very loud warning in a log file!
Please add those and then this is good.
…testing without class-loader isolation.
The goal is to add a new entrypoint to https://github.com/McModLauncher/bootstraplauncher for JUnit runners, which disables classloader isolation. This change adds the needed constructor to ModuleClassLoader to enable that.
This is used to allow test-classes to live in the GAME layer, while still loading JUnit and other testing library classes found on the normal classpath. When being run by a unit testing framework, we do not control the JVM entrypoint like we normally do, and Gradle for example will class-load JUnit before calling any other hook. Our test classes need to refer to those same loaded classes, making it easier if isolation is disabled in such scenarios.