Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-838

Support for Spring's @ExpectedException annotation

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • 3.0
    • Reporting
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      If you are using the @ExpectedAnnotation from spring, clover will report 0% code coverage and indicate the tests failed. e.g. the following test case will report no code coverage:

      @Test
      @ExpectedException(Exception.class)
      public void testApp() throws Exception
      {
           App a = new App();
           a.doStuff(); //a.doStuff throws an exception
      }

      Using the JUnit 4.x annotations works and the report will show the test passed and the code coverage will be reported correctly:

      @Test(expected = Exception.class)
      public void testApp() throws Exception
      {
           App a = new App();
           a.doStuff(); //a.doStuff throws an exception
      }

      Would be nice if clover could understand the spring annotations too.

      Attachments

        1. clov-838.zip
          604 kB
          Marek Parfianowicz

        Activity

          People

            mstudman Michael Studman (Inactive)
            andrew.myers Andrew Myers [Atlassian]
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: