*Important* adding the TestNG @Test annotation to a class

John Mazzitelli jmazzite at redhat.com
Thu Mar 22 19:43:05 UTC 2012


FYI: this isn't due to the new testng upgrade. This @Test behavior has
always been the case even for the testng versions we were running prior
to this latest upgrade. Just wanted to make sure you didn't think the
testng upgrade broke this (i.e. no need to rollback testng upgrade on
account of this)

On Thu, 2012-03-22 at 15:36 -0400, Ian Springer wrote:
> Caution - I just discovered adding the @Test annotation to a class tells
> TestNG to run *all* public methods in the class as tests. Previously, I
> assumed it would only run public methods whose names started with
> "test", which I believe is how JUnit 3.x works. When using Arquillian,
> test classes generally have a number of public methods annotated with
> @Deployment and other Arquillian methods, which are not meant to be
> tests. So for Arquillian test classes and other situations where you
> have public methods that aren't meant to be tests, make sure you do
> *not* annotate the class with @Test.




More information about the rhq-devel mailing list