You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(58) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(23) |
Feb
(3) |
Mar
(6) |
Apr
(4) |
May
(15) |
Jun
(22) |
Jul
(18) |
Aug
(3) |
Sep
(25) |
Oct
(7) |
Nov
(86) |
Dec
(9) |
| 2006 |
Jan
(20) |
Feb
(44) |
Mar
(59) |
Apr
(23) |
May
(37) |
Jun
(35) |
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(21) |
Nov
(17) |
Dec
(22) |
| 2007 |
Jan
(13) |
Feb
(7) |
Mar
(1) |
Apr
(13) |
May
(4) |
Jun
(2) |
Jul
(5) |
Aug
(8) |
Sep
(13) |
Oct
(22) |
Nov
(3) |
Dec
|
| 2008 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(3) |
May
|
Jun
(2) |
Jul
(34) |
Aug
(10) |
Sep
(5) |
Oct
(6) |
Nov
(8) |
Dec
|
| 2009 |
Jan
(1) |
Feb
(10) |
Mar
(4) |
Apr
(12) |
May
(10) |
Jun
(27) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(1) |
| 2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Luke B. <lb...@pa...> - 2009-02-24 17:52:18
|
Hey Mark, I really appreciate you bringing this up and I suspect you're not alone with these feelings. One of the things I really appreciate about working with Ali all these years is that he tends to be a little more conservative than I am about adopting new technologies or practices. I generally see something shiny and just jump into it and find out later if it was a good idea or not. This approach has obvious benefits and disadvantages, but the disadvantages get amplified when you're responsible for working with a large group of people.... When it comes to working with Git and specifically working with Github, the workflow from a development, sharing, integration and all around project management perspective is dramatically improved when compared to SVN and especially when compared to Sourceforge - or even Google code. One great thing about Git though, is that it's not mutually exclusive with SVN. I've been managing the Sprouts project (http://projectsprouts.org) for a couple of years now with both SVN and Git repos. The idea is that my daily work is done in Git, patches are submitted using Git clone and pull requests, but users can always pull the trunk from SVN if they're more comfortable there. I'm thinking this might be a good approach for AsUnit, and I'd love to get more feedback about what other folks might think. Trevor, I couldn't agree more about the benefits of Git in general, but I also acknowledge that we have a significant number of users on SVN that won't be able or willing to switch. So the idea at this point is this: AsUnit.org will actually be hosted on Github (as Github pages - so that anyone can contribute to maintenance), mainline development and patches will be managed via Git, but the source code will be available from both Git and SVN. Would something like that work for everyone? Thanks, Luke Bayes |
|
From: Luke B. <lb...@pa...> - 2009-02-24 17:38:18
|
Hey Alan, I just got that patch checked into SVN and it'll be included in the next release. Thanks for the reminder! And thanks also go to Jonathan for the simple solution! Luke Bayes http://asunit.org |
|
From: Trevor S. <tre...@gm...> - 2009-02-24 16:45:53
|
I'll chime in here, only because I'm very happy with Git. I switched over from SVN last year. Git involves a learning curve, but is well worth it. It's become an integral part of my development process now, rather than just an end-of-day step (what subversion was). I make dozens of commits per day, every time I get my app to compile and behave as expected. The commits take a second and involve no hit to a remote server. I can then make more changes to my app, and if things break, rather than figure out why, I'll just roll back to my commit of a few minutes before. I create and merge branches all the time. There's commands like "git stash" which you'll learn to love. But that's just about git, in general, which you may use independent of whether asunit moves to github. Moving the asunit up to github would certainly make it easier for us to fork it, should we so wish. I don't know if that's a goal of the project. Trevor On Tue, Feb 24, 2009 at 11:06 AM, Mark Hawley <ma...@ni...> wrote: > Is there a good reason to move to git? Does a DVCS make ASUnit maintenance > simpler? For me, having to add git to my workflow just to keep ASUnit up to > date likely means I won't bother -- I don't pretend to speak for anyone > else, though. > > On Tue, Feb 24, 2009 at 9:32 AM, Luke Bayes <lb...@pa...>wrote: > >> Hey Tim, >> >> Nice catch! That is definitely not deliberate. >> >> To make matters worse, the source in SVN is pretty far out of date >> with either of those releases. We've been meaning to package >> everything up, but just haven't found the time, mainly because >> Sourceforge makes it really annoying to push new releases, and >> migrating to another host is even more of a time sync. >> >> I have to confess that I've been packaging up builds for >> http://projectsprouts.org, and hosting them over here: >> http://code.google.com/p/projectsprouts/downloads/list >> >> Keep meaning to at least get a link to that on the asunit.org site, >> but again, just haven't made the time. >> >> I need to check in with Ali about this, but If anyone's interested in >> helping us migrate asunit.org to http://github.com, and move the >> asunit.org site to Github pages, please let us know. >> >> If anyone would prefer we didn't move over to Git, please speak up. >> >> >> Thanks, >> >> Luke Bayes >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Asunit-users mailing list >> Asu...@li... >> https://lists.sourceforge.net/lists/listinfo/asunit-users >> > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > > |
|
From: Mark H. <ma...@ni...> - 2009-02-24 16:06:32
|
Is there a good reason to move to git? Does a DVCS make ASUnit maintenance simpler? For me, having to add git to my workflow just to keep ASUnit up to date likely means I won't bother -- I don't pretend to speak for anyone else, though. On Tue, Feb 24, 2009 at 9:32 AM, Luke Bayes <lb...@pa...> wrote: > Hey Tim, > > Nice catch! That is definitely not deliberate. > > To make matters worse, the source in SVN is pretty far out of date > with either of those releases. We've been meaning to package > everything up, but just haven't found the time, mainly because > Sourceforge makes it really annoying to push new releases, and > migrating to another host is even more of a time sync. > > I have to confess that I've been packaging up builds for > http://projectsprouts.org, and hosting them over here: > http://code.google.com/p/projectsprouts/downloads/list > > Keep meaning to at least get a link to that on the asunit.org site, > but again, just haven't made the time. > > I need to check in with Ali about this, but If anyone's interested in > helping us migrate asunit.org to http://github.com, and move the > asunit.org site to Github pages, please let us know. > > If anyone would prefer we didn't move over to Git, please speak up. > > > Thanks, > > Luke Bayes > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |
|
From: Luke B. <lb...@pa...> - 2009-02-24 15:02:13
|
Hey Tim, Nice catch! That is definitely not deliberate. To make matters worse, the source in SVN is pretty far out of date with either of those releases. We've been meaning to package everything up, but just haven't found the time, mainly because Sourceforge makes it really annoying to push new releases, and migrating to another host is even more of a time sync. I have to confess that I've been packaging up builds for http://projectsprouts.org, and hosting them over here: http://code.google.com/p/projectsprouts/downloads/list Keep meaning to at least get a link to that on the asunit.org site, but again, just haven't made the time. I need to check in with Ali about this, but If anyone's interested in helping us migrate asunit.org to http://github.com, and move the asunit.org site to Github pages, please let us know. If anyone would prefer we didn't move over to Git, please speak up. Thanks, Luke Bayes |
|
From: Tim G. <tim...@gm...> - 2009-02-24 03:09:43
|
Hi, A Question about the difference between the different downloads of AsUnit... The framework only download (http://sourceforge.net/project/showfiles.php?group_id=108947&package_id=208528) and the framework that gets installed by the XUL UI (http://sourceforge.net/project/showfiles.php?group_id=108947&package_id=168969) are slightly different, I think. Unless I'm missing something. There's a file in the framework download zip: Framework\as25\AsUnitTestRunner.as This file is not present in XUL UI installed version: C:\Program Files\AsUnit\framework\as25\ Is this omission deliberate? Thanks! |
|
From: Alan S. <nod...@gm...> - 2009-02-19 01:07:18
|
Hi,
I've just joined the list and started working with AsUnit in Flex.
I noticed the exchange quoted below, messages from September.
I must say that it is great to have the FlexRunner class to inherit from;
however Jonathan Knapp's point is still well taken. He has found a bug
and provided a fix. The fact that his particular test case on AsUnit itself
is not the recommended usage does not invalidate its implication!
He has shown that the addedHandler() as written can easily be invoked before
the TestRunner itself has a stage reference (in addition to being invoked
again later).
So easily that the same thing happened to me ;)
-A
---------------------------------------------------------------------------------------
I just started working with ASUnit in Flex (so forgive me if this was
mentioned earlier) but I ran into a problem whenever "stage" was
referenced in TestRunner.as from the Subversion directory for AS3.
I added a check to see if the stage is null, and if so skip all of the
printer resizing setup functionality. It's probably not the best way
to handle it, but the output is traced fine and it seems to work.
My new addedHandler() call is:
protected function addedHandler(event:Event):void {
if(event.target === fPrinter) {
if(stage != null)
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);
resizeHandler(new Event("resize"));
}
}
}
Hope this helps someone out.
Jonathan Knapp
Caffeinated Solutions
http://www.coffeeandcode.com
330.614.0070
Hey Jonathan,
Thanks for the post!
Actually, we have a different base class for Flex applications.
If you're running a Flex application, you can create a new MXML
document that extends our asunit.textui.FlexRunner instead of the
basic TestRunner.
One of the great features of this test runner, is that it allows you
to call addChild in your test cases with EITHER IUIComponents, or just
regular Flash DisplayObjects.
Your test harness Flex application should usually look something like
the following:
------------------------->8--------------------------
<?xml version="1.0" encoding="utf-8"?>
<FlexRunner
xmlns="asunit.textui.*"
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="runTests()"
>
<!-- Import Application Styles -->
<mx:Style source="FooProjectSkin.css" />
<mx:Script>
<![CDATA[
import asunit.textui.TestRunner;
public function runTests():void {
// start(clazz:Class, methodName:String, showTrace:Boolean)
// NOTE: sending a particular class and method name will
// execute setUp(), the method and NOT tearDown.
// This allows you to get visual confirmation while developing
// visual entities
start(AllTests, null, TestRunner.SHOW_TRACE);
}
]]>
</mx:Script>
</FlexRunner>
-------------------------8<--------------------------
Good luck!
Thanks,
Luke Bayes
|
|
From: Luke B. <lb...@pa...> - 2009-01-29 00:13:37
|
Hey Folks, Just putting the word out. Ali and I just wrapped up a project and we have some availability for contract work. If you or anyone you know might need some ActionScript written, definitely hit us up. We're comfortable with on-site or remote work as the case may be. Thanks, Luke Bayes 510 459-9053 http://patternpark.com |
|
From: Robert P. <in...@ro...> - 2008-11-08 06:06:16
|
I haven't tried it myself, but others are saying that loadBytes() is synchronous. For example: http://livedocs.adobe.com/flex/2/langref/flash/display/Loader.html (in comments) ---- Loader.loadBytes should be documented as synchronous. It completes (or fails) loading before returning. So, unlike Loader.load(), there is no need to listen for the "complete" event; you can just call loadBytes() and then immediately refer to Loader.content, etc. ---- Robert On Fri, Nov 7, 2008 at 2:13 AM, Ian Tyrrell <Ia...@mo...> wrote: > My idea was to generate the proxy at runtime, so it would be possible to > subclass your DisplayObject subclass dynamically, overriding all the > public methods and replacing them with hooks. That way you could mock > both interfaces and concrete classes. > > The conceptual blocker I have hit is that (as far as I understand) the > only way to load bytecode at runtime is to use Loader.loadBytes which is > asynchronous. I did try using a while loop (if you're only using the > mock in the context of testing tying up the thread isn't such an issue), > but I believe the Complete event will only be dispatched after the > current block has finished executing, so this doesn't work. > > It wouldn't be very elegant, but if we could live with the mock > generation being asynchronous (which is a little easier to stomach with > my multiple asynchronous methods enhancement), then I might just go > ahead and try to implement. > > Unless they ever introduce a threading model (or continuations) then > flash platform developers will always have to write async code anyway! > > My 2c. > > Ian > > -----Original Message----- > From: Luke Bayes [mailto:lb...@pa...] > Sent: 06 November 2008 19:06 > To: Mailing List for the users of AsUnit > Subject: Re: [Asunit-users] Mock Objects, how to ? > > YUP - > >>> If only flash.utils.Proxy was like java.reflect.Proxy! > > The problem of mocking is exacerbated when we start working with > DisplayObject classes. There is currently no way to add the Proxy > class to these object's inheritance chain - this means that with the > current implementation of the language, display objects cannot be > mocked - unless of course we figure out runtime bytecode > manipulation... > > Whoever sorts this out will definitely be a hero! > > > Thanks, > > Luke > > ------------------------------------------------------------------------ > - > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |
|
From: Ian T. <Ia...@mo...> - 2008-11-07 10:13:46
|
My idea was to generate the proxy at runtime, so it would be possible to subclass your DisplayObject subclass dynamically, overriding all the public methods and replacing them with hooks. That way you could mock both interfaces and concrete classes. The conceptual blocker I have hit is that (as far as I understand) the only way to load bytecode at runtime is to use Loader.loadBytes which is asynchronous. I did try using a while loop (if you're only using the mock in the context of testing tying up the thread isn't such an issue), but I believe the Complete event will only be dispatched after the current block has finished executing, so this doesn't work. It wouldn't be very elegant, but if we could live with the mock generation being asynchronous (which is a little easier to stomach with my multiple asynchronous methods enhancement), then I might just go ahead and try to implement. Unless they ever introduce a threading model (or continuations) then flash platform developers will always have to write async code anyway! My 2c. Ian -----Original Message----- From: Luke Bayes [mailto:lb...@pa...] Sent: 06 November 2008 19:06 To: Mailing List for the users of AsUnit Subject: Re: [Asunit-users] Mock Objects, how to ? YUP - >> If only flash.utils.Proxy was like java.reflect.Proxy! The problem of mocking is exacerbated when we start working with DisplayObject classes. There is currently no way to add the Proxy class to these object's inheritance chain - this means that with the current implementation of the language, display objects cannot be mocked - unless of course we figure out runtime bytecode manipulation... Whoever sorts this out will definitely be a hero! Thanks, Luke ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Asunit-users mailing list Asu...@li... https://lists.sourceforge.net/lists/listinfo/asunit-users |
|
From: Luke B. <lb...@pa...> - 2008-11-06 19:27:23
|
YUP - >> If only flash.utils.Proxy was like java.reflect.Proxy! The problem of mocking is exacerbated when we start working with DisplayObject classes. There is currently no way to add the Proxy class to these object's inheritance chain - this means that with the current implementation of the language, display objects cannot be mocked - unless of course we figure out runtime bytecode manipulation... Whoever sorts this out will definitely be a hero! Thanks, Luke |
|
From: Ian T. <Ia...@mo...> - 2008-11-06 10:42:05
|
I actually ported an early version of EasyMock to AS2 a couple of years ago and started looking into doing the same for AS3 in the summer. The dynamic property lookup mechanism works completely differently so I had been looking to use something like As3Eval http://eval.hurlant.com/ to generate the mock implementations at runtime. The idea was to use reflection on the interface to stub up the methods (in the dynamically generated class) and delegate calls to the mock-framework. Unfortunately I didn't get very far, and as the majority of my day job still revolves around AS2 I didn't have as much call to persevere. If only flash.utils.Proxy was like java.reflect.Proxy! -----Original Message----- From: Robert Penner [mailto:in...@ro...] Sent: 06 November 2008 00:18 To: Mailing List for the users of AsUnit Subject: Re: [Asunit-users] Mock Objects, how to ? > http://www.mail-archive.com/fle...@ya.../msg78745.html > (very interesting thread) This is a better link with the whole thread: http://tech.groups.yahoo.com/group/flexcoders/message/90890 Robert ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Asunit-users mailing list Asu...@li... https://lists.sourceforge.net/lists/listinfo/asunit-users |
|
From: Robert P. <in...@ro...> - 2008-11-06 00:18:14
|
> http://www.mail-archive.com/fle...@ya.../msg78745.html > (very interesting thread) This is a better link with the whole thread: http://tech.groups.yahoo.com/group/flexcoders/message/90890 Robert |
|
From: Robert P. <in...@ro...> - 2008-11-06 00:03:16
|
I recently looked at three Java mocking frameworks. I would rate them in this order: 1. Mockito 2. EasyMock 3. JMock Mockito has the best syntax and conceptual approach, in my opinion. It lets you run your code on the mock first and then verify what happened to it after the fact. So the mock is basically a proxy inherits from your own class and acts just like it, but keeps a history of the method calls. You can query the history however you like, without having to define expectations up front. > 2. Is there any Mock Library for as3, I tried mock-as3 but it isn't helping > me in the above mentioned approach. AS3 is tricky because, like Java, you have to manipulate bytes in order to create classes and/or inheritance at runtime. The Java mocking frameworks use cglib to generate code at runtime. Some interesting links related to this: http://www.darronschall.com/weblog/2006/10/convert-generic-objects-into-class-instances.cfm http://www.brianlegros.com/blog/2008/10/25/mock-objects-and-as3-now-i-really-dont-want-to-use-explicit-typing/ http://www.mail-archive.com/fle...@ya.../msg78745.html (very interesting thread) Robert On Sun, Nov 2, 2008 at 11:47 PM, mudit tuli <mud...@gm...> wrote: > Hi, I want to unit test a class say UtilClass, which is used by some other > class say MyClass. > So my approach is to mock MyClass and test the UtilClass. > Here is the flow. > - MyClass(mock) dispatches an event to UtilClass. > - UtilClass calls a method of MyClass(mock) to pass the result set.(this is > actually how the framework i am using works) > > Few Queries: > 1. Is there something wrong in this approach ? or is there some better way > to unit test MyClass ? > 2. Is there any Mock Library for as3, I tried mock-as3 but it isn't helping > me in the above mentioned approach. |
|
From: Luke B. <lb...@pa...> - 2008-11-03 19:52:18
|
This does sound right to me - More often than not, as I find myself getting further into mocking object relationships, I find some flaw in my application design that - when addressed - allows me to move away from the mocks, fakes and stubs. That's not to say we never use these techniques, just that it's unusual and often indicates a problem. Thanks, Luke On Sun, Nov 2, 2008 at 11:47 PM, mudit tuli <mud...@gm...> wrote: > Hi, I want to unit test a class say UtilClass, which is used by some other > class say MyClass. > So my approach is to mock MyClass and test the UtilClass. > Here is the flow. > - MyClass(mock) dispatches an event to UtilClass. > - UtilClass calls a method of MyClass(mock) to pass the result set.(this is > actually how the framework i am using works) > > Few Queries: > 1. Is there something wrong in this approach ? or is there some better way > to unit test MyClass ? > 2. Is there any Mock Library for as3, I tried mock-as3 but it isn't helping > me in the above mentioned approach. > > Mudit Tuli > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > > |
|
From: mudit t. <mud...@gm...> - 2008-11-03 07:47:58
|
Hi, I want to unit test a class say UtilClass, which is used by some other class say MyClass. So my approach is to mock MyClass and test the UtilClass. Here is the flow. - MyClass(mock) dispatches an event to UtilClass. - UtilClass calls a method of MyClass(mock) to pass the result set.(this is actually how the framework i am using works) Few Queries: 1. Is there something wrong in this approach ? or is there some better way to unit test MyClass ? 2. Is there any Mock Library for as3, I tried mock-as3 but it isn't helping me in the above mentioned approach. Mudit Tuli |
|
From: Luke B. <lb...@pa...> - 2008-10-30 17:41:40
|
Hey Neha,
Thanks for posting your question!
In the future, please post your questions to the mailing list, this
way other people will get the benefit of the answers. It's fine this
time as I have cc'd the list with this message.
I imagine your test method could look something like the following:
public function testCreateButton():void {
var xml:XML = <Button>
<x>200</x>
<y>210</y>
</Button>;
var parser:Parser = new Parser();
var result:* = parser.addButton(xml.children());
asswertEquals('x', 200, result.width);
asswertEquals('y', 210, result.width);
// continue adding and verifying supported properties here...
}
Generally, when you have a long list of keyed values, it's easier (and
more flexible) to just forward those values directly onto the object
with something like:
var key:String = xmlList[i].name();
button[key] = xmlList[i];
You should get an exception if an unknown value is encountered, but
you could try...catch that to provide something more informative -
which is often helpful.
Good Luck,
Luke
On Thu, Oct 30, 2008 at 1:58 AM, Dubey, Neha wrote:
> Hi
>
>
>
> I need to perform unit testing of a function in AS3.0 that takes in the
> XMLList as an input parameters and returns button object.
>
> The code for this is mentioned below:
>
> Can anyone help me out with the approach to test this using ASUnit
>
>
>
> public function addButton(xmlList:XMLList):Button{
>
> button = new
> Button();
>
> for(var i:int = 0 ; i <xmlList.length();
> i++)
>
> {
>
> if(xmlList[i].name() == "x")
>
> button.x =
> xmlList[i];
>
> else if(xmlList[i].name() ==
> "y")
>
> button.y =
> xmlList[i];
>
> else if(xmlList[i].name() ==
> "name")
>
> button.name =
> xmlList[i];
>
> else if(xmlList[i].name() ==
> "label")
>
> button.label =
> xmlList[i];
>
> else if(xmlList[i].name() ==
> "width")
>
> button.width =
> xmlList[i];
>
> else if(xmlList[i].name() ==
> "useHandCursor")
>
>
> {
>
>
> button.useHandCursor =
> xmlList[i];
>
> }
>
> }
>
> buttonArray[buttonCounter++] = button;
>
> addChild(button);
>
> return button;
>
>
>
>
>
> Thanks
>
> Neha
|
|
From: Dubey, N. <Neh...@li...> - 2008-10-30 09:20:52
|
Hi
I need to perform unit testing of a function in AS3.0 that takes in the XMLList as an input parameters and returns button object.
The code for this is mentioned below:
Can anyone help me out with the approach to test this using ASUnit
public function addButton(xmlList:XMLList):Button{
button = new Button();
for(var i:int = 0 ; i <xmlList.length(); i++)
{
if(xmlList[i].name() == "x")
button.x = xmlList[i];
else if(xmlList[i].name() == "y")
button.y = xmlList[i];
else if(xmlList[i].name() == "name")
button.name = xmlList[i];
else if(xmlList[i].name() == "label")
button.label = xmlList[i];
else if(xmlList[i].name() == "width")
button.width = xmlList[i];
else if(xmlList[i].name() == "useHandCursor")
{
button.useHandCursor = xmlList[i];
}
}
buttonArray[buttonCounter++] = button;
addChild(button);
return button;
Thanks
Neha
|
|
From: Robert P. <in...@ro...> - 2008-10-06 21:03:03
|
I ported assertEqualsFloat() from AsUnit 3 back to 2.5. I also
corrected some docs regarding == vs. === that were out of date. I
tried attaching the patch file but here it is below as well.
Robert
+++ \asunit\framework\Assert.as
@@ -73,7 +73,7 @@
* Asserts that two objects are equal. If either of the
* objects provides an <code>equals()</code> method it will be used to
* determine equality. Otherwise, equality will be evaluated using the
- * strict equality operator (<code>===</code>).<br />
+ * equality operator (<code>==</code>).<br />
* <br />
* The method below tests the <code>getFullName()</code> method of the
* <code>Person</code> class to make sure that the formatting of its
@@ -114,6 +114,35 @@
}
/**
+ * Asserts that two numerical values are equal within a tolerance range.
+ * If they are not an AssertionFailedError is thrown with the given message.
+ */
+ static public function assertEqualsFloat():Void {
+ var message:String;
+ var expected:Number;
+ var actual:Number;
+ var tolerance:Number = 0;
+
+ if(arguments.length == 3) {
+ message = "";
+ expected = arguments[0];
+ actual = arguments[1];
+ tolerance = arguments[2];
+ }
+ else if(arguments.length == 4) {
+ message = arguments[0];
+ expected = arguments[1];
+ actual = arguments[2];
+ tolerance = arguments[3];
+ }
+ if (isNaN(tolerance)) tolerance = 0;
+ addTestResult(formatEqualsFloat(String(message), expected, actual,
tolerance),
+ "assertEqualsFloat",
+ (Math.abs(expected - actual) <= tolerance));
+ }
+
+
+ /**
* Asserts that a value is <code>null</code>.<br />
* <br />
* The method below tests to confirm that the parameter passed to the
@@ -221,7 +250,7 @@
/**
* Asserts that two variables are pointing to the same object in
- * memory.<br />
+ * memory. Uses the strict equality operator (<code>===</code>).<br />
* <br />
* The method below tests to confirm that the static
* <code>getInstance()</code> method of the <code>ServiceLocator</code>
@@ -358,10 +387,6 @@
throw new AssertionFailedError(msg);
}
-// private static function failNotEquals(message:String,
expected:Object, actual:Object):Void {
-// fail(format(message, expected, actual));
-// }
-
private static function format(message:String, expected:Object,
actual:Object):String {
var formatted:String = "";
if(message != null) {
@@ -370,6 +395,14 @@
return formatted + "expected:<" + expected + "> but was:<" + actual + ">";
}
+ private static function formatEqualsFloat(message:String,
expected:Object, actual:Object, tolerance:Number):String {
+ var formatted:String = "";
+ if(message != null) {
+ formatted = message + " ";
+ }
+ return formatted + "expected:<" + expected + "> but was:<" + actual
+ "> with tolerance:<"+tolerance+">";
+ }
+
public static function failError(msg:String):Void {
throw new IllegalOperationError(msg);
}
|
|
From: Luke B. <lb...@pa...> - 2008-10-06 18:06:46
|
OK - That's checked in. Thanks! Luke On Mon, Oct 6, 2008 at 10:08 AM, Luke Bayes <lb...@pa...> wrote: > Hey Robert, > > Sorry for not getting back to you on this - > > I'm not sure what is going on with the list, but I'll get this patch > into version control today. > > > Thanks, > > > Luke > > > On Thu, Oct 2, 2008 at 2:43 PM, Robert Penner <in...@ro...> wrote: >> I saw that the result message for assertSame() only showed one of the >> two things being compared. I copied over code from assertEquals: >> >> Assert.as >> >> @@ -253,7 +253,7 @@ >> object1 = msg; >> msg = ""; >> } >> - addTestResult(String(msg), "assertSame", (object1 === object2)); >> + addTestResult(format(String(msg), object1, object2), "assertSame", >> (object1 === object2)); >> } >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Asunit-users mailing list >> Asu...@li... >> https://lists.sourceforge.net/lists/listinfo/asunit-users >> > |
|
From: Luke B. <lb...@pa...> - 2008-10-06 17:42:04
|
Hey Robert, Sorry for not getting back to you on this - I'm not sure what is going on with the list, but I'll get this patch into version control today. Thanks, Luke On Thu, Oct 2, 2008 at 2:43 PM, Robert Penner <in...@ro...> wrote: > I saw that the result message for assertSame() only showed one of the > two things being compared. I copied over code from assertEquals: > > Assert.as > > @@ -253,7 +253,7 @@ > object1 = msg; > msg = ""; > } > - addTestResult(String(msg), "assertSame", (object1 === object2)); > + addTestResult(format(String(msg), object1, object2), "assertSame", > (object1 === object2)); > } > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |
|
From: Robert P. <in...@ro...> - 2008-10-02 23:28:23
|
I saw that the result message for assertSame() only showed one of the two things being compared. I copied over code from assertEquals: Assert.as @@ -253,7 +253,7 @@ object1 = msg; msg = ""; } - addTestResult(String(msg), "assertSame", (object1 === object2)); + addTestResult(format(String(msg), object1, object2), "assertSame", (object1 === object2)); } |
|
From: Luke B. <lb...@pa...> - 2008-09-18 10:42:22
|
Hey Jonathan, Thanks for the post! Actually, we have a different base class for Flex applications. If you're running a Flex application, you can create a new MXML document that extends our asunit.textui.FlexRunner instead of the basic TestRunner. One of the great features of this test runner, is that it allows you to call addChild in your test cases with EITHER IUIComponents, or just regular Flash DisplayObjects. Your test harness Flex application should usually look something like the following: ------------------------->8-------------------------- <?xml version="1.0" encoding="utf-8"?> <FlexRunner xmlns="asunit.textui.*" xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="runTests()" > <!-- Import Application Styles --> <mx:Style source="FooProjectSkin.css" /> <mx:Script> <![CDATA[ import asunit.textui.TestRunner; public function runTests():void { // start(clazz:Class, methodName:String, showTrace:Boolean) // NOTE: sending a particular class and method name will // execute setUp(), the method and NOT tearDown. // This allows you to get visual confirmation while developing // visual entities start(AllTests, null, TestRunner.SHOW_TRACE); } ]]> </mx:Script> </FlexRunner> -------------------------8<-------------------------- Good luck! Thanks, Luke Bayes |
|
From: Jonathan K. <Jon...@co...> - 2008-09-18 03:15:28
|
I just started working with ASUnit in Flex (so forgive me if this was
mentioned earlier) but I ran into a problem whenever "stage" was
referenced in TestRunner.as from the Subversion directory for AS3.
I added a check to see if the stage is null, and if so skip all of the
printer resizing setup functionality. It's probably not the best way
to handle it, but the output is traced fine and it seems to work.
My new addedHandler() call is:
protected function addedHandler(event:Event):void {
if(event.target === fPrinter) {
if(stage != null)
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);
resizeHandler(new Event("resize"));
}
}
}
Hope this helps someone out.
Jonathan Knapp
Caffeinated Solutions
www.coffeeandcode.com
330.614.0070
|
|
From: Luke B. <lb...@pa...> - 2008-09-16 16:43:26
|
Hey Folks, Just throwing a heads up, Kelly Brown has put together a great introduction to AsUnit on the Inside RIA blog, check it out if you're interested: http://www.insideria.com/2008/09/unit-testing-with-asunit.html Thanks, Luke Bayes |