jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Surefire
  • SUREFIRE-522

Classes located in src/test/java are treated as JUnit tests if they contain the name Test

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.4.3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu
  • Complexity:
    Intermediate

Description

Having recently upgradet to 2.4.3 I realise that all classes whose name conforms to the above described pattern are being treated as JUnit test classes, meaning that if the class isnt scoped public, it does not provide a default construct and it does not contain a test method, it will be reported as containing failed tests, i.e.:

Tests in error:
initializationError0(com.mycompany...TestMethodConfiguration)
initializationError1(com.mycompany...TestMethodConfiguration)
Tests run: 246, Failures: 0, Errors: 2, Skipped: 0

The methods initializationError0 and 1 do not exist in the class obviously.

Surefire didn't use to treat classes based on naming conventions unless the class name ended with "Test".

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. SUREFIRE-482 Surefire tries to run JUnit4 tests that contain no @Test annotations

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Gin-Ting Chen added a comment - 25/Nov/08 6:26 AM

When using JUnit 4 or TestNG it should not run any tests that are not marked as @Test
Regardless of naming pattern.
That is specified in both the JUnit4 and TestNG docs.

Therefore if I have ParentTest that should not be run since if it is not marked as @Test

Show
Gin-Ting Chen added a comment - 25/Nov/08 6:26 AM When using JUnit 4 or TestNG it should not run any tests that are not marked as @Test Regardless of naming pattern. That is specified in both the JUnit4 and TestNG docs. Therefore if I have ParentTest that should not be run since if it is not marked as @Test
Hide
Permalink
Carlos Sanchez added a comment - 11/Jun/10 5:50 AM

See SUREFIRE-482

Show
Carlos Sanchez added a comment - 11/Jun/10 5:50 AM See SUREFIRE-482

People

  • Assignee:
    Carlos Sanchez
    Reporter:
    Kristoffer Moum
Vote (1)
Watch (2)

Dates

  • Created:
    01/Oct/08 9:05 AM
    Updated:
    11/Jun/10 5:50 AM
    Resolved:
    11/Jun/10 5:50 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.