OT: Mocking Framework

2 views
Skip to first unread message

DannyT

unread,
Apr 21, 2009, 4:56:12 PM4/21/09
to fluint-di...@googlegroups.com
Sorry for the slightly OT but I figure this is a pretty good place for this question.

Has anyone used any form of mocking libraries for flex? We're just getting our heads around RhinoMocks (for .net) and it's awesome so have been looking for a comparable for flex... but not finding much.

Dan

Glenn Goodrich

unread,
Apr 21, 2009, 5:00:54 PM4/21/09
to fluint-di...@googlegroups.com

DannyT

unread,
Apr 21, 2009, 5:14:35 PM4/21/09
to fluint-di...@googlegroups.com
I'm aware of asmock and mock4as haven't looked into them too intently but was wondering if there were many people who had any experience of either or any other?


2009/4/21 Glenn Goodrich <glenn.g...@gmail.com>



--
http://danny-t.co.uk

Brett Adam

unread,
Apr 21, 2009, 6:16:29 PM4/21/09
to fluint-di...@googlegroups.com, fluint-di...@googlegroups.com
Mock4as has proven valuable for us. However the lack of runtime dynamic interface synthesis/proxy in AS3 has meant tedious boilerplate to keep the compiler and runtime happy. Not mock4as specific.  

Sent from my iPhone

DannyT

unread,
Apr 21, 2009, 6:52:21 PM4/21/09
to fluint-di...@googlegroups.com
Yeah i guess that's what is the biggest pain point from what we've seen so far. Are there any efforts/ideas on working around that limitation or is it plain not possible?

2009/4/21 Brett Adam <bpj...@gmail.com>



--
http://danny-t.co.uk

Brian

unread,
Apr 21, 2009, 9:11:47 PM4/21/09
to Fluint Discussions
@Dan - We use mock-as3 at work and really like it. It's an
expectation based library rather than a record/playback model like
asmock, which I prefer. That being said, if you're using RhinoMocks
then asmock may be more up your ally; mock-as3 is more like moq in
some ways but w/o the focus on lambdas. I think asmock has dynamic
runtime subclassing available which will give you a more familiar
experince. I know that mock-as3 is working with the loom project to
get this feature in the next release. The guy who wrote mock-as3 has
also writen a port of the Hamcrest matching library from the Java
world that you may find helpful as well. Below are the links to the
projects mentioned for what it's worth:

mock-as3 - http://code.google.com/p/mock-as3/
loom-as3 - http://code.google.com/p/loom-as3/
hamcrest-as3 - http://github.com/drewbourne/hamcrest-as3/tree/master

You're going to find that a lot of tools from the .NET world such as
AOP, mocking, etc aren't available in the same robust manner that your
acustom. There is a lot of work being done, including with this
library, to updated these tools, but they're all still works in
progress (due for completion soon). We've found ourselves living with
a bit of boiler plate for things like testing while we wait/build new
tools.

Hope this helps.

-Brian

Drew Bourne

unread,
Apr 22, 2009, 6:35:53 AM4/22/09
to fluint-di...@googlegroups.com
@Brian thanks for posting that.

@Dan As the author of mock-as3 and hamcrest-as3 there is not much more
I can add just yet, except to confirm that I'm working on it. In
addition to enabling runtime creation of mock types I am converting
mock-as3 to use the hamcrest matcher system where appropriate, eg
argument matchers.

cheers,
Drew

DannyT

unread,
Apr 22, 2009, 8:53:24 AM4/22/09
to fluint-di...@googlegroups.com
Thanks guys, very useful info.

I'm currently working on a community project to implement an identical application using several different architectural frameworks. One of those implementations is currently being tested with flexunit, could be a good option to have different implementations with the different testing and mocking frameworks. Thanks for the food for thought :)

2009/4/22 Drew Bourne <first...@gmail.com>



--
http://danny-t.co.uk

Brian

unread,
Apr 22, 2009, 9:43:44 AM4/22/09
to Fluint Discussions
@Dan - Sounds like a great project. If you're interested in
integrating fluint, let us know if we can help with any questions.
Best of luck.

-Brian

On Apr 22, 8:53 am, DannyT <danmo...@googlemail.com> wrote:
> Thanks guys, very useful info.
>
> I'm currently working on a community project to implement an identical
> application using several different architectural frameworks. One of those
> implementations is currently being tested with flexunit, could be a good
> option to have different implementations with the different testing and
> mocking frameworks. Thanks for the food for thought :)
>
> 2009/4/22 Drew Bourne <firstbou...@gmail.com>
>
>
>
>
>
> > @Brian thanks for posting that.
>
> > @Dan As the author of mock-as3 and hamcrest-as3 there is not much more
> > I can add just yet, except to confirm that I'm working on it. In
> > addition to enabling runtime creation of mock types I am converting
> > mock-as3 to use the hamcrest matcher system where appropriate, eg
> > argument matchers.
>
> > cheers,
> > Drew
>
> > On Wed, Apr 22, 2009 at 11:11 AM, Brian <legr...@gmail.com> wrote:
>
> > > @Dan - We use mock-as3 at work and really like it.  It's an
> > > expectation based library rather than a record/playback model like
> > > asmock, which I prefer.  That being said, if you're using RhinoMocks
> > > then asmock may be more up your ally; mock-as3 is more like moq in
> > > some ways but w/o the focus on lambdas.  I think asmock has dynamic
> > > runtime subclassing available which will give you a more familiar
> > > experince. I know that mock-as3 is working with the loom project to
> > > get this feature in the next release.  The guy who wrote mock-as3 has
> > > also writen a port of the Hamcrest matching library from the Java
> > > world that you may find helpful as well.  Below are the links to the
> > > projects mentioned for what it's worth:
>
> > > mock-as3 -http://code.google.com/p/mock-as3/
> > > loom-as3 -http://code.google.com/p/loom-as3/
> > > hamcrest-as3 -http://github.com/drewbourne/hamcrest-as3/tree/master
Reply all
Reply to author
Forward
0 new messages