Results 1 to 2 of 2

Thread: TestContext framework annotation support for TestNG?

  1. #1
    Join Date
    Nov 2009
    Posts
    13

    Default TestContext framework annotation support for TestNG?

    A quick question:

    I am considering using TestNG and looked at the Chapter 8. Testing page and in section 8.3.7.6 and noticed this statement:

    "The following annotations, however, are only supported when used in conjunction with JUnit (e.g., with the SpringJUnit4ClassRunner or the JUnit 3.8 and JUnit 4.4 support classes."
    Does this mean that these annotations are exclusive with the use of Junit?

    Does Spring 2.5 or 3 have this same annotation support for TestNG as well?

  2. #2
    Join Date
    Jan 2006
    Location
    Zürich, Switzerland
    Posts
    423

    Default

    The section from the reference manual that you're referring to only applies to the following annotations:

    • @IfProfileValue
    • @ProfileValueSourceConfiguration
    • @ExpectedException
    • @Timed
    • @Repeat


    These annotations only make sense with JUnit since TestNG provides equivalent support with its own annotations. Furthermore, @ExpectedException and @Timed only make sense with JUnit 3.8, since JUnit 4+ provides built-in support for those semantics.

    All other annotations listed in that chapter are supported with any of the supported testing frameworks.

    In summary, Spring doesn't need to provide support for these annotations with TestNG because TestNG already provides that support.

    Hope this clears things up for you.

    Regards,

    Sam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •