Setting up MXUnit ...getting a bit confused

12 views
Skip to first unread message

James Buckingham

unread,
May 9, 2008, 10:24:32 AM5/9/08
to mxunit
Hi everyone,

I'm trying to setup MXUnit (in Eclipse) and getting a bit confused
about how I should be setting up my files and configuring the plugin.
This is how I've got things setup at the moment, hope this makes
sense:

CFMX7 - multiserver configuration with three instances:

Instance Name / URL : port
Main - http://mydomain.com:8300
Web - http://mydomain.com:8301
Apps - http://mydomain.com:8302

MXUnit found in main instance here: http://mydomain.com:8300/mxunit
Path address to this is: x:\\JRun4\servers\cfusion\cfusion-ear\cfusion-
war\mxunit

Test Cases are here on Apps:
http://mydomain.com:8302/interact/onlinePayments/_extensions/com/

Path address is outside JRun here:
x:\\Inetpub\iwsroot\cfusion.war\interact\onlinePayments\_extensions
\com

-------

When I try and set this up I get the following error:
ERROR getting methods for Component/ Message is:

coldfusion.xml.rpc.CFCInvocationException:
[coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find
the ColdFusion Component
cfusion.war.interact.onlinePayments._extensions.com.IWSManagerTest.]

*Component*:
cfusion.war.interact.onlinePayments._extensions.com.IWSManagerTest

*URL*:
http://mydomain.com:8300/mxunit/framework/RemoteFacade.cfc?wsdl

-------

I've tried a variety of ways to customised the project as well but I
can't get rid of this message.

One issue (although I don't know if it is one) is that the test cases
are behind a secure area. So the application.cfc is checking for a
valid session. If it doesn't exist then it redirects to the main login
page. Would this affect the cfcs from within Eclipse at all?

Should I maybe be placing my tests somewhere else? Preferably I'd
rather not as the project is pretty nicely self contained just now. Am
I missing anything major here that I could be doing?

Any help is appreciated and let me know if you need to know anything
else.

James

Marc Esher

unread,
May 9, 2008, 10:33:43 AM5/9/08
to mxu...@googlegroups.com
Hi James,
for the eclipse project that contains your test cases, what is the
"path"? And what is the "right" path to this test as CF sees it?

what i'm thinking is this:

if your project root is
x:\\Inetpub\iwsroot\cfusion.war\interact\onlinePayments\_extensions\com,
then you should be able to go into project properties and set the
"component root" value to "com". the plugin will then evaluate the
path to your tests as "com.IWSManagerTest"

or, if that's not right, if the component path as CF sees it is
interact.onlinePayments._extensions.com.IWSManagerTest", then you
could set the project component root property to
"interact.onlinePayments._extensions.com and then the plugin should
resolve it correctly.

marc

James Buckingham

unread,
May 9, 2008, 10:45:03 AM5/9/08
to mxunit
Thanks for replying so quickly Marc.

Ok I've gone into the project properties and under Resource I've got
the following:

Path: /onlinePayments
Type: Project
Location: L:\cfusion.war\interact\onlinePayments
(I'm obviously mapping but the original post was the absolute path)

If I want to access the cfc's direct through a browser (if that's what
you mean) I would go to:
https://mydomain.com/interact/onlinePayments/_extensions/com/myCFC.cfc
Like I say that will only work once I've logged in though otherwise
I'd be redirected to the main login page.

I tried a couple of combinations, includes the ones you mention there,
plus:
/onlinePayments

but still no luck.

Does that help?


On May 9, 3:33 pm, "Marc Esher" <marc.es...@gmail.com> wrote:
> Hi James,
> for the eclipse project that contains your test cases, what is the
> "path"? And what is the "right" path to this test as CF sees it?
>
> what i'm thinking is this:
>
> if your project root is
> x:\\Inetpub\iwsroot\cfusion.war\interact\onlinePayments\_extensions\com,
> then you should be able to go into project properties and set the
> "component root" value to "com". the plugin will then evaluate the
> path to your tests as "com.IWSManagerTest"
>
> or, if that's not right, if the component path as CF sees it is
> interact.onlinePayments._extensions.com.IWSManagerTest", then you
> could set the project component root property to
> "interact.onlinePayments._extensions.com and then the plugin should
> resolve it correctly.
>
> marc
>
> On Fri, May 9, 2008 at 10:24 AM, James Buckingham <Clarke...@gmail.com> wrote:
>
> > Hi everyone,
>
> > I'm trying to setup MXUnit (in Eclipse) and getting a bit confused
> > about how I should be setting up my files and configuring the plugin.
> > This is how I've got things setup at the moment, hope this makes
> > sense:
>
> > CFMX7 - multiserver configuration with three instances:
>
> > Instance Name / URL : port
> > Main -http://mydomain.com:8300
> > Web -http://mydomain.com:8301
> > Apps -http://mydomain.com:8302

Marc Esher

unread,
May 9, 2008, 10:49:00 AM5/9/08
to mxu...@googlegroups.com
when you do a normal "createObject" on thse test files, would you use
"interact.onlinePayments._extensions.com.MyCFC"

?

Marc

James Buckingham

unread,
May 9, 2008, 10:49:29 AM5/9/08
to mxunit
If I try "com" in the project MXUnit properties I get the following
path in the MXUnit panel:

com._extensions.com.myCFC

Anything I put in the properties is just being tagged on the front of
my address. If I leave it completely blank I get:
cfusion.war.interact.onlinePayments._extensions.com.myCFC

Would the "." in the cfusion.war cause a problem at all? Sorry I'm
just stabbing in the dark here.

Cheers,
James

James Buckingham

unread,
May 9, 2008, 10:52:33 AM5/9/08
to mxunit
Built a quick test page in the same folder as my CFCs:

<cfscript>
test = createObject("component","myCFC");
</cfscript>

<cfdump var="#test#" />

And that returned fine on both files.

On May 9, 3:49 pm, "Marc Esher" <marc.es...@gmail.com> wrote:
> when you do a normal "createObject" on thse test files, would you use
> "interact.onlinePayments._extensions.com.MyCFC"
>
> ?
>
> Marc
>

James Buckingham

unread,
May 9, 2008, 10:54:15 AM5/9/08
to mxunit
This is an actual call from the project's root application.cfc that I
built last week:

application.payment.com.myCFC =
createObject('component','_extensions.com.myCFC').init();

Again that works fine.

Marc Esher

unread,
May 9, 2008, 10:59:12 AM5/9/08
to mxu...@googlegroups.com
ah. do you have "_extensions" mapped in cfadmin?

James Buckingham

unread,
May 9, 2008, 11:02:06 AM5/9/08
to mxunit
Ah no but we have a com mapping in the main instance :-).

