Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-625

Testclass which fails during launch claims to have no tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.7.2
    • Junit 4.x support
    • None
    • Maven version: 2.0.10 (surefire 2.5)
      Java version: 1.6.0_15
      OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

    Description

      I have a test which fails during launch due to this exception:

      java.lang.SecurityException: class ";com.spx.messageservice.MessageServiceException"'s signer information does not match signer information of other classes in the same package

      This happened because the class under test depends on some other classes in the same package in a signed jar.
      The problem is that using our normal maven environment, this error is not shown at all. Instead the surefire report for this class contained the results from the previous test in the module!
      If the test is run by itself with mvn -Dtest=TestClass, then maven says there are no tests run and no errors!

      If I use junit 4.8.1 in my pom file, I get this output on the console and in the surefire .txt report:

      Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

      The XML surefire report is not produced at all.

      If I use junit 4.6 in my pom file, I get this output:

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.047 sec <<< FAILURE!
      initializationError(com.spx.messageservice.BusinessEventRegistrarTest) Time elapsed: 0 sec <<< ERROR!
      java.lang.SecurityException: class "com.spx.messageservice.MessageServiceException"'s signer information does not match signer information of other classes in the same package
      at java.lang.ClassLoader.checkCerts(ClassLoader.java:776)
      ...

      Both the .txt & .xml version of the surefire reports are produced.

      After some experiments, I found that this happens for any junit version > 4.6.
      If I run the test class with junit from the command line, both the 4.6 & 4.8.1 produce a stack trace showing the exception during launch.

      Attachments

        1. surefire_junit4.8.1_issue.zip
          5 kB
          Karen Lease

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              klease Karen Lease
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: