I have a test class MyTestClass
with several typical test methods that do assertions or check for exceptions and are annotated with @Test
. They run when I call the following directive in an Ant task:
<test name="MyTestClass"/>
However, in the same class I would like to situate several benchmark performance methods that are not included in the tests that must be passed. I would like to have an altogether separate Ant task that runs these benchmarking tests.
Is there an annotated way to introduce this classification of tests and invoke each category separately? E.g. the @Test
annotated methods would be 1st class and then the fictitious @Benchmark
methods would simply be logging performance metrics for diagnostics reporting, not do assertions that are make or break. I think the test class is the best way to situate these benchmarking methods, yet I don't know how to encapsulate their invocation in Ant so that they are run separately. E.g., is it possible to prefix each method with "benchmark" and tell Ant to run only methods that are prefixed with that or can I write my own annotation?