Re: In html report how can I display Class names.
senthil kumar <[email protected]>
| Newsgroups | gmane.comp.jakarta.cactus.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Kazuhito, 1. I am not using ANT to generate a report. Right now I am running my test cases from browser. I created a simple UI to display and run test cases for my application. 2. > <testcase classname="org.dummy.SampleTest" > name="testA" time="0.291"></testcase> Regarding the above lines I dont have any problem in using my own XLST but in the XML I didn't see the class name for example here is the XML report which I got from my application. <testsuite name="com.testsuite.AllTestSuite" tests="11" failures="3" errors="0" time="1.484"> <testcase name="testMethod" time="0.14" /> Here I didn't see any class name, I beleive even if I modify the XLST unless there is an entry in the XML document it wont display the class name. So I need to introduce one more attribute class name while writing XML am I right? Thanks, Senthil. --- Kazuhito SUGURI <[email protected]> wrote: > Hi Senthil, > > In article > <[email protected]>, > Tue, 31 Jan 2006 18:04:01 -0800 (PST), > senthil kumar <[email protected]> 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 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [email protected] > For additional commands, e-mail: > [email protected] > >