J2EE Code Coverage Tool Clover Released

Discussions

News: J2EE Code Coverage Tool Clover Released

  1. J2EE Code Coverage Tool Clover Released (6 messages)

    Cortex is pleased to announce the latest release of Clover, a Code Coverage tool for Java. Clover finds sections of code that are not being executed, and has been specifically designed for J2EE projects. It works well with hosted applications and requires no specialized Java Runtime Environment.

    Check out Clover.

    Press Release
    ------------------------
    Cortex is pleased to announce the release of Clover 1.1.1

    Clover is a Code Coverage tool for Java. It finds sections of code that are not being executed. This can be used to improve the quality of your unit tests.

    Clover has been specifically designed for J2EE projects. It works well with hosted applications and requires no specialized Java Runtime Environment.

    To see what Code Coverage is all about, try our simple tutorial:
    http://www.thecortex.net/clover/tutorial/index.html

    Clover 1.1.1 introduces preliminary support for Java Generics (JSR14) plus many minor bug fixes.

    A free fully functional 30 day evaluation version of Clover 1.1.1 is available for download from
    http://www.thecortex.net/clover/download.jsp

    Free licenses are available for Open Source projects on application:
    http://www.thecortex.net/clover/freelicense.jsp
  2. Will Clover support unit testing of
    a) JSP
    b) Servlets
    c) EJBS ( Local invocation , remote invocation, through JMS invocation).

    Do some one know some good unit testing tool which provides code coverage too?

    Rajan
  3. Actually, Clover no interest about is it JSP, Servlet or whatever
    It interest IS PORTION OF JAVA CODE EXECUTED OR NOT
    and give you very detailed overview, which lines of code are
    executed.
    So the typical procedure is:

    1. Compile your code with Clover instumentation.
    2. Execute tests.
    3. See result, what lines of code not covered.

    Enjoy
  4. Will Clover support unit testing of

    > a) JSP
    > b) Servlets
    > c) EJBS ( Local invocation , remote invocation, through JMS invocation).

    Clover measures the code coverage of all java artifacts, including POJOs, Servlets and all types of EJBs. As long as you compile the code via Clover, coverage can be measured.

    Clover instruments java code at compile time and then records what parts of your code are being executed at runtime (during the execution of unit tests, etc).

    With the current version of Clover, you will need to do a little work to get JSP coverage measurement. You will need to pre-compile your JSP sources with Clover.

    > Do some one know some good unit testing tool which provides code
    > coverage too?

    Clover gives you the flexibility to use whatever unit testing framework you like - JUnit, Cactus, whatever.

    Hope this info helps.

    Cheers,
    -Brendan
    http://www.thecortex.net/clover
  5. Can I use Clover to test coverage for a deployed J2EE application?
    I've clover-enabled my EAR, WAR and JAR file contents at compile time and then
    deployed them to JBoss 3.0.6. but when i run unit tests using JUnitEE i get
    no test coverage although the code is being executed.
    Is there a special property file that needs to be deployed?
    What do i need to change to make it work?
  6. Can I use Clover to test coverage for a deployed J2EE application?


    Certainly

    > I've clover-enabled my EAR, WAR and JAR file contents at compile time and then
    > deployed them to JBoss 3.0.6. but when i run unit tests using JUnitEE i get
    > no test coverage although the code is being executed.
    > Is there a special property file that needs to be deployed?
    > What do i need to change to make it work?

    By default Clover only flushes coverage data to disk when the JVM exits (via a shutdown hook). After your tests run, shut JBoss down before generating a coverage report.

    If this is inconvenient, you can change the way Clover flushes coverage data, by setting the flushpolicy attribute on the <clover-setup> task:

    <clover-setup initstring="coverage.db"
                  flushpolicy="interval"
                  flushinterval="5000"/>

    This will direct Clover to flush coverage data to disk periodically meaning that you no longer need to shut jboss down to get a meaningful coverage report.

    Cheers,
    -Brendan
    http://www.thecortex.net/clover
  7. We're using Clover for code coverage analysis of the Spring Framework. Really great stuff for determining coverage of the unit tests, very simple to integrate into Ant scripts. And they even arrange a free license for open source projects! :-)

    Regarding unit tests of J2EE components: Our test suite uses mock objects for JNDI, JDBC, Servlet API, etc. The mocks are partly custom, partly from Mock Objects, partly created dynamically with EasyMock. Works nicely, at least for testing the framework itself. We've also moved some of our custom mocks to the framework source tree, as they are useful for application test suites too.

    For example, mock JNDI and a mock JDBC DataSource can be used for setting up a test environment for business logic services, without any container. The services can access a real database via JDBC in the standard J2EE way. In combination, Spring's ApplicationContext concept allows for testing a web app's middle tier services even without Servlet mocks, as there are no web dependencies when using an appropriate ApplicationContext implementation.

    Juergen

    P.S. concerning Spring releases: 0.8 coming very soon, 1.0 planned for June...