[Httpunit-develop] RE: Httpunit-develop digest, Vol 1 #1573 - 2 msgs
Brought to you by:
russgold
From: CORUM, M E [AG/1000] <m.e...@mo...> - 2006-05-12 03:31:11
|
Get the TestCollector from ThoughtWorks. It's free and very easy to use. We use a modified version of it where I work and it's great. Mike -----Original Message----- From: htt...@li... [mailto:htt...@li...] On Behalf Of htt...@li... Sent: Thursday, May 11, 2006 10:03 PM To: htt...@li... Subject: Httpunit-develop digest, Vol 1 #1573 - 2 msgs Send Httpunit-develop mailing list submissions to htt...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/httpunit-develop or, via email, send a message with subject or body 'help' to htt...@li... You can reach the person managing the list at htt...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Httpunit-develop digest..." Today's Topics: 1. RE: is adding test classes in mass possible? (Rob...@gx...) 2. Re: is adding test classes in mass possible? (William Pietri) --__--__-- Message: 1 Subject: RE: [Httpunit-develop] is adding test classes in mass possible? Date: Thu, 11 May 2006 12:47:53 -0400 From: <Rob...@gx...> To: <htt...@li...> Reply-To: htt...@li... This is a multi-part message in MIME format. ------_=_NextPart_001_01C6751A.A5732345 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Off the top of my head you may try using reflection to do it. You could probably loop over the directory structure of the package and use names of directories and class files to build class names then use the class loader to instantiate them: =20 Class.forName(fully.qualified.class.Name); =20 I think what I am describing here may be a factory pattern? =20 HTH, Rob =20 ________________________________ From: htt...@li... [mailto:htt...@li...] On Behalf Of Jef...@th... Sent: Thursday, May 11, 2006 12:18 PM To: htt...@li... Subject: [Httpunit-develop] is adding test classes in mass possible? =20 I have been give around 160 separate httpunit test files, instead of listing them one line at a time. =20 Is there a way I can grab them from the package directory and do a mass add of the test cases? =20 I create a main "driver" test suite as follows, and this is were I was hoping to be able to some kind of mass add of the 160 test case files. =20 public class TestLabSuite { public static void main( String[] args ) { junit.textui.TestRunner.run( suite() ); } =20 public static TestSuite suite() { TestSuite result =3D new TestSuite(); =20 // Labs //result.addTest(LabAdvisorKeywordSearchTest.suite() ); result.addTest(LabAdvisorTopicSearchTest.suite() ); // Added by HCL result.addTest(LabDatabaseSearchExtendedTest.suite() ); result.addTest(LabDatabaseSearchTest.suite() ); result.addTest(LabDatabaseSearchThirdTest.suite() ); =20 =20 return result; } } =20 =20 =20 =20 =20 Thanks for any guidance you can provide Jeff=20 =20 ------_=_NextPart_001_01C6751A.A5732345 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><o:SmartTagType namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" = name=3D"PersonName"/> <!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:10.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal; font-family:Arial; color:windowtext;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>Off the top of my head you may try = using reflection to do it. You could probably loop over the directory = structure of the package and use names of directories and class files to build class = names then use the class loader to instantiate = them:<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>Class.forName(fully.qualified.class.= Name);<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>I think what I am describing here = may be a factory pattern?<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>HTH,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><br> Rob<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <div> <div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font = size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1> </span></font></div> <p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span = style=3D'font-size:10.0pt; font-family:Tahoma;font-weight:bold'>From:</span></font></b><font = face=3DTahoma><span style=3D'font-family:Tahoma'> = htt...@li... [mailto:htt...@li...] <b><span style=3D'font-weight:bold'>On Behalf Of = </span></b>Jef...@th...<br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, May 11, = 2006 12:18 PM<br> <b><span style=3D'font-weight:bold'>To:</span></b> <st1:PersonName = w:st=3D"on">htt...@li...</st1:PersonName><br> <b><span style=3D'font-weight:bold'>Subject:</span></b> = [Httpunit-develop] is adding test classes in mass possible?</span></font><font size=3D3><span style=3D'font-size:12.0pt'><o:p></o:p></span></font></p> </div> <p class=3DMsoNormal><font size=3D2 face=3D"Times New Roman"><span = style=3D'font-size: 10.0pt'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I have been give around 160 separate httpunit test = files, instead of listing them one line at a time. = <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Is there a way I can grab them from the package = directory and do a mass add of the test cases?<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I create a main “driver” test suite as = follows, and this is were I was hoping to be able to some kind of mass add of the = 160 test case files.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>public class = TestLabSuite<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>{<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> public static void main( String[] args = )<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> {<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = junit.textui.TestRunner.run( suite() );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> }<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> public static TestSuite = suite()<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> {<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> TestSuite result =3D = new TestSuite();<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> // = Labs<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> //result.addTest(LabAdvisorKeywordSearchTest.suite() = );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = result.addTest(LabAdvisorTopicSearchTest.suite() );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> // Added by = HCL<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> result.addTest(LabDatabaseSearchExtendedTest.suite() = );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> result.addTest(LabDatabaseSearchTest.suite() = );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> result.addTest(LabDatabaseSearchThirdTest.suite() = );<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> = <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> return = result;<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'> }<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>}<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Thanks for any guidance you can = provide<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Jeff <o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> </div> </body> </html> ------_=_NextPart_001_01C6751A.A5732345-- --__--__-- Message: 2 Date: Thu, 11 May 2006 11:35:26 -0700 From: William Pietri <wi...@sc...> To: htt...@li... Subject: Re: [Httpunit-develop] is adding test classes in mass possible? Reply-To: htt...@li... Rob...@gx... wrote: > > Off the top of my head you may try using reflection to do it. You > could probably loop over the directory structure of the package and > use names of directories and class files to build class names then use > the class loader to instantiate them: > > > This is a relatively easy thing to write. I have code that does it that way. I've never released it because it's just a couple of classes, but I'm glad to make it available. William --__--__-- _______________________________________________ Httpunit-develop mailing list Htt...@li... https://lists.sourceforge.net/lists/listinfo/httpunit-develop End of Httpunit-develop Digest --------------------------------------------------------------------------------------------------------- This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited. All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment. --------------------------------------------------------------------------------------------------------- |