I'm just heading off now but I'll give it a try tonight and reply with
the results ;-)

On May 9, 3:59 pm, "Marc Esher" <marc.es...@gmail.com> wrote:
> ah. do you have "_extensions" mapped in cfadmin?
>

Marc Esher

unread,
May 9, 2008, 11:07:29 AM5/9/08
to mxu...@googlegroups.com
James,

dammit man, you found the scenario that one or two other people
found that we knew would be a problem: where you dont' want to use the
"webroot" preference but you need the "component path" project
property to be "empty".

right now, your project is at L:\cfusion.war\interact\onlinePayments,
and if you put that property to "_extensions", it'll create paths like
"_extensions._extensions", which is bad.

now, there is an "easy" way to deal with this, although it's not
ideal. I dont know if you will mind doing htis or not:

1) set the project property for component root to "onlinePayments"
2) add a mapping into cf for onlinePayments =
L:\cfusion.war\interact\onlinePayments

this way, the plugin will resolve the components as
"onlinePayments._extensions", and cf will understand that path.

sorry for the problems bro. It's a known problem... an "edge" case,
but a problem nonetheless.

marc

James Buckingham

unread,
May 9, 2008, 3:08:52 PM5/9/08
to mxunit
Hi Marc,

I feel like I should apologise, lol. Glad there is something that can
be done though as I'm keen to give MXUnit a go.

Mapping shouldn't be a problem for this project as I'm probably going
to need one anyway so that's cool. I'm trying to get into the site
over VPN at the moment but getting some errors. Can access the facade
fine in my browser and in the Eclipse browser but it won't let me
through MXUnit. The problems just keep coming :-).

Error I'm getting looks like proxy but I don't have one switched on:

Exception message trying to connect to url
http://mydomain.com:8300/mxunit/framework/RemoteFacade.cfc?wsdl is: ;
nested exception is:
java.net.UnknownHostException: proxy1.mydomain.com

