Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I mainly changed the
WeldFactory
to create a single WeldContainer instance per factory, using the Weld builder.Details
The WeldFactory is no longer a subclass of the Weld builder class. It uses now a private member of type WeldContainer to hold a single weld container instance per factory (scenario).
The instance is created in the start method by using the weld builder method initialize and released in the stop method with the close method.
The resolving of class types in the getInstance method is also simplified, because it can use the select method directly on the container instance.
Motivation and Context
I've come to develop this change as described in issue #1165. See this issue for details.
How Has This Been Tested?
The fix uses the scenario tests in cukes.feature as well as the WeldFactoryTest within the cucumber-weld module to prove it's effectiveness.
The fix was tested using the 'mvn clean test' command on Windows 10 using an Oracle JDK8
There should be no impact on other parts of the cucumber code, due to the fact that only internal details within the WeldFactoryTest are changed.
But keep in mind, that the fix cannot be used with the Weld SE version 2.3.5.Final and is therefore not backward compatible to this version. This should be mentioned in the release notes, if applicable.
Types of changes
Checklist: