Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
coldbox mxunit autowire question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jim collins  
View profile  
 More options Jun 20, 10:11 pm
From: jim collins <jimcoll...@gmail.com>
Date: Sat, 20 Jun 2009 19:11:53 -0700 (PDT)
Local: Sat, Jun 20 2009 10:11 pm
Subject: coldbox mxunit autowire question
Im using MXunit and theres a service object that gets autowired by
coldbox. How, in the test, do I tell coldbox "autowire the object and
give it to me"?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Majano  
View profile  
 More options Jun 21, 3:29 pm
From: Luis Majano <lmaj...@gmail.com>
Date: Sun, 21 Jun 2009 12:29:14 -0700
Local: Sun, Jun 21 2009 3:29 pm
Subject: Re: [coldbox:2964] coldbox mxunit autowire question

Can you expand your question, what are you trying to do and where?

On Sat, Jun 20, 2009 at 7:11 PM, jim collins <jimcoll...@gmail.com> wrote:

> Im using MXunit and theres a service object that gets autowired by
> coldbox. How, in the test, do I tell coldbox "autowire the object and
> give it to me"?

--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldboxframework.com
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jim collins  
View profile  
 More options Jun 24, 12:00 pm
From: jim collins <jimcoll...@gmail.com>
Date: Wed, 24 Jun 2009 09:00:46 -0700 (PDT)
Local: Wed, Jun 24 2009 12:00 pm
Subject: Re: coldbox mxunit autowire question
I have an MXUnit test. I want to test the service object. The service
object uses ColdBox autowiring to set various things.
AFAIK this prevents me from using createobject in the MXUnit test as I
normally would.
In the Handler it looks like simply putting "<cfproperty
name="ServiceObject="model:ServiceObject" /> is enough to make Coldbox
create it w/the autowiring. If I put that line in my MXUnit file I get
an error "Element CBCONTROLLER is undefined in APPLICATION" . So my
question is how to I get access to an autowired object in my MXUnit
test?
BTW the MXUnit object extends
"coldbox.system.extras.testing.baseMXUnitTest"
Thanks,
Jim

On Jun 21, 3:29 pm, Luis Majano <lmaj...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Majano  
View profile  
 More options Jun 24, 2:00 pm
From: Luis Majano <lmaj...@gmail.com>
Date: Wed, 24 Jun 2009 11:00:50 -0700
Local: Wed, Jun 24 2009 2:00 pm
Subject: Re: [coldbox:2971] Re: coldbox mxunit autowire question

Jim,

Are you wanting to test the object without its dependencies, thus mocking
it's dependencies?

Or do you want to test it with its dependencies and wirings?

This is key in to what approach you take!!

ColdBox supports both with the introduction of MockBox.  I myself usually
test my model objects without external dependencies, and if they need some
then I use MockBox to mock them to make my testing easier and nicer.

http://blog.coldbox.org/post.cfm/mocking-objects-with-coldbox-annotat...

I would give MockBox a shot. You can easily install it via Daily Build on
coldbox 3.0.

Also, the base test cases, have a getModel() method that can give you the
object for testing.  3.0 really capitulizes on unit testing and will have
even more support for this.  Most of it is already on SVN for testing.

This way, you can test with or without loading the virtual application.

--
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldboxframework.com
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jim collins  
View profile  
 More options Jun 26, 3:47 pm
From: jim collins <jimcoll...@gmail.com>
Date: Fri, 26 Jun 2009 12:47:30 -0700 (PDT)
Local: Fri, Jun 26 2009 3:47 pm
Subject: Re: coldbox mxunit autowire question
Thanks Luis, getModel() in the mxunit test worked like a charm.

On Jun 24, 2:00 pm, Luis Majano <lmaj...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google