Marc Esher

unread,
May 9, 2008, 3:14:49 PM5/9/08
to mxu...@googlegroups.com
Well, I can tell you that viewing things through a browser and
programmatically through eclipse are fundamentally different things.
the browser has access to all kinds of underlying OS stuff, while java
programs like an eclipse plugin do not. So that's why they can behave
differently. Sadly, I don't know much about interacting with proxy
servers programmatically so wouldnt' even know what advice to give
here!

James Buckingham

unread,
May 9, 2008, 3:25:25 PM5/9/08
to mxunit
It's ok it's probably just a setting somewhere. Thought I'd throw it
into the pool anyway :-).

On May 9, 8:14 pm, "Marc Esher" <marc.es...@gmail.com> wrote:
> Well, I can tell you that viewing things through a browser and
> programmatically through eclipse are fundamentally different things.
> the browser has access to all kinds of underlying OS stuff, while java
> programs like an eclipse plugin do not. So that's why they can behave
> differently. Sadly, I don't know much about interacting with proxy
> servers programmatically so wouldnt' even know what advice to give
> here!
>

James Buckingham

unread,
May 9, 2008, 4:09:10 PM5/9/08
to mxunit
Ok proxy sorted - Just needed to filter address and restart.

I've put onlinePayments into the project properties and setup the CF
mapping which is pointing at the root of the onlinePayments project
folder. So when I reload my CFC I'm now getting this in mxUnit:

onlinePayments._extensions.components.myCFC

NOTE: I've changed com to components just to make sure there is no
confusion with that other mapping.

That's the good news. The bad news is I'm still getting the same error
message :-(.

Marc Esher

unread,
May 9, 2008, 4:21:50 PM5/9/08
to mxu...@googlegroups.com
what's the exact message you're getting with that new path?

James Buckingham

unread,
May 9, 2008, 4:33:18 PM5/9/08
to mxunit
Thanks for all your efforts Marc. It's appreciated.

Error I'm getting is:

ERROR getting methods for Component. Message is:

coldfusion.xml.rpc.CFCInvocationException:
[coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find
the ColdFusion Component
onlinePayments._extensions.comoponents.myCFC.]

*Component*: onlinePayments._extensions.components.myCFC

*URL*:
http://mydomain.com:8300/mxunit/framework/RemoteFacade.cfc?wsdl

The new CF mapping is pointing at:
X:\Inetpub\iwsroot\cfusion.war\interact\onlinePayments

Project Properties is pointing at: onlinePayments

James Buckingham

unread,
May 9, 2008, 4:35:47 PM5/9/08
to mxunit
Sorry misspelling:

coldfusion.xml.rpc.CFCInvocationException:
[coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find
the ColdFusion Component
onlinePayments._extensions.components.myCFC.]

NOT comoponents

James Buckingham

unread,
May 9, 2008, 4:40:23 PM5/9/08
to mxunit
If it helps here is the CFC code in my Test CFC as well:

<cfcomponent extends="mxunit.framework.TestCase">

<cffunction name="testInitialisationOfTheTestObject" access="public">
<cfscript>
IWSManager = createObject("component","TestCFC").init();
assertTrue(isObject(IWSManager));
</cfscript>
</cffunction>

</cfcomponent>

HTH

James Buckingham

unread,
May 9, 2008, 4:48:17 PM5/9/08
to mxunit
Sorry another misspelling. Long day :-)

<cfcomponent extends="mxunit.framework.TestCase">

<cffunction name="testInitialisationOfTheTestObject"
access="public">
<cfscript>
IWSManager =
createObject("component","TestCFC").init();
assertTrue(isObject(TestCFC));
</cfscript>
</cffunction>
</cfcomponent>

James Buckingham

unread,
May 12, 2008, 4:05:26 AM5/12/08
to mxunit
Hi Marc,

Stepping away from these things for a weekend sometimes helps the
situation. Just came in this morning to see I hadn't mapped the
onlinePayments in the apps instance, only the main. Did that and I'm
now getting a list of tests and one pass ;-).

Thanks again for all your help. It was very much appreciated.

Cheers,
James

Marc Esher

unread,
May 12, 2008, 7:12:38 AM5/12/08
to mxu...@googlegroups.com
That's awesome. I'm glad you're all set up, and sorry for the pain.

best,

marc

Reply all
Reply to author
Forward
0 new messages