So I was following the tiny guide here on how to run a single MXUnit test with Eclipse using the MXUnit plugin for Eclipse. But as you can see in the screen shot below it didn't work out for tests that I know work, because it appears that the application variables are not available using this method. Is that something that will not work? or is there something that I can do to make that application and it's variables accessible when running tests this way?
Erik, you need to point to a custom RemoteFacade.cfc which you'll create and put 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 that icon, and then click the "Talking to ColdFusion: The RemoteFacade.cfc URL".
Interestingly enough, your question is asked almost verbatim on the mxunit wiki: http://wiki.mxunit.org/display/default/Eclipse+Plugin+FAQ#EclipsePluginFAQ-Q%3AWhenIrunthetestsintheplugin%2CmyApplicationscopevariablesaren%27tpresent
Definitely check the wiki, and in particular the FAQ page, when problems like this arise. Usually the FAQs will point you to the correct documentation which will help you solve these problems.
I don't have an "answer" for you, but as I'm struggling with something similar, I do have some advice to help clarify your situation.
In your MXUnit test, use the debug()
method to save a dump of the application scope in its current state during the test. After running the test, select the error/failed test in the left pane and hit the B key to show the debug output from the test. Then you will know for sure whether the variables are there or not.
In my case, this shows that my tests are not running in the application context that I'm expecting (application name is from the web-root Application.cfc, not the sub-folder that my tests live in), so I need to figure out why that is. Hope that helps some!
© 2022 - 2024 — McMap. All rights reserved.