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

Remove testInstance parameter from TestInstancePostProcessor #910

Closed
4 tasks done
sbrannen opened this issue Jul 2, 2017 · 3 comments
Closed
4 tasks done

Remove testInstance parameter from TestInstancePostProcessor #910

sbrannen opened this issue Jul 2, 2017 · 3 comments

Comments

@sbrannen
Copy link
Member

sbrannen commented Jul 2, 2017

Overview

Due to recent refactorings that made the test instance available in the ExtensionContext, a TestInstancePostProcessor now has two ways to access the test instance object in the postProcessTestInstance() method, thereby making the Object testInstance parameter superfluous.

Related Issues

Deliverables

  • Delete the Object testInstance parameter from TestInstancePostProcessor.postProcessTestInstance(Object, ExtensionContext).
  • Update all demo implementations accordingly.
  • Update Javadoc accordingly.
  • Add an entry in the M5 release notes.
@sbrannen sbrannen added this to the 5.0 M5 milestone Jul 2, 2017
@sbrannen sbrannen self-assigned this Jul 2, 2017
sbrannen added a commit that referenced this issue Jul 2, 2017
WARNING: This branch is a work in progress with failing tests.

Issue: #910
marcphilipp added a commit that referenced this issue Jul 3, 2017
Prior to this commit, TIPPs were always called with the
ClassExtensionContext. However, that only contained a test instance
when Lifecycle.PER_CLASS was in use. Now, the ExtensionContext the
instance is created for, e.g. the ExtensionContext of a test method
with the default lifecycle, is used.

Issue: #910
sbrannen pushed a commit that referenced this issue Jul 3, 2017
Prior to this commit, TIPPs were always called with the
ClassExtensionContext. However, that only contained a test instance
when Lifecycle.PER_CLASS was in use. Now, the ExtensionContext the
instance is created for, e.g. the ExtensionContext of a test method
with the default lifecycle, is used.

Issue: #910
sbrannen added a commit that referenced this issue Jul 3, 2017
sbrannen added a commit that referenced this issue Jul 3, 2017
Issue: #910
sbrannen pushed a commit that referenced this issue Jul 3, 2017
Prior to this commit, TIPPs were always called with the
ClassExtensionContext. However, that only contained a test instance
when Lifecycle.PER_CLASS was in use. Now, the ExtensionContext the
instance is created for, e.g. the ExtensionContext of a test method
with the default lifecycle, is used.

Issue: #910
sbrannen added a commit that referenced this issue Jul 3, 2017
Issue: #910
@sbrannen
Copy link
Member Author

sbrannen commented Jul 3, 2017

FYI: the current work on this issue is being performed in the following branch.

https://github.com/junit-team/junit5/tree/issues/910-remove-test-instance-from-TIPP

sbrannen added a commit that referenced this issue Jul 3, 2017
sbrannen added a commit that referenced this issue Jul 3, 2017
Issue: #910
sbrannen pushed a commit that referenced this issue Jul 3, 2017
Prior to this commit, TIPPs were always called with the
ClassExtensionContext. However, that only contained a test instance
when Lifecycle.PER_CLASS was in use. Now, the ExtensionContext the
instance is created for, e.g. the ExtensionContext of a test method
with the default lifecycle, is used.

Issue: #910
sbrannen added a commit that referenced this issue Jul 3, 2017
sbrannen added a commit that referenced this issue Jul 3, 2017
Prior to this set of commits, the test instance was made available to
the postProcessTestInstance() method of a TestInstancePostProcessor via
two mechanisms: directly via the `Object testInstance` parameter and
indirectly via the `getTestInstance()` method in the supplied
ExtensionContext parameter. Furthermore, the ExtensionContext supplied
to a TestInstancePostProcessor did not always represent the correct
level in the execution hierarchy and therefore did not always provide
access to the test instance.

This set of commits addresses these issues in the following ways.

- The superfluous testInstance parameter has been removed from the
  postProcessTestInstance() method in favor of accessing the test
  instance via the ExtensionContext.

- The correct, "current" ExtensionContext is now provided to
  TestInstancePostProcessor extensions thereby providing consistent
  access to the test instance.

Issue: #910
@sbrannen
Copy link
Member Author

sbrannen commented Jul 3, 2017

Merged into master in 1d30b76.

@sbrannen
Copy link
Member Author

sbrannen commented Jul 4, 2017

FYI: the work associated with this issue has been reverted in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant