|
From: Alias <ali...@gm...> - 2005-11-24 10:40:40
|
Hi Matt, I've just come across the same problem. I'm going to try using FDT organise imports to fix it quickly, I'll give you a heads up if I'm successful. Cheers, Alias On 11/24/05, Matt Freer <mat...@gm...> wrote: > Hey Guys, > > I got around to purchasing Flash 8 this week, and installed AsUnit 2.7 > So first thing I did was open up an .fla for a game I'm currently > building, I hit compile and shit: 60 errors! > > On closer inspection of the errors I noted that they were all kinda simil= ar: > "leaf name is already being resolved blah blah..." > > So after the initial panic had worn off I began investigating: > It appears that the Flash 8 compiler (even if your targeting flash > player 7) complains if Classes of the same name exist in different > packages and the said packages are included into a class using a the > wildcard. > > What relevance does this have to AsUnit I hear you say?.... and why > the hell would you have classes named the same thing even if they are > in different packages? > > The relevance to AsUnit is that we always use the same class name for > our test suites: AllTests.as. > > The problem is probably best explained with an example: > > 1) You create a package of classes (called vehicle). > > 2) You include your unit tests in the same package as the classes they > are testing (e.g. vehicle.AllTests.as). > > 3) You start work on another package (called car), you again include > your unit tests in the same package as the classes they are testing > > 4) You create a Class called BMW.as in the car package. > > 5) In BMW.as you need to utilise some classes from the vehicle > package, so you use: > import vehicle.*; (note the wildcard). > > 6) In BMW.as you also need to utilise some classes from the car > package, so you use: > import car.*; (note the wildcard). > > 7) Now you compile in Flash 8. Now you have a problem, the compiler > complains in the form: > > 'vehicle.AllTests' leaf name is already being resolved to 'car.AllTests'. > > The temporary solution is to not include the classes using the > wildcard, and instead target the specific classes. > So now you have to ship your framework with a public health warning: > "Don't import this package with a wildcard because most likely it will > break everything"! :( > > As its unlikely that MM will fix this issue in the short term - maybe > an AsUnit best practice should specify that unit tests should not be > created in the same package as the classes they are testing (a > sub-package would suffice), then people could import the package using > a wildcard and not have to worry about AllTests classes conflicting > with their own. > > What do you reckon? > > Cheers > Matt > > > > On 11/24/05, Luke Bayes <lb...@gm...> wrote: > > I believe you are looking for version 2.7 found here: > > http://sourceforge.net/project/showfiles.php?group_id=3D108947 > > > > This build is still designated an alpha because we haven't really used= it > > extensively and haven't gotten much feedback on it. We added a fairly r= isky > > feature to this build that involves aggregating messages for the local > > connection - rather than sending each one as it's generated. This was a > > *major* performance improvement for large applications, but is somewhat > > risky. We arbitrarily capped the local connection transmission package = size > > at 100 assertions. This could potentially fail if you send lengthy stri= ng > > arguments with each assertion and the local connection send call is sud= denly > > asked to transmit more than the macromedia-imposed arbitrary limitation= of > > 40k. If this happens, 100 of your assertions will silently "not" reach = the > > user interface for output. > > > > I figure the risk of this hapenning is pretty small at this point, sin= ce no > > one has yet reported it. It should also prove pretty obvious when your = test > > fixture suddenly loses 100 of it's hard-won tests. > > > > Anyway - Please download v.2.7, it's been out for a long time and is d= ue to > > become a stable release at this point... > > > > Thanks, > > > > > > Luke Bayes > > www.asunit.org > > > > > > > > > > On 11/23/05, Oscar Berg <osc...@ja...> wrote: > > > > > > Hi guys! > > > > > > Is there a somewhat stable build of Asunit for Flash 8? I saw a threa= d > > about it where Ali said it was releasable but i cant seem to find it > > anywhere. > > > > > > Thanks a lot, > > > oscar > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&opclick > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |