Unit Tests Not Running

Hello Guys,

I’m trying to run a unit test suite but I keep getting an error like this all the time: http://cl.ly/3z1q0J1H3h0Z3R2Q1J2M

When trying to run the tests using the Eclipse plugin for MXUnit, I get an error like this: coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.CfJspPage$NoSuchTemplateException : Could not find the ColdFusion component or interface sorryapp.com.test.integration.GeneralTest.Ensure that the name is correct and that the component or interface exists.]

This is the code from my testsuite.cfm http://bit.ly/he0MMg and this is my test cfc http://pastebin.com/fviHD47S both pretty much stock

Can anyone shed any light on this problem?

Thanks,

Robert

are you running from eclipse or browser?

Also, the integration test is missing the “AppMapping” annotation on the test, unless the app is the root app.

but the problem seems to be something else about pathing.

Hi Luis,

This is from both Browser and Plugin.

The app is the root app which is why I left out the mapping.

Thanks bud,

Robert

Hmm, It might be the suite runner.

Try running the test by itself.

Luis F. Majano
President
Ortus Solutions, Corp

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

Hi Luis,

When I try running the test by itself using the remote method on the test cfc I get an error like this:

http://cl.ly/2R3D0W2V3a3k0O3o2z3G

Cheers,

Robert

Hi Robert,

few questions. Are you using the xml approach or the cfc approach?

Is your tests folder within your web root?
Do you have the provided Application.cfc
What version of coldbox you using?

Luis F. Majano
President
Ortus Solutions, Corp

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

Hi Luis,

I’m using the CFC config, not XML.
My test folder is in the root.
This is my test dir app.cfc: http://pastebin.com/YuQZ1t4T
This is my main app.cfc: http://pastebin.com/6LW1uyrw
I’m using ColdBox 3.0.0 RC2 14:14 - The latest bleeding edge from GitHub.

Thanks,

Robert

Ok, cool, that looks good, So can you paste your test code and handler code, I will replicate the setup here.

Luis F. Majano
President
Ortus Solutions, Corp

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

Thanks Luis, I appreciate this.

Test code: http://pastebin.com/tcraJJjK
Handler code: http://pastebin.com/byJU1ak7

Let me know how you get on.

Robert

Robert,

I don't really know what is going on, it looks good. Do me a favor
add this to the test just for kicks:

<cfcomponent extends="coldbox.system.testing.BaseTestCase"
appMapping="/">

Then tell me what happens

H Luis,

So you weren't able to replicate the problem then?

I've just tried adding the / appMapping but it didn't make any difference, I got the same error.

I've tried a couple of other things myself, like changing the name of my product from ''sorryapp.com' to 'sorryapp' in case that was causing the problem.

I've also disabled the SES stuff in case that was the problem.

However, the issue still exists, I'm getting that same error message.

Most odd.

Thanks for your help so far.

Robert

Is there a way you can trace the issues in the base test case, see why it can find the configuration file?

Hi Luis,

I’m very new to ColdBox so not quite sure how I’d best go about trying to dig down into the problem. One thing I have found is that when trying to access the remote facade for MXUnit I get an error like this:

CloudApp — Not Found

Does that help at all?

I think the best bet would be if someone was able to replicate my issue.

I’ve uploaded a ZIP of my webroot for this project for anyone who wants to take a look at it. Is anyone else able to run this without problems? Or do you get the same errors thrown as me? This would at least help narrow the problem down to code/bug vs. environmental.

http://weboffins.com/unittest.zip

Thanks guys,

Robert

Is mxunit in the wwwroot or is it above it? If it is above it do you have a virtual directory setup for it?

Regards,

Andrew Scott

http://www.andyscott.id.au/

Hello Guys,

I now have this working! Although I’m still a little confused as to why it wasn’t working before.

On some excellent advice from John Whish I moved my webroot up a directory, so my directory structure looked like this:

  • wwwroot
    ---- mxunit
    ---- coldbox
    ---- sorryapp
    -------- config
    -------- model
    etc

instead of it’s old structure of

  • wwwroot
    — mxunit
    — coldbox
    — model
    — config
    — handlers
    etc.

I then added a mapping to my test folder app.cfc which looked something like this:

this.mappings["/approot"] = ExpandPath( “…/” );

And it then sprung into life. App runs fine. Tests run perfectly from both browser and Eclipse.

Like I say, I’m still a little confused, but so long as we’re working then I’m happy.

Thanks,

Robert

It should work from the webroot as well, that’s just how I set my dev box up, you won’t need the “approot” mapping then.