jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: test execution in browser
Date Thu, 20 May 2004 08:29:27 GMT
Sumit,

I'm afraid I don't understand. To get the class name, simply use
this.getClass().getName()...

Important note: We should not change the XML structure because if we do
users won't be able to use <junitreport> anymore. Said in another way,
if we do change the format, we also need to provide a new <cactusreport>
task too. This will probably become necessary in the future as we will
probably want to have a way to display the container name too. But for
now for and for your use case, I don't think it's required. You could
simply have:

<testsuites>
  <testsuite name="AllTests" tests="4" failures="0[...]
    <testcase name="RectangleTest.testArea" time="0.01"></testcase>
[...]

What do you think?

-Vincent

> -----Original Message-----
> From: Gupta, Sumit [mailto:sumit.gupta@citigroup.com]
> Sent: 18 May 2004 23:13
> To: Cactus Users List
> Subject: RE: test execution in browser
> 
> Hi Vincent,
> 
> Thanks for the help. I have one more question. How can I know the name
of
> the TestCaseClass?
> 
> Here's an example:
> 
> Say there are 2 testcase classes:
> 
> public class RectangleTest extends TestCase {
>      public void testArea(){}
>      public void testPerimeter(){}
> }
> 
> public class MathTest extends TestCase {
>      public void testAdd(){}
>      public void testSubtract{}
> }
> 
> public class AllTests {
>         public static Test suite() {
>             suite.addTest(new TestSuite(RectangleTest.class));
>             suite.addTest(new TestSuite(MathsTest.class));
>       }
> }
> 
> 
> Now, I want to include the TestCase class names (Here: MathTest, and
> RectangleTest) in the XML output.
> 
> the output should look like -
> 
> <testsuites>
>    <testsuite name="AllTests" tests="4" failures="0" errors="0"
> time="0.2">
> 
>       <testcaseclass name="RectangleTest">
/****
> This is required *****/
>          <testcase name="testArea" time="0.01"></testcase>
>          <testcase name="testArea" time="0.01"></testcase>
>       </testcaseclass>
> 
>       <testcaseclass name="MathTest">
/****
> This is required *****/
>          <testcase name="testAdd" time="0.01"></testcase>
>          <testcase name="testSubtract" time="0.01"></testcase>
>       </testcaseclass>
> 
>    </testsuite>
> </testsuites>
> 
> 
> Thanks and Regards,
> 
> Sumit
> 
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: Friday, May 14, 2004 7:27 AM
> To: 'Cactus Users List'
> Subject: RE: test execution in browser
> 
> 
> Hi Sumit,
> 
> I remember a discussion about this not long ago on this list (can't
> remember the thread name but someone else had a need for this too).
The
> XML is generated in the
>
http://jakarta.apache.org/cactus/api/framework-13/org/apache/cactus/inte
> rnal/server/runner/XMLFormatter.html class. Feel free to provide a
> patch. Please also open a JIRA issue.
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Gupta, Sumit [mailto:sumit.gupta@citigroup.com]
> > Sent: 03 May 2004 19:53
> > To: cactus-user@jakarta.apache.org
> > Subject: test execution in browser
> >
> > Hi,
> >
> > I am using cactus to generate HTML report for my testsuite. I am
using
> >
> > http://server:port/mywebapp/ServletTestRunner?suite=MyTestLoader
> >
> > to run my testcases from browser. Actually, I have made a program
> > (MyTestLoader)that dynamically looks for the test cases in a
specified
> > directory of my Web Application, loads them and execute them using
the
> > above URL. The main testcase (MyTestLoader) contains a suite()
method
> that
> > dynamically adds all the test cases found. Now, the problem is that
I
> am
> > not getting the name of the testcases I am executing. The above URL
> > generates an XML file that contains all the test methods under a
node
> > <testsuite>. Is it a way where I can generate an XML having
different
> Test
> > cases under different nodes? (So that a user can identify, which
test
> > method belong to which test case?)
> >
> > Thanks,
> >
> > Sumit
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org




Mime
View raw message