Skip to content
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

Add FilePosition in FileSelector and ClasspathResourceSelector #2253

Merged
merged 29 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
49b8684
Support FilePosition in FileSelector & ClasspathResourceSelector
Apr 5, 2020
a65fb00
Add JavaDoc
Apr 5, 2020
6d8fe26
Add constructor unit tests
Apr 5, 2020
612df8e
Move, duplicate & deprecate FilePosition as suggested
Apr 10, 2020
71130a6
Move FilePositionTests and have it extend AbstractEqualsAndHashCodeTests
Apr 10, 2020
2c5ece1
Add FileSelector DiscoverySelectors with arguments for line and column
Apr 10, 2020
95557dd
Cover selectFile and selectClasspathResource with file position
Apr 10, 2020
1202335
Add position in toString
Apr 10, 2020
98a361a
Apply spotless
Apr 10, 2020
f8b14c1
Address review comments regarding FilePosition classes
Apr 10, 2020
092ff61
Optional return types for nullable position
Apr 10, 2020
2520537
Take FilePosition as argument in DiscoverySelectors as suggested
Apr 10, 2020
fb9cec7
Adapt tests to use FilePosition arguments and Optional return types
Apr 10, 2020
decb669
Adopt public static Optional<? extends FilePosition> fromQuery in parent
Apr 10, 2020
a768cf4
Add alternative getFilePosition() and restore getPosition() return type
Apr 11, 2020
dd3d8f7
Deprecate FileSource/ClasspathResourceSource getPosition() methods
Apr 11, 2020
f80fcb9
Also restore original arguments to Source from methods
Apr 11, 2020
147ea9d
Restore original argument to ClassSource.from method
Apr 11, 2020
528ea87
Merge branch 'master' of github.com:junit-team/junit5
May 2, 2020
0a14c1b
Revert changes to org.junit.platform.engine.support.descriptor package
May 2, 2020
5baa390
Create a copy of FilePosition without further modifier/generics changes
May 2, 2020
e996f17
Make FilePosition fields in Selectors final
May 2, 2020
28cbaea
Update release notes
May 2, 2020
296cddb
Merge branch 'master' into master
timtebeek May 6, 2020
267ef71
Apply suggestions from code review
May 16, 2020
40bc12a
Delegate selectFile/selectClasspath methods to copy with FilePosition
May 16, 2020
50ba225
Remove constructors without FilePosition; Update tests to match
May 16, 2020
1910558
Separate tests for DiscoverySelectors with FilePosition argument
May 16, 2020
2fbc96d
Update platform-tests/src/test/java/org/junit/platform/engine/discove…
May 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove constructors without FilePosition; Update tests to match
  • Loading branch information
Tim te Beek committed May 16, 2020
commit 50ba2252d2aec321531855e50675c4d0c9531b9f
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public class ClasspathResourceSelector implements DiscoverySelector {
private final String classpathResourceName;
private final FilePosition position;

ClasspathResourceSelector(String classpathResourceName) {
this(classpathResourceName, null);
}

ClasspathResourceSelector(String classpathResourceName, FilePosition position) {
boolean startsWithSlash = classpathResourceName.startsWith("/");
this.classpathResourceName = (startsWithSlash ? classpathResourceName.substring(1) : classpathResourceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public class FileSelector implements DiscoverySelector {
private final String path;
private final FilePosition position;

FileSelector(String path) {
this(path, null);
}

FileSelector(String path, FilePosition position) {
this.path = path;
this.position = position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class ClasspathResourceSelectorTests extends AbstractEqualsAndHashCodeTests {

@Test
void equalsAndHashCode() {
var selector1 = new ClasspathResourceSelector("/foo/bar.txt");
var selector2 = new ClasspathResourceSelector("/foo/bar.txt");
var selector3 = new ClasspathResourceSelector("/foo/X.txt");
var selector1 = new ClasspathResourceSelector("/foo/bar.txt", null);
var selector2 = new ClasspathResourceSelector("/foo/bar.txt", null);
var selector3 = new ClasspathResourceSelector("/foo/X.txt", null);

assertEqualsAndHashCode(selector1, selector2, selector3);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class FileSelectorTests extends AbstractEqualsAndHashCodeTests {

@Test
void equalsAndHashCode() {
var selector1 = new FileSelector("/example/foo.txt");
var selector2 = new FileSelector("/example/foo.txt");
var selector3 = new FileSelector("/example/bar.txt");
var selector1 = new FileSelector("/example/foo.txt", null);
var selector2 = new FileSelector("/example/foo.txt", null);
var selector3 = new FileSelector("/example/bar.txt", null);

assertEqualsAndHashCode(selector1, selector2, selector3);
}
Expand Down