Re: Passing object instance from a suite to a TestCase

"David Saff" <[email protected]> Fri, 25 May 2007 13:26:05 -0400
Newsgroups gmane.comp.java.junit.devel
Message-ID <[email protected]>
Assaf,

It's several months past due, but if you face this situation again, you can
also use:

suite.addTest(new
com.nextnine.ServiceCenter.SCActivities.TestSCActivities(param1,
param2))

If you get a chance to try it out, let me know.

   David Saff

On 3/8/07, Assaf Vizner <[email protected]> wrote:
>
>  David hi
>
> Thanks for the response.
>
> Indeed I'm using JUnit 3.8.2,
>
> Passing the instance into the test constructor is a little bit problematic
> since the TestCase signature doesn't allow getting any parameters, and the
> suite that triggers the tests can get either
>
> Class - suite.addTestSuite(
> com.nextnine.ServiceCenter.SCActivities.TestSCActivities.class);
>
> Or Test - suite.addTest(
> com.nextnine.ServiceCenter.SCActivities.TestSCActivities.suite);**
>
> I think I'll try to define the main Application class as singleton, in
> order to create the instance once and all the tests will access it through
> get method.
>
>
>
> *Asaf Vizner*
> *NextNine.LTD*
> *4 Ha-Nechoshet*
> *Tel-Aviv** 69710 Israel*
> *E-mail:**  **[email protected]*<https://mail.google.com/mail?view=cm&tf=0&[email protected]>
> *Tel:       +972(3)7673012*
> *Mobile**: +972(528)466746*
> *Fax:      +972(3)6497810*
>   ------------------------------
>
> *From:* [email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>[mailto:
> [email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>]
> *On Behalf Of *David Saff
> *Sent:* Tuesday, 06 March 2007 04:53
> *To:* Assaf Vizner
> *Subject:* Re: [Junit-devel] Passing object instance from a suite to a
> TestCase
>
>
>
> Assaf,
>
> It sounds like you're using JUnit 3.  If so, your dynamic test suite could
> simply pass the instance into the constructors of the individual tests.  But
> it's possible I'm missing the complexity of the situation.  Could you share
> the source of your dynamic suite so far?  Thanks,
>
>    David Saff
>
> On 3/6/07, *Assaf Vizner* <[email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>>
> wrote:
>
> Hi
>
> I' m using Junit jointly with Watij (web application testing tool ), and I
> have created my own dynamic suite in order to allow my application to run
> different number of tests which provided as parameters.
>
> My problem is that I want my application to create the Watij IE (internet
> explorer) instance and to initialize it , and the Test Suite to send an
> instance of this object to the TestCase s.
>
> If anyone have any idea please replay to me
>
> Thanks
>
> *Asaf Vizner*
>
> *NextNine.LTD*
>
> *4 Ha-Nechoshet*
>
> *Tel-Aviv** 69710 Israel*
>
> *E-mail:**  * *[email protected]*<https://mail.google.com/mail?view=cm&tf=0&[email protected]>
>
> *Tel:       +972(3)7673012 *
>
> *Mobile: +972(528)466746 *
>
> *Fax:      +972(3)6497810*
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Junit-devel mailing list
> [email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>
> https://lists.sourceforge.net/lists/listinfo/junit-devel
>
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Junit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/junit-devel