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

JUnit runners don't handle @Before nor @After #42

Open
eskatos opened this issue Feb 12, 2019 · 5 comments
Open

JUnit runners don't handle @Before nor @After #42

eskatos opened this issue Feb 12, 2019 · 5 comments

Comments

@eskatos
Copy link
Member

eskatos commented Feb 12, 2019

Using @RunWith(GradleSamplesRunner::class) or @RunWith(SamplesRunner::class)

Expected Behavior

@Before and @After functions to be invoked properly

Current Behavior

@Before and @After functions silently ignored

Context

I wanted to skip some samples under certain conditions in a @Before function using JUnit Assume. I didn't find a satisfying way so far.

@BeforeClass and @AfterClass are already handled by the parent ParentRunner.

@marcphilipp
Copy link
Contributor

FWIW @Before and @After are handled in JUnit's BlockJUnit4ClassRunner.

@big-guy
Copy link
Member

big-guy commented Feb 20, 2019

@Rule are also affected by this.

@marcphilipp
Copy link
Contributor

@big-guy How so?

@big-guy
Copy link
Member

big-guy commented Mar 1, 2019

@marcphilipp since we don't use BlockJUnit4ClassRunner, @Rule's are also ignored.

@marcphilipp
Copy link
Contributor

Right, @ClassRule should work, though.

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

No branches or pull requests

3 participants