Skip to content

[Core] Replace ResourceIterable with standard Java solutions #1820

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

Merged
merged 1 commit into from
Nov 17, 2019

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Nov 15, 2019

Summary

ResourceIterable provides inconsistent support for URI's.

Supported:

  • file:path/to.feature
  • classpath:com/example.feature
  • classpath:features.jar#!com/example.feature

Unsupported:

  • jar:path/to.jar#!/com/example.feature
  • any-jvm-supported-file-system:path/to.feature

Replacing ResourceIterable with an implementation that uses
FileSystem and Path adds consistent support for URI's
and reduces the complexity of scanning for classes and
resources significantly.

Both ClasspathScanner and ResourceScanner are instantiated with a
ClassLoader for all class path operations. This should allow Cucumber
access to platforms use fat jars and other packaging methods.

Fixes: #1526

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@coveralls
Copy link

coveralls commented Nov 15, 2019

Coverage Status

Coverage increased (+0.4%) to 87.72% when pulling 89a634e on refactor-resource-loading into 556fb3d on master.

@mpkorstanje mpkorstanje force-pushed the refactor-resource-loading branch from e2b5041 to aacd9b9 Compare November 16, 2019 11:23
`ResourceIterable` provides inconsistent support for URI's.

Supported:
 * file:path/to.feature
 * classpath:com/example.feature
 * classpath:features.jar#!com/example.feature

Unsupported:
 * jar:path/to.jar#!/com/example.feature
 * any-jvm-supported-file-system:path/to.feature

Replacing `ResourceIterable` with `FileSystem` and `Path` adds
consistent support for URI's and reduces the complexity of scanning
for classes and resources significantly.

Both `ClasspathScanner` and `ResourceScanner` are instantiated with a
ClassLoader for all class path operations. This should allow Cucumber
access to platforms use fat jars and other packaging methods.

Fixes: #1526
@mpkorstanje mpkorstanje force-pushed the refactor-resource-loading branch 3 times, most recently from 3bea34a to 89a634e Compare November 16, 2019 17:53
@mpkorstanje mpkorstanje marked this pull request as ready for review November 16, 2019 17:55
@mpkorstanje mpkorstanje added this to the 5.0.0 milestone Nov 16, 2019
@mpkorstanje mpkorstanje merged commit ce19e3b into master Nov 17, 2019
@mpkorstanje mpkorstanje deleted the refactor-resource-loading branch November 17, 2019 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace ResourceIterable with standard Java solutions
2 participants