Thanks for the note. We've had a couple of comments that people expected
rules to run before @Before. We placed them where we did not for any
particular reason, so we'll experiment with moving them earlier in the block
and see what breaks.
Regards,
Kent
_____
From:
junit@... [mailto:
junit@...] On Behalf Of
Alistair Israel
Sent: Tuesday, September 08, 2009 7:45 PM
To:
junit@...
Subject: [junit] Test execution chain with interceptors
Hi, Kent/David.
Just did some testing and it seems that the execution chain with
interceptors is actually:
- @Before
- ExternalResource#before()
- @Test
- ExternalResource#after()
- @After
Which basically means that any @Before code can't use the interceptors. I
think it would've been nice to, say, use a @Before method to fill a
TemporaryFolder with files for all subsequent tests. For example:
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@Before
public void createFiles() {
folder.newFile("test.txt");
}
Is this how you guys really wanted it? If so, any suggestions for my use
case, other than creating a whole new interceptor of my own?
- alistair
--
http://alistairisra <
http://alistairisrael.wordpress.com> el.wordpress.com
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]