You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to junit-be...@googlegroups.com
I might have quite interesting, but probably not entirely uncommon use case,
We are using the JUnitBenchmarks to profile the data access layer and in order to do so we have a huge production data sql dump that is being used for populating the tables in the @Before method.
This done once and only once for the entire test case. Unfortunately the time taken for the @Before/@After methods is apparently taken into account for each individual test, causing in our case to produce huge spike for the first test that executes. In the contrary all the subsequent tests takes milliseconds to execute in each individual round.
Now, I know how the JUnit Rules work, but can you think of any workaround to output only the time of the actual test method, excluding the time that is spent for setup? We have some integration/setup code that prevents from moving the initialization into @BeforeClass.
Dawid Weiss
unread,
Aug 6, 2014, 3:24:41 AM8/6/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to junit-benchmarks
If you want to have per-test before/after code that is excluded from
benchmarking (and executed only once), use a rule chain and place
benchmarking rule at the bottom of the chain.
There is no other way to do it that wouldn't be hacky or crippled.
Before/after hooks shouldn't have ordering dependencies; if they do
(as it's the case here because benchmarking itself is a rule), you
need to order them manually as shown above.
D.
> --
> You received this message because you are subscribed to the Google Groups
> "JUnitBenchmarks: Performance Benchmarking for JUnit4" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to junit-benchmar...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.