Testing a FormatterStep often involves test resources similar to the following:
java/eclipse/format/JavaCodeUnformatted.test
java/eclipse/format/JavaCodeFormatted.test
java/eclipse/format/formatter.properties
The location of these resources is currently unpredictable and sometimes duplicated. This is how it works right now:
- if the FormatterStep lives in
lib, then the test resources are in testlib/src/test/resources
- if the FormatterStep lives in
lib-extra, then the test resources are in lib-extra/src/test/resources
- if we're doing an integration test for gradle or maven, then we copy those files into
plugin-gradle/src/test/resources, where they will likely rot.
In the future, I think that we ought to make the following changes:
- move
testlib/src/test/resources to testlib/src/main/resources
- move
lib-extra/src/test/resources to testlib/src/main/resources/extra
- delete all FormatterStep-specific test resources from
plugin-gradle and plugin-maven, because we can grab them instead from testlib.
The downside to this is that testlib will get ~100kb bigger, and have some published content that's really just for testing. The upside is that testlib is really just for testing Spotless steps and plugins anyway, and it will reduce duplication and rot.
This is a super-merge-conflict-y kind of change, so I'll do it all at once after the maven-plugin branch is merged. I think there might be a related opportunity to merge integration tests between gradle and maven, so that we can generate the feature-matrix semi-automatically:

This isn't a pressing change - feel free to contribute whatever PR's you have as-is, using the existing schema. At some point in the future I'll send in this mega-merge. If you've got objections, feel free to speak up, lots of time :)
Testing a FormatterStep often involves test resources similar to the following:
java/eclipse/format/JavaCodeUnformatted.testjava/eclipse/format/JavaCodeFormatted.testjava/eclipse/format/formatter.propertiesThe location of these resources is currently unpredictable and sometimes duplicated. This is how it works right now:
lib, then the test resources are intestlib/src/test/resourceslib-extra, then the test resources are inlib-extra/src/test/resourcesplugin-gradle/src/test/resources, where they will likely rot.In the future, I think that we ought to make the following changes:
testlib/src/test/resourcestotestlib/src/main/resourceslib-extra/src/test/resourcestotestlib/src/main/resources/extraplugin-gradleandplugin-maven, because we can grab them instead fromtestlib.The downside to this is that testlib will get ~100kb bigger, and have some published content that's really just for testing. The upside is that testlib is really just for testing Spotless steps and plugins anyway, and it will reduce duplication and rot.
This is a super-merge-conflict-y kind of change, so I'll do it all at once after the maven-plugin branch is merged. I think there might be a related opportunity to merge integration tests between gradle and maven, so that we can generate the feature-matrix semi-automatically:
This isn't a pressing change - feel free to contribute whatever PR's you have as-is, using the existing schema. At some point in the future I'll send in this mega-merge. If you've got objections, feel free to speak up, lots of time :)