MXUNIT tests and machii

15 views
Skip to first unread message

drfishflan

unread,
Dec 10, 2014, 6:57:05 AM12/10/14
to mach-ii-for...@googlegroups.com
Lets say i would like to make a test for the following event.

<event-handler event="viewCart" access="public">
<filter name="detectBadItems" />
         <notify listener="CartListener" method="getCart" resultArg="objCart" />
         <view-page name="cartWeek" />
</event-handler>

Now since my CartListener simply sucks out the event args and bounces over to my cart service.. I can easily duplicate this functionality in my test.

However... My filter is tied directly into machii... The only way I can see to get round this is to move the "detectBadItems" logic into a CartService method
which either the detectBadItems uses...

Perhaps I am going about using MXUNIT tests and machii all the wrong way.

Can anyone point me in the right direction ?

Thanks very much

drfishflan

unread,
Dec 11, 2014, 6:44:01 AM12/11/14
to mach-ii-for...@googlegroups.com
I have decided to write my tests within machii itself for now... No other viable option really.
Apart from going down the interaction selenium route... which we cannot do because of issues with our site.

Taivo Evard

unread,
Dec 11, 2014, 10:59:01 AM12/11/14
to mach-ii-for...@googlegroups.com
I'd say you want to write your Unit Tests against your model code. So
testing Services/Gateways/DAOs/etc. methods. It is a very granular type
of test to ensure the building blocks of your application function as
intended, especially around edge cases and with bad data. Listeners
should only handle routing anyhow.

If you want to move up the chain and test Listeners and the event life
cycle you'll be getting into Functional Testing, Selenium is one option
there.

Testing is a large topic and you might want to read up on the basics of
Unit Testing, Functional Testing, Load Testing, and test coverage. That
is just scratching the surface, but a good high-level overview is
provided on Wikpedia http://en.wikipedia.org/wiki/Software_testing

HTH,
Taivo
> --
> --
> For more options and to unsubscribe, visit this group at
> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
>
> Git & Wiki: https://github.com/Mach-II/Mach-II-Framework
> ---
> You received this message because you are subscribed to the Google
> Groups "Mach-II for CFML" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mach-ii-for-coldf...@googlegroups.com
> <mailto:mach-ii-for-coldf...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Taivo Evard
Software Developer
e: ta...@alluradirect.com
t: 604-707-6700

www.AlluraDirect.com
AlluraDirect.com Vacation Rentals by Owner
Book Smarter. Play Harder.

Become an alluraDirect.com fan on Facebook - http://www.facebook.com/pages/AlluraDirectcom-Vacation-Rentals/25588860683?ref=ts

Follow alluraDirect.com on Twitter - http://www.twitter.com/alluradirect


Reply all
Reply to author
Forward
0 new messages