Application variables not found when running MXUnit test from Eclipse

So, I followed a tiny tutorial here on how to run one MXUnit test with Eclipse using the MXUnit plugin for Eclipse. But, as you can see in the screenshot below, this did not work for the tests, which, as I know, work because it seems that application variables are not available using this method. Is that something that won't work? or is there something I can do to make this application and its variables available when running tests this way?

Error when running a single test

+4
source share
2 answers

Eric, you need to point to the custom RemoteFacade.cfc that you create and place in the directory where your tests live. This is fully described in the plugin's help, which you can access by clicking the green question mark icon in the MXUnit view.

Click this icon, and then click "Talking to ColdFusion: RemoteFacade.cfc URL".

Interestingly, your question is asked almost verbatim on the wiki mxunit: http://wiki.mxunit.org/display/default/Eclipse+Plugin+FAQ#EclipsePluginFAQ-Q%3AWhenIrunthetestsintheplugin%2CmyApplicationscopevariablesaren%27tpresent

Definitely check out the wiki and, in particular, the frequently asked questions page when such problems arise. Frequently asked questions indicate the right documentation to help you solve these problems.

+7
source

I have no “answer” for you, but since I am struggling with something like this, I have a few tips to help clarify your situation.

In your MXUnit test, use the debug() method to keep the application area dump in its current state during the test. After starting the test, select the error / failed test in the left panel and press the B key to display the debug test result. Then you will know for sure whether the variables exist or not.

In my case, this shows that my tests are not running in the context of the application that I expect (the name of the application belongs to the web root Application.cfc, and not the subfolder where my tests live), so I need to find out why this is so. Hope this helps!

+2
source

All Articles