Cobertura 1.9リリース

さりげなくバージョンアップしてる。

We've released Cobertura 1.9! There is much improved branch/conditional coverage and a new maxmemory attribute that can be used if instrumentation needs more memory. See below for the full list of changes.

  • Much improved branch/conditional coverage. Information on whether the true as well as the false of an if statement is collected. Also, information on the branches of a switch statement (including the default) is collected. (Jiří Mareš)
  • Assume Java source files are saved as UTF-8 instead of the computer's default encoding.
  • Write all HTML and XML reports in UTF-8 instead of the computer's default encoding (Naoki Iwami).
  • Fix a bug where the Cobertura ant tasks would not work correctly in Microsoft Windows when Cobertura was installed on a different drive than the drive from which you're running ant (Srivathsan Varadarajan).
  • Added a "maxmemory" attribute to the instrument, merge and report ant tasks (Matt Cordes).
  • Improve support for Maven and similar environments where control over system properties is difficult such as app servers, IoC containers, IDEs, etc. Setting the datafile location is difficult in these environments. To correct this, a cobertura.properties file located in the classpath is used to properly set the net.sourceforge.cobertura.datafile property. (Joakim Erdfelt)

今んとこメモリ足んなくなった事はないので"maxmemory"は別にいいや。でも,"net.sourceforge.cobertura.datafile"はちょっと便利かも。さらに,FAQを読むと,こんな感じのコード組めば,強制的にデータファイルを書き出してもくれるようだ。

try {
    String className = "net.sourceforge.cobertura.coveragedata.ProjectData";
    String methodName = "saveGlobalProjectData";
    Class saveClass = Class.forName(className);
    java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName, new Class[0]);
    saveMethod.invoke(null,new Object[0]);
} catch (Throwable t) {
}

地味ぃ〜に育ってるねぇ。