jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kazuhito SUGURI <suguri.kazuh...@lab.ntt.co.jp>
Subject Re: In html report how can I display Class names.
Date Thu, 02 Feb 2006 04:24:52 GMT
Hi Senthil,

In article <20060201020401.95763.qmail@web51808.mail.yahoo.com>,
Tue, 31 Jan 2006 18:04:01 -0800 (PST),
senthil kumar <senthil_cbe@yahoo.com> wrote: 
senthil_cbe> How can I display the test class names in report. For
senthil_cbe> example I have three test classes
senthil_cbe> Atest.java (testAmethod())
senthil_cbe> Btest.java (testBmethod())
senthil_cbe> Ctest.java (testCmethod())
senthil_cbe> 
senthil_cbe> I created a suite with for these three classes.
senthil_cbe> AllTestsSuite (which has all three testClasses)
senthil_cbe> 
senthil_cbe> If I call AllTestsSuite then in the report I am seeing
senthil_cbe> the suite name after the summary section testSuite
senthil_cbe> name displayed
senthil_cbe> TestCase AllTestSuite
senthil_cbe> and down below I am seeing all the method names but I
senthil_cbe> need a break down report for each test case meaning
senthil_cbe> (for each test class these are the methods). Right how
senthil_cbe> its showing all the methods from different test
senthil_cbe> classes its very hard to find out which test class has
senthil_cbe> which method.

You might use <batchtest> to execute <cactus> for individual test class.
By using build.xml fragment such as follws,
you could obtain test reports each of which is for a test class:
	<cactus ...>
	    ...
	    <batchtest>
	        <fileset dir="${cactus.src.dir}"
	                 includes="**/*test.java"
	                 excludes="AllTestsSuite.java" />
	    </batchtest>
            <formatter type="xml" />
	    <junitreport>
	        <fileset dir="${report.cactus.dir}"
	                 includes="TEST-*.xml" />
	        <report todir="${report.cactus.dir}/html"
	                format="frames" />
	    </junitreport>
	    ...
	</cactus>

If you want to see all results in a single HTML report
-- this may be a reason why you are using AllTestSuites --,
you could use your own XSL style-sheet for <junitreport> Ant task.
In a test report of XML format, which is created by <cactus> and <formatter>,
there is information you might want to see in the HTML report,
such as class-name. Follwing is an example of the report of XML format:
    <?xml version="1.0" encoding="UTF-8" ?>
    <testsuite errors="0" failures="0" name="AllTests" tests="28" time="3.834">
    ...
    <testcase classname="org.dummy.SampleTest" name="testA" time="0.291"></testcase>
    ...
    </testsuite>

Hope this helps,
----
Kazuhito SUGURI

Mime
View raw message