yes, i believe it's a port from JUNIT. would you be willing to share your package? i'd like to see how you implemented it.

thanks. -- matt.
----- Original Message ----- From: "T. Michael Keesey" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, March 13, 2007 1:21 PM
Subject: Re: [Flashcoders] asunit and a class that loads XML


I'm not familiar with asunit, but I assume it's based on JUnit? I
created an AS2 package for doing unit tests and in mine I extended
Test, TestCase, and TestSuite to produce AsyncTest, AsyncTestCase, and
AsyncTestSuite, respectively. These classes complete test runs on
asynchronous events rather than at the end of a function call. In the
test cases there are functions called onRunComplete and onRunError
which can be made to listen for certain events, or can be called by
event handler functions.

On 3/13/07, Matthew Ganz <[EMAIL PROTECTED]> wrote:
hi jack.

thank you for sending your parser class along. it looks extremely useful but
it's not exactly what i'm looking for. what i need is some way of unit
testing the "loading" of a class that handles XML. i could make this part of my functional test plan but my objective is to find out if i can unit test
it.

my constructor takes a string that is the location of an XML file. i want to create a unit test case that will evaluate if a file location can be loaded in. how do i create a handler for when the XML has completely loaded without
that handler being invoked as soon as the test is run?

thanks. -- matt.
----- Original Message -----
From: "Jack Doyle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 12, 2007 4:42 PM
Subject: RE: [Flashcoders] asunit and a class that loads XML


> You might want to check out my XMLParser class at
> http://www.greensock.com/ActionScript/XMLParser. I think it does what
> you're
> looking for. It's free. It works. It's served me well for at least a > year.
>
> Good luck.
>
> Jack Doyle
>
> -----Original Message-----
> From: "Matthew Ganz" <[EMAIL PROTECTED]>
> Subject: [Flashcoders] asunit and a class that loads XML
> To: "Flashcoders mailing list" <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> hi.
>
> i have a question on using asunit to test a class that loads XML.
>
> i have a class that accepts a string in its constructor and i want to > test
> if it'll accept not just an http://myFileLocation.xml but also a file
> location such as "/data/config.xml".
>
> my question is how can i write my test with a handler for when the xml > is
> finished loading?
>
> this is what i have right now:
>
> class com.testsource.util.ConfigParserTest extends
> com.asunit.framework.TestCase {
> private var className:String = "com.testsource.util.ConfigParserTest";
> private var configParser:ConfigParser;
>
> public function setUp():Void {
> trace("setUp: " + setUp());
> configParser = new ConfigParser("data/config.xml");
>  configParser.addEventListener("loadSuccess",
> Delegate.create(this,testLoadFileLocation));
> }
>
> public function tearDown():Void {
> trace("tearDown()");
> delete configParser;
>  }
>
> public function testLoadFileLocation():Void{
> var size:Number = configParser.getLayerSetSize(); // this should > return
> the number 2.
>  trace("size: " + size);
>  assertEquals("example test", size, 2);
> }
> }
>
> the problem here is that my test is run and testLoadFileLocation() is > run
> before my XML successfully loads. and by the time it does load, the
> 'configParser" object has been deleted by the tearDown() method.
>
> so my traces come out looking like this:
> setUp()
> size: 0
> tearDown()
> size: undefined
>
> any tips are greatly appreciated.
>
> thanks. -- matt.
>
> **************
>
>
>

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to