farkhalit commented on PR #432:
URL: https://github.com/apache/commons-cli/pull/432#issuecomment-5339281774

   Right, the earlier tests only exercised the converter. Added 
`testClassNotInitializedThroughPublicApi`, which goes through the public API 
end to end: build the options with `PatternOptionBuilder.parsePattern("c+")`, 
parse `-c <class name>` with `DefaultParser`, and pull the value with 
`line.getParsedOptionValue("c")`. After parsing and querying it asserts the 
class's initializer has not run, then runs the 
`Plugin.class.isAssignableFrom(cls)` gate and asserts it still hasn't. Only 
`cls.getConstructor().newInstance()` flips the flag. Uses its own marker type 
so no other test can initialize it first. Fails on master, passes with the 
change.


-- 
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