Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901889

jtreg should detect "no tests" in singleton TestNG tests (or JUnit tests)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • jtreg7.6
    • None
    • tools
    • None

      It is probably an error if TestNG cannot find any tests within a singleton jtreg TestNG test (i.e. @run testng TESTCLASS)

      jtreg should detect and report that.

      ---


      For classes in a directory of TestNG tests, it is not practical for jtreg to determine from the source code which classes may contain tests, and which classes are merely support classes for the test classes. The lexical presence or absence of annotations is not enough by itself for jtreg to make the determination. Therefore, jtreg treats every class as possibly containing tests, which means that you will get “Total tests run: 0, Failures: 0, Skips: 0 " when trying to find tests in support classes. When we designed the jtreg/TestNG feature, some folk were adamant that there should be no special jtreg tagging on test files, as that would be too onerous on test developers. Therefore we have to live with the risks that tests may not be detected correctly.

            cstein Christian Stein
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: