<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8988367705075246498</id><updated>2012-02-16T16:50:38.563-08:00</updated><category term='seam-gen'/><category term='qalab'/><category term='seam'/><category term='cobertura'/><title type='text'>braino</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://brainobrown.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988367705075246498/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://brainobrown.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Steve</name><uri>http://www.blogger.com/profile/16682953651847690681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/_Pg8Yj62ODkE/TDYJQvFQ1JI/AAAAAAAAABQ/CWI5_RUxv_8/S220/me-avatar.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8988367705075246498.post-4679248697291889737</id><published>2009-04-01T08:18:00.000-07:00</published><updated>2009-04-01T12:50:05.118-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='seam-gen'/><category scheme='http://www.blogger.com/atom/ns#' term='cobertura'/><category scheme='http://www.blogger.com/atom/ns#' term='seam'/><category scheme='http://www.blogger.com/atom/ns#' term='qalab'/><title type='text'>Seam and Cobertura</title><content type='html'>A project I am working on uses &lt;a href="http://www.jboss.com/products/seam/"&gt;Seam&lt;/a&gt;. The project is very modular, so we are using seam-gen ALOT. We wanted to add code coverage reports to each project, and we decided on &lt;a href="http://cobertura.sourceforge.net/"&gt;Cobertura&lt;/a&gt;. We also use &lt;a href="http://qalab.sourceforge.net/"&gt;QALab&lt;/a&gt; to graph our results over time so we can track our progress. I have modified the seam-gen build.xml with a new target called "new-report", like so:&lt;br /&gt;&lt;font face="courier"&gt;&lt;br /&gt;&amp;lt;target name=&amp;quot;new-report&amp;quot; depends=&amp;quot;validate-project&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;echo message=&amp;quot;Using properties from: ${seam-gen.properties}&amp;quot;/&amp;gt;&lt;br /&gt;  &lt;br /&gt;&amp;nbsp;  &amp;lt;echo message=&amp;quot;Creating reports for tests in: ${test.package}&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;input addproperty=&amp;quot;test.class.name&amp;quot; message=&amp;quot;Enter the main test case name&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;copy file=&amp;quot;${templates.dir}/build-scripts/qalab-chart-html.xsl&amp;quot; todir=&amp;quot;${project.home}&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;copy todir=&amp;quot;${project.home}/lib&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;    &amp;lt;fileset dir=&amp;quot;${seam.dir}/lib/test&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;cobertura.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;log4j.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;     &amp;lt;include name=&amp;quot;asm-3.0.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;asm-tree-3.0.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;jakarta-oro-2.0.8.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;qalab-1.0.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;xercesImpl-2.6.2.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;jcommon-1.0.5.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;      &amp;lt;include name=&amp;quot;jfreechart-1.0.2.jar&amp;quot; /&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;    &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;/copy&amp;gt;&lt;br /&gt;&amp;nbsp;  &amp;lt;copy todir=&amp;quot;${project.home}&amp;quot; file=&amp;quot;${templates.dir}/build-scripts/build-reports.xml&amp;quot;&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;     &amp;lt;filterset&amp;gt;&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;filter token=&amp;quot;testClassName&amp;quot; value=&amp;quot;${test.class.name}&amp;quot;/&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;     &amp;lt;/filterset&amp;gt;&lt;br /&gt; &amp;nbsp; &amp;lt;/copy&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;This will copy over the jar and xsl files and also a build-reports.xml ant build script (you will need to put the jar and xsl files in the correct seam directories). The build-reports build script is located on my &lt;a href="http://steveb.homelinux.org/webdav/work/"&gt;webdav&lt;/a&gt;. It will also ask you for a jUnit test name, which you will need to give the full path to.  I know, I know, Seam defaults to TestNG, but we prefer jUnit4 over here. Since that is the case, there is already a "test" target in the default seam generated build script. I simply change that target to be named "testng", the modified seam generated build.xml can be found &lt;a href="http://steveb.homelinux.org/webdav/work/build.xml"&gt;here&lt;/a&gt;. If you want this to be the default seam generated build.xml, you will need to add it to SEAM_INSTALL/seam-gen/build-scripts/ . Don't forget, you will need to add the placeholders for the ant filterset (ex. @projectName@).&lt;br /&gt;&lt;br /&gt;The build-reports.xml build script will create the cobertura html, xml, and summary xml reports. With the coverage.xml, generated by cobertura, qalab will generate the line and branch reports. What you get are nice html reports in your PROJECT_DIR/reports directory. The cool thing is, Cobertura will also do the code highlighting for uncovered lines with groovy files. For the qalab reports, checkout reports/graphs, the branch reports are located in reports/graphs/branch .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8988367705075246498-4679248697291889737?l=brainobrown.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brainobrown.blogspot.com/feeds/4679248697291889737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brainobrown.blogspot.com/2009/04/seam-and-cobertura.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8988367705075246498/posts/default/4679248697291889737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8988367705075246498/posts/default/4679248697291889737'/><link rel='alternate' type='text/html' href='http://brainobrown.blogspot.com/2009/04/seam-and-cobertura.html' title='Seam and Cobertura'/><author><name>Steve</name><uri>http://www.blogger.com/profile/16682953651847690681</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://3.bp.blogspot.com/_Pg8Yj62ODkE/TDYJQvFQ1JI/AAAAAAAAABQ/CWI5_RUxv_8/S220/me-avatar.jpg'/></author><thr:total>0</thr:total></entry></feed>
