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

Create new temporary directory/resource extension #491

Merged
merged 155 commits into from Nov 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
19ec9cc
WIP - initial work towards issue #348
jbduncan May 29, 2021
d614f4f
WIP - reorganise tests
jbduncan Jul 8, 2021
5b69238
WIP - only handle @New-annotated params, and ensure exceptions thrown…
jbduncan Jul 10, 2021
fb440d4
WIP - improve test names
jbduncan Jul 10, 2021
6c2fc53
WIP - improve test organisation
jbduncan Jul 10, 2021
ec77553
WIP - add new test for test method with multiple @New-annotated params
jbduncan Jul 11, 2021
1882972
WIP - expand test to confirm that using @New on constructor param cre…
jbduncan Jul 11, 2021
90bec0f
WIP - simplify @ExtendWith(ResourceManagerExtension.class) to @Resources
jbduncan Jul 11, 2021
323750f
WIP - add test that checks behaviour when ::resolveParameter fails to…
jbduncan Jul 12, 2021
8012ae7
WIP
jbduncan Jul 12, 2021
55df7ad
WIP - cleanup
jbduncan Jul 12, 2021
f428367
WIP - cleanup
jbduncan Jul 12, 2021
402242e
WIP - finish test coverage for ResourceManagerExtension on @New-annot…
jbduncan Jul 12, 2021
5ba9284
WIP - allow ResourceFactorys to have non-default constructors that ac…
jbduncan Jul 16, 2021
222dfac
WIP - cleanup in response to review
jbduncan Aug 4, 2021
534775c
WIP - use AtomicLong instead of System::identityHashCode
jbduncan Aug 5, 2021
77536bc
WIP - satisfy more TODOs
jbduncan Aug 6, 2021
5bcbdf1
WIP - cleanup
jbduncan Aug 7, 2021
50659db
WIP - first test for @Shared
jbduncan Aug 8, 2021
cc52a5d
WIP - cleanup
jbduncan Aug 8, 2021
9466e18
WIP - another test for @Shared
jbduncan Aug 8, 2021
300d69b
WIP - another test for @Shared
jbduncan Aug 14, 2021
7ea7a17
WIP - remove redundant TODO
jbduncan Aug 16, 2021
b7eb75d
WIP - Add new test for @Shared, to prevent a potential regression
jbduncan Aug 20, 2021
258c6e0
WIP - cleanup, and add new test for @Shared to prevent potential regr…
jbduncan Aug 21, 2021
ee65ed3
WIP - ensure a param can't have both @New and @Shared
jbduncan Aug 21, 2021
6c38c4a
WIP - add a commented-out test to potentially support field injection…
jbduncan Aug 21, 2021
037bea1
WIP - remove satisfied TODO comment
jbduncan Aug 21, 2021
fc77068
WIP - handle more kinds of exceptions, and further cleanup
jbduncan Sep 4, 2021
2fd5ee0
WIP - use allEvents() consistently, and further cleanup
jbduncan Sep 4, 2021
858b585
WIP - prevent test cases from immediately deleting temp file, to add …
jbduncan Sep 17, 2021
d0594f3
Fix a TODO and add another
jbduncan Sep 17, 2021
4816f43
WIP - Make sure no IOEs are thrown if a file/dir is deleted before Te…
jbduncan Sep 24, 2021
85d3b46
WIP - add a test case for when two @Shared resources with the same na…
jbduncan Sep 26, 2021
5d7bf56
WIP - remove unnecessary test
jbduncan Oct 3, 2021
5e231e2
WIP - remove TODOs and unused imports
jbduncan Oct 8, 2021
16c7ba5
WIP - prevent .tool-versions from being committed
jbduncan Oct 8, 2021
63c40d2
WIP - add new test for wrong number of arguments passed to TemporaryD…
jbduncan Oct 8, 2021
2defa3e
WIP - remove TODO
jbduncan Oct 8, 2021
f3e44ef
WIP - remove the need for ResourceManagerExtension to be applied to a…
jbduncan Oct 8, 2021
c792dae
WIP - Introduce @Dir annotation
jbduncan Oct 15, 2021
90631f1
WIP - Make @Shared usable as a meta-annotation as well
jbduncan Oct 15, 2021
62af6dd
WIP - revert test for an especially unlikely edge case, as the test i…
jbduncan Oct 15, 2021
2ec5798
WIP - cleanup
jbduncan Oct 15, 2021
ace5dcd
WIP - check that if two or more parameters in a test method are annot…
jbduncan Oct 15, 2021
b54ccd7
WIP - cleanup
jbduncan Oct 15, 2021
5ad4f3e
WIP - fix concurrency bug
jbduncan Oct 15, 2021
c817292
WIP - start to make the extension thread-safe - done with @nipafx thr…
jbduncan Nov 11, 2021
9f7a030
WIP - expand a TODO comment
jbduncan Nov 11, 2021
266b09f
WIP - fix bug with ResourceWithLock
jbduncan Nov 19, 2021
49bd1d6
WIP - cleanup
jbduncan Nov 19, 2021
6de8b4e
WIP - attempt to write a test that confirms we do not suffer from the…
jbduncan Nov 21, 2021
4c95c78
WIP - cleanup
jbduncan Nov 26, 2021
70cdbc6
WIP - cleanup
jbduncan Nov 26, 2021
576fc5b
WIP - run resource-using test factories, dynamic tests and test templ…
jbduncan Nov 26, 2021
337e7eb
WIP - cleanup
jbduncan Nov 29, 2021
3fd5ddd
WIP - run @Shared-annotated test class constructors sequentially
jbduncan Dec 1, 2021
849cd27
WIP - fix all TODOs, run remaining lifecycle methods sequentially
jbduncan Dec 9, 2021
297ea02
WIP - replace repeated tests with normal tests, as they were only nee…
jbduncan Dec 9, 2021
e2d0797
WIP - fix CI
jbduncan Dec 9, 2021
a1ff47b
WIP - split ResourcesTests into multiple test classes for maintainabi…
jbduncan Dec 9, 2021
cf0ca01
WIP - split ResourcesTests into multiple test classes for maintainabi…
jbduncan Dec 9, 2021
c061d65
WIP - comment fixup
jbduncan Dec 9, 2021
83629c1
WIP - use 'TestCases' over 'TestCase' as per https://github.com/junit…
jbduncan Dec 9, 2021
26c58e2
WIP - move to new package, and fixup package-info.java to follow the …
jbduncan Dec 12, 2021
64a6b5a
Add tests for file/directory deletions
Dec 23, 2021
382cb67
[WIP] Touch up resource extension
Dec 23, 2021
06c7be5
WIP - fix failing test
jbduncan Jan 7, 2022
cab6c9d
WIP - first draft for resource/package-info.java and amendment to doc…
jbduncan Jan 7, 2022
39c620e
WIP - Get the skeletons of the resource extension's docs out there
jbduncan Jan 7, 2022
bc3dc6f
Remove reverse unlock
Feb 3, 2022
388c467
Edit Javadoc
Feb 3, 2022
3103727
Address some reviewer feedback
jbduncan Feb 13, 2022
9133f80
Address some reviewer feedback
jbduncan Feb 13, 2022
09f4d60
Address reviewer feedback on the API - allow users to define how long…
jbduncan Feb 18, 2022
a5754b0
WIP - remove commented-out code
jbduncan Feb 18, 2022
fdef24f
WIP - improve confidence in tests for Scope.SOURCE_FILE
jbduncan Mar 2, 2022
592af19
WIP - write up first bit of docs: the reason why this extension exists
jbduncan Mar 2, 2022
de6333e
WIP - improve documentation outline
Apr 10, 2022
35077cb
WIP - cleanup docs a bit
jbduncan Apr 23, 2022
5022e75
WIP - document how to create @New resources
jbduncan May 21, 2022
cd62a1e
Add required package info
May 25, 2022
3908c75
Add serial version UID to `UncheckedParameterResolutionException`
May 25, 2022
cf84036
Fix copyright notices
May 25, 2022
6e86104
Format demo code
May 25, 2022
1f54bde
WIP - document how to create @Shared resources
jbduncan May 29, 2022
8e71e6d
WIP - Finish drafting resources.adoc
jbduncan Jun 1, 2022
8a1ef89
WIP - docs cleanup
jbduncan Jun 1, 2022
7f73fe0
WIP - draft intro and thread-safety note for temporary directories
jbduncan Jun 1, 2022
73eeaa1
Finish documenting shared resources
jbduncan Jun 1, 2022
74f9610
Finish all TODOS
jbduncan Jun 1, 2022
8886eec
Add caveat to documentation
jbduncan Jun 1, 2022
75338a0
Merge branch 'main' into issue/348-resource-manager
jbduncan Jun 1, 2022
fbd5ef3
WIP - cleanup docs
jbduncan Jun 1, 2022
8ec5a41
WIP - fixup docs-nav.yml
jbduncan Jun 1, 2022
a26baeb
WIP - whoops, @Shared isn't supposed to have arguments anymore
jbduncan Jun 2, 2022
2daf566
Improve documentation
Jul 7, 2022
e751657
Who wants to guess?
Jul 7, 2022
2520efe
Fix typo
jbduncan Jul 18, 2022
2f95783
Rename DirTests.java to TemporaryDirectoryDirTests.java
jbduncan Jul 18, 2022
cbba227
WIP - give better error message if @New ResourceFactory::create retur…
jbduncan Jul 25, 2022
ae2de00
WIP - give better error message if @Shared ResourceFactory::create re…
jbduncan Jul 25, 2022
9e32f74
WIP - remove dead code
jbduncan Jul 27, 2022
8c3821b
WIP - give better error message if Resource::get returns null
jbduncan Jul 27, 2022
c7a2dbf
WIP - ensure that @New parameters call ResourceFactory::create once each
jbduncan Jul 27, 2022
192a063
WIP - refactoring
jbduncan Jul 27, 2022
5ab5f38
WIP - apply feedback
jbduncan Aug 23, 2022
620900b
WIP - fix non-deterministic bug related to running tests in parallel
jbduncan Aug 23, 2022
436303a
WIP - address feedback
jbduncan Aug 24, 2022
fedd6d4
WIP - address feedback
jbduncan Aug 24, 2022
eeb123e
WIP - eliminate MorePaths for simplicity
jbduncan Aug 24, 2022
c72d7f0
Remove comments on test class/case organization
Sep 13, 2022
a943d63
Reformat and rewrite error messages
Sep 13, 2022
18a3a11
Reformat Spotless-avoiding comments (empty "//")
Sep 13, 2022
33803b5
Rename test case classes and methods
Sep 13, 2022
6fa2bfa
Refactor code and rewrite comments on dining philosophers
Sep 13, 2022
df96538
Move static field around
Sep 13, 2022
6771094
I RAN SPOTLESS BEFORE, COMMITTING I SWEAR!
Sep 13, 2022
d3065be
WIP - tidy comment and shorten method name
jbduncan Sep 14, 2022
1297ceb
Merge branch 'main' of https://github.com/junit-pioneer/junit-pioneer…
Michael1993 Sep 27, 2022
935be84
Add missing requires directive to test module-info
Michael1993 Sep 27, 2022
8e935a3
Merge branch 'main' of https://github.com/junit-pioneer/junit-pioneer…
Michael1993 Sep 28, 2022
b1daf18
Potentially fix modular setup for test using a plugin
Michael1993 Sep 28, 2022
b4fd70d
Do not invoke on non modular builds
Michael1993 Sep 28, 2022
03bb47d
WIP - address some review feedback
jbduncan Oct 12, 2022
81b8480
WIP - address some review feedback and apply Spotless
jbduncan Oct 12, 2022
3cbab7b
WIP - address some review feedback
jbduncan Oct 12, 2022
8b8291e
WIP - address some review feedback
jbduncan Oct 12, 2022
5f1b12e
WIP - address some review feedback
jbduncan Oct 12, 2022
7b4c0f3
WIP - address some review feedback
jbduncan Oct 12, 2022
acf85fb
WIP - improve error messages
jbduncan Oct 12, 2022
20708c2
WIP - address some review feedback
jbduncan Oct 12, 2022
0b45703
WIP - address some review feedback
jbduncan Oct 12, 2022
627d44a
WIP - apply Spotless
jbduncan Oct 12, 2022
905b25e
Double WIP - added a proper test for parallelism w.r.t. @BeforeEach m…
jbduncan Oct 12, 2022
2cc1ba0
WIP - fix parallelism w.r.t. @BeforeEach, and introduce failing test …
jbduncan Oct 13, 2022
108a7ed
WIP - fix parallelism w.r.t. @AfterEach
jbduncan Nov 6, 2022
6044212
WIP - introduce failing tests and a hopefully helpful TODO comment fo…
jbduncan Nov 7, 2022
cfbb5b8
WIP - Fix the 'heisenbug'
jbduncan Nov 8, 2022
2902217
WIP - refactoring
jbduncan Nov 8, 2022
9788022
WIP - review feedback: move Path assertion to org.junitpioneer.testki…
jbduncan Nov 8, 2022
43ef4fd
WIP - review feedback: change and simplify PioneerPathAssert
jbduncan Nov 8, 2022
88445d4
Spotless? Never heard of it. ;)
jbduncan Nov 8, 2022
318dc52
WIP - improve grammar of a comment
jbduncan Nov 8, 2022
df8e489
WIP - fix wording in docs
jbduncan Nov 8, 2022
3dfd00b
WIP - add a couple of TODOs
jbduncan Nov 9, 2022
bf3da55
Make `PioneerAssert` entry point for all custom assertions
Nov 9, 2022
8b7e9fc
Rename `PioneerAssert::assertThatPath` to `assertThat`
Nov 10, 2022
25a412f
WIP - add warning to the docs
jbduncan Nov 13, 2022
8c8d003
WIP - address one TODO and remove another that now seems unnecessary
jbduncan Nov 13, 2022
ec99827
WIP - add @since attributes as per code review, as well as more JavaD…
jbduncan Nov 13, 2022
e9ae084
WIP - MOAR JAVADOC
jbduncan Nov 13, 2022
56268ee
Small edits to Javadoc
Nov 14, 2022
d652aba
Merge branch 'main' into issue/348-resource-manager
Nov 14, 2022
c4d9e0f
I even ran Spotless but then forgot to add before committing! 😭
Nov 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -209,6 +209,7 @@ private Resource<?> newResource(Object newOrSharedAnnotation, ResourceFactory<?>

private void throwIfHasAnnotationWithSameNameButDifferentType(ExtensionContext.Store store,
nipafx marked this conversation as resolved.
Show resolved Hide resolved
Shared sharedAnnotation) {
// TODO: throw if has annotation with same name but different scope
jbduncan marked this conversation as resolved.
Show resolved Hide resolved
ResourceFactory<?> presentResourceFactory = //
store.getOrDefault(factoryKey(sharedAnnotation), ResourceFactory.class, null);

Expand All @@ -233,6 +234,8 @@ private void throwIfHasAnnotationWithSameNameButDifferentType(ExtensionContext.S
}

private void throwIfMultipleParametersHaveExactAnnotation(Parameter[] parameters, Shared sharedAnnotation) {
// TODO: throw if multiple parameters have @Shared annotations with not just the same
// name and factory type but the same scope too?
jbduncan marked this conversation as resolved.
Show resolved Hide resolved
long parameterCount = //
Arrays.stream(parameters).filter(parameter -> hasAnnotation(parameter, sharedAnnotation)).count();
if (parameterCount > 1) {
Expand Down