Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Add sample code for child contexts in test methods - #110

Merged
sbrannen merged 1 commit into
spring-attic:masterfrom
dsyer:SPR-12031
Oct 17, 2015
Merged

sbrannen merged 1 commit into
spring-attic:masterfrom
dsyer:SPR-12031

Conversation

@dsyer

@dsyer dsyer commented Oct 16, 2015

Copy link
Copy Markdown

I blended my original ideas with Thomas's comments and got something
that works with a throwaway context per method if it detects either
@ChildSpringApplication or @ChildTestProperties (separate annotations
needed because the existing analogs at the type level do not
support being added to methods).

There's some reflection hackery to get the TestContext in a MethodRule,
but possibly that would be unnecessary if this feature was supported
in SpringMethodRule.

I blended my original ideas with Thomas's comments and got something
that works with a throwaway context per method if it detects either
@ChildSpringApplication or @ChildTestProperties (separate annotations
needed because the existing analogs at the type level do not
support being added to methods).

There's some reflection hackery to get the TestContext in a MethodRule,
but possibly that would be unnecessary if this feature was supported
in SpringMethodRule.
@sbrannen sbrannen self-assigned this Oct 17, 2015
sbrannen added a commit that referenced this pull request Oct 17, 2015
Add sample code for child contexts in test methods
@sbrannen
sbrannen merged commit 73db0e2 into spring-attic:master Oct 17, 2015
@sbrannen

Copy link
Copy Markdown
Contributor

Thanks, Dave.

I'll take a look at it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants