从 Eclipse 运行 MXUnit 测试时找不到应用程序变量

发布于 2024-10-07 04:44:17 字数 342 浏览 6 评论 0原文

所以我遵循这里的小指南 关于如何使用 Eclipse 的 MXUnit 插件通过 Eclipse 运行单个 MXUnit 测试。但正如您在下面的屏幕截图中看到的那样,它不适用于我知道有效的测试,因为似乎使用此方法无法使用应用程序变量。这是行不通的事情吗?或者我可以做些什么来使该应用程序及其变量在以这种方式运行测试时可访问?

运行单个测试时出错

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?

Error when running a single test

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

霓裳挽歌倾城醉 2024-10-14 04:44:17

Erik,您需要指向一个自定义的 RemoteFacade.cfc,您将创建该文件并将其放入测试所在的目录中。插件的帮助中对此进行了完整描述,您可以通过单击 MXUnit 视图中的绿色问号图标来访问该帮助。

单击该图标,然后单击“与 ColdFusion 对话:RemoteFacade.cfc URL”。

有趣的是,您的问题几乎在 mxunit wiki 上逐字询问: http://wiki.mxunit.org/display/default/Eclipse+Plugin+FAQ#EclipsePluginFAQ-Q%3AWhenIrunthetestsintheplugin%2CmyApplicationscopevariablesaren%27tpresent

一定要检查wiki,特别是FAQ页面,当出现这样的问题时。通常,常见问题解答会向您指出正确的文档,以帮助您解决这些问题。

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.

高速公鹿 2024-10-14 04:44:17

我没有给你一个“答案”,但由于我正在努力解决类似的问题,我确实有一些建议来帮助澄清你的情况。

在 MXUnit 测试中,使用 debug() 方法在测试期间以当前状态保存应用程序范围的转储。运行测试后,在左侧窗格中选择错误/失败的测试,然后按 B 键以显示测试的调试输出。然后你就可以确定变量是否存在。

就我而言,这表明我的测试没有在我期望的应用程序上下文中运行(应用程序名称来自 Web 根 Application.cfc,而不是我的测试所在的子文件夹),因此我需要弄清楚为什么会这样。希望对一些人有所帮助!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文