SunitToo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SunitToo

Jim Thompson-3
Is there a simple example of setting up a test case with a resource?

I'm missing something -- I can't believe it is this hard

--
Jim Thompson

Reply To: [hidden email]

LSF Development Corp.     Jim Thompson
PO Box 201                6311 Ski Texas Lane
Martindale, TX  78655     Rosharon, TX 77583

832 423 7428 (mobile - ATT)
775 264 6670 (e-fax)

http://www.lsfdev.com
http://www.SanMarcosRiverRanch.com


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: SunitToo

Randy Coulman

Hi, Jim,

I don’t know of a simple example, but here’s a rough outline.

  • Create a subclass of TestResource, implementing setUp and tearDown as needed.

  • On the class side of your TestCase subclass(es), either implement a resources method that returns a collection containing your TestResource subclass, or implement a method with a <resource> pragma that returns your TestResource subclass.

  • In your test cases, you can get the singleton instance of your resource by sending #current to your TestResource subclass.

I have a vague memory of the pragma approach not quite working right. We have an override in our system that corrects for this in TestCase class>>allResources.

Hopefully, this is enough to get you started. If not, please ask a more specific question and I’ll try to help some more when I have time.

Randy



On Thu, Jan 30, 2014 at 10:05 AM, Jim Thompson <[hidden email]> wrote:
Is there a simple example of setting up a test case with a resource?

I'm missing something -- I can't believe it is this hard

--
Jim Thompson

Reply To: [hidden email]

LSF Development Corp.     Jim Thompson
PO Box 201                6311 Ski Texas Lane  
Martindale, TX  78655     Rosharon, TX 77583

<a href="tel:832%20423%207428" value="+18324237428" target="_blank">832 423 7428 (mobile - ATT)
<a href="tel:775%20264%206670" value="+17752646670" target="_blank">775 264 6670 (e-fax)

http://www.lsfdev.com
http://www.SanMarcosRiverRanch.com


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



--
Randy Coulman
Email: [hidden email]
Home: http://randycoulman.com
Twitter: @randycoulman      GitHub: randycoulman

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc