|
From: David H. <em...@da...> - 2006-11-21 15:46:16
|
Luke, Thanks a lot for your response. I was able to get it to work, but I discovered what may be a bug. I tried the MXP on my Mac a couple of times, with no luck. In response to your comment from another email: =B3Please make sure to never run the "create ..." scripts from anywhere other than a leaf project folder... Basically, these scripts will traverse your file system from the target folder and add AllTest.as files to each directory found forward of your FLA or project. The XUL UI is at least slightly more considerate in that it only adds AllTest.as files if it finds *Test.as <http://Test.as> files forward of that location... =B2 I wasn't sure what this meant. I saved an example.fla in its own directory, but the panel in the MXP doesn't seem to have a folder where it is run from= ; it's just run from within the Flash IDE. It kept creating all those AllTests.as files (on my Mac; on my PC it worked fine) so I had to stop using it. Even so, it occurred to me that I should probably have the ASUnit framework be part of my app's codebase, so I put it inside my source directory so my classpath won't have to hunt for it, and so other developers wouldn't have to install the extension if they didn't want to. I was able to install the XUL app per your instructions in your blog post. The XUL app created a clas= s and test files for me, in the correct folders. But here is what I think might be a bug: The XUL app creates AllTests.as files at each level of the app that begin with: class com.AllTests (or whatever, depending on where it is) extends asunit.framework.TestSuite { ... but of course the framework is packaged under com.asunit.*and so the compiler pukes. When I did a find and replace, it found the problem only in AllTests.as files, and when I changed them to "extends com.asunit.framework= " it worked fine. So, did I find a bug, or am I using the tool incorrectly? And finally, have you considered putting up a Wiki for documentation, like how they do at script.aculo.us? I get the sense that ASUnit can do a lot of things that are not readily apparent. You could have some contributors writ= e tactical stuff like definitions of all the methods, and others write about things like TDD best practices. I'd be happy to write some of these things as soon as I learn them. :) Thanks again, OK DAH On 11/20/06 6:04 PM, "Luke Bayes" <lb...@gm...> wrote: > Hey David, >=20 > I'm really sorry that this has been so difficult! >=20 > Thanks for sticking with it, at this point, you just need to add the asun= it > framework sources to your fla classpath. You can do this in authoring for= all > fla's by pressing CMD+U, and adding the appropriate framework src path to= your > ActionScript classpath... You can do it for a specific fla file by going = to > the publish settings. >=20 > Please let me know if this doesn't work for you. >=20 >=20 > Thanks, >=20 >=20 > Luke > www.asunit.org <http://www.asunit.org> >=20 >=20 >=20 >=20 > On 11/20/06, David Ham <em...@da...> wrote: >> Hi, >>=20 >> I am trying to get started in ASUnit but am having some trouble. >>=20 >> I am running Flash 8 on Mac OS X Tiger. I installed the ASUnit MXP. I al= so >> downloaded the Unit Testing with ASUnit PDF by Mark Daggett. When I trie= d to >> create the first test suite as he describes, the JSFL recursively added >> AllTest.as files to every directory on my hard drive, beginning at root, >> before it bombed. >>=20 >> Next, I installed the ASUnit XUL app, as described in a recent entry on = the >> blog. I got that to run, and I tried to follow the PDF using the XUL ins= tead >> of the MXP. I created a new project set up as follows: >>=20 >> /example >> /deploy >> /source >> /test >>=20 >> I put my FLA into 'source', and had ASUnit put a class called Example.as >> <http://Example.as> >> into 'source' and had ASUnit put the test files into 'test'. I changed t= he >> publish settings for the file to publish the swf to 'deploy.' >>=20 >> No matter what I do, I cannot seem to get past these error messages: >>=20 >> **Error** /Users/dham/Desktop/example/test/ExampleTest.as: Line 5: The c= lass >> or interface 'asunit.framework.TestCase' could not be loaded. >> class ExampleTest extends TestCase { >>=20 >> **Error** /Users/dham/Desktop/example/test/AllTests.as: Line 2: The clas= s or >> interface 'asunit.framework.TestSuite' could not be loaded. >> class AllTests extends asunit.framework.TestSuite { >>=20 >> Total ActionScript Errors: 2 Reported Errors: 2 >>=20 >> Help! What am I doing wrong? Many thanks for any help you can offer, >>=20 >> OK >> DAH >> -- >> David Ham >> http://anthropomorphy.org :: NEW MOBILE NUMBER =3D> +1 630.297.= 1273 >> http://davidham.com :: em...@da... >>=20 >>=20 >>=20 >>=20 >>=20 >> ------------------------------------------------------------------------= - >> 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=3Djoin.php&p=3Dsourceforge&CID=3DDEVDE= V >> <http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&= CID=3DD >> EVDEV>=20 >> _______________________________________________ >> Asunit-users mailing list >> Asu...@li... >> https://lists.sourceforge.net/lists/listinfo/asunit-users >>=20 >=20 >=20 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV >=20 > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users |