Benchmark at the test class level for benchmark rounds

24 views
Skip to first unread message

Ravindra Rana

unread,
Apr 4, 2014, 8:15:28 PM4/4/14
to junit-be...@googlegroups.com
Is there any way that methods annotated with @Before and @After run only at one time(i.i before first round and after last round) for benchmark test. As observed currently it runs these methods for each benchmark run, and the captured data contains this time also.

Dawid Weiss

unread,
Apr 7, 2014, 6:29:11 AM4/7/14
to junit-benchmarks
No, these are always included by JUnit rules. Change your code to use
@BeforeClass/@AfterClass.

Dawid
> --
> 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.

Ravindra Rana

unread,
Apr 7, 2014, 1:58:05 PM4/7/14
to junit-be...@googlegroups.com
Thanks that's a good suggestion and works fine with normal scenarios. Only problem with @BeforeClass I need to make function static, with mokito and other dependencies. It doesn't work as expected.
Reply all
Reply to author
Forward
0 new messages