Description

Spurred by #16622, this "multi-version" functionality was not exercised by any tests. As ever when writing tests of the plugin handling code, I found an amount of probably-not-ideal behaviour which this now at least documents.

To make this easier, in these patches I introduced a basic mechanism for being able to override JOSMTestRules settings on a per-test-method basis using annotations. I only used the annotation @JOSMTestRules.OverrideAssumeRevision in these tests, but I also added @JOSMTestRules.OverrideTimeout as I saw it as something that could be immediately useful and was a good example of how this pattern could be continued to useful ends.

The caveats here are that it will only ever be possible to "add" additional options to the rule in the same way options can be appended to a call chain already (because they're processed using the same mechanism). Annotations can also only ever take primitive types as arguments (so no specifying new .fakeImagery(TileSourceRule ...) arguments)

The caveats here are that it will only ever be possible to "add" additional options to the rule in the same way options can be appended to a call chain already (because they're processed using the same mechanism). Annotations can also only ever take primitive types as arguments (so no specifying new .fakeImagery(TileSourceRule ...) arguments)

After I'd written the test I realized I didn't need to actually serve it at all as it wasn't destined to be the downloaded version or the version whose metadata was used in the listing. But I didn't remove it because I'd gone to the bother to generate four mock plugins which is a bit of a chore to do, so didn't remove the extra one because it hypothetically is used in a more complete version of this test (which doesn't exist yet).

Add Comment

This ticket has been modified since you started editing. You should review the
other modifications which have been appended above,
and any conflicts shown in the preview below.
You can nevertheless proceed and submit your changes if you wish so.