Support for Spring's @ExpectedException annotation

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • 3.0
    • Component/s: Reporting
    • None

      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.

            Assignee:
            Michael Studman (Inactive)
            Reporter:
            Andrew Myers [Atlassian]
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: