简体   繁体   English

如何调试Fitnesse设置

[英]How to debug Fitnesse setup

I'm using Fitnesse with CleanCodeFixtures from Michael Sorens article, Acceptance Testing with Fitnesse . 我正在使用Michael Sorens文章“ Fitnessit的验收测试”中带有 CleanCodeFixtures的Fitnesse
I presume the code is right, the Fitnesse pages are right, and that it is something with my setup. 我认为代码是正确的,Fitnesse页面是正确的,并且这与我的设置有关。

OVERVIEW 总览
Michael's Fitnesse pages refer to fixtures without the "Fixture" suffix. 迈克尔(Michael)的Fitnesse(菲力特菲克)页面是指没有后缀“ Fixture”的灯具。 In many places this works fine, but in many it doesn't. 在很多地方,这种方法都行得通,但在许多地方却行不通。
CleanCodeFixtures.Common.Diagnostic as opposed to CleanCodeFixtures.Common.DiagnosticFixture. CleanCodeFixtures.Common.Diagnostic与CleanCodeFixtures.Common.DiagnosticFixture相反。
How to debug this situation? 如何调试这种情况?

DETAILS 细节
!path is in Fitnesse\\FitNesseRoot\\content.txt and the dll is in the right directory. !path在Fitnesse \\ FitNesseRoot \\ content.txt中,并且dll在正确的目录中。 It is finding the dll, according to ProcMon. 根据ProcMon,它正在查找dll。

!note .NET References
!path fitsharp\dbfit.dll
!path fitsharp\dbfit.sqlserver.dll
!path Fixtures\CleanCodeFixtures.dll
!path fitsharp\fit.dll

It still can't find the fixture inside the dll. 它仍然无法在dll中找到固定装置。

The file Fitnesse\\FitNesseRoot\\CleanCode\\SuiteSetUp\\content.txt contains 文件Fitnesse \\ FitNesseRoot \\ CleanCode \\ SuiteSetUp \\ content.txt包含

!|CleanCodeFixtures.Common.Diagnostic|
|Begin                               |
|${PAGE_NAME}                        |

!|import                      |
|dbfit.fixture                |
|CleanCodeFixtures.Common     |
|CleanCodeFixtures.ControlFlow|
|CleanCodeFixtures.Database   |

!note This allows enabling/disabling debugging with the external command files !-EnableDebug.cmd and DisableDebug.cmd-!.
!|Debugger                   |
|Launch With External Trigger|
|                            |

It complains that it can't find the fixtures. 它抱怨找不到固定装置。

Could not find fixture: CleanCodeFixtures.Common.Diagnostic. 找不到固定装置:CleanCodeFixtures.Common.Diagnostic。
Could not find fixture: import. 找不到灯具:导入。
Could not find fixture: Debugger. 找不到固定装置:调试器。

Adding this before the first line 在第一行之前添加

!|Import |    ## note that it is case sensitive
|CleanCodeFixtures.Common.Diagnostic|

Appears to work but doesn't seem to change anything. 似乎可以工作,但似乎没有任何改变。 When it uses the Diagnostic class in the next table, it gets the same error. 当它在下表中使用Diagnostic类时,将得到相同的错误。

CleanCodeFixtures.Common.Diagnostic CleanCodeFixtures.Common.Diagnostic
Could not find fixture: CleanCodeFixtures.Common.Diagnostic. 找不到固定装置:CleanCodeFixtures.Common.Diagnostic。

I can't figure how it would find the DLL but not find any of the fixtures. 我无法弄清楚它将如何找到DLL,但找不到任何固定装置。

The code has a Diagnostic class and a DiagnosticFixture class. 该代码具有Diagnostic类和DiagnosticFixture类。

namespace CleanCodeFixtures.Common
{
    public class Diagnostic

... ...

namespace CleanCodeFixtures.Common   
{
    public class DiagnosticFixture : ColumnFixture

Changing the Fitnesse page to reference the DiagnosticFixture explicitly works, but doesn't explain why it works without it for many other fixtures. 更改Fitnessfite页面以明确引用DiagnosticFixture是可行的,但没有解释为什么在许多其他灯具中不使用它就可以工作。
Any ideas of how to debug this? 关于如何调试的任何想法?

Check your classpath settings for test execution. 检查您的类路径设置以执行测试。 If you are using an external dependency, you need to use !path statement to point the test execution to the right place to find dependencies. 如果使用的是外部依赖关系,则需要使用!path语句将测试执行指向正确的位置以查找依赖关系。 Try putting something like this on your test page (or something up in the hierarchy): 尝试在您的测试页上放置这样的内容(或层次结构中的内容):

!path /path/to/your.dll

After this, the test should be able to find the fixture on the classpath, but from the code you posted, it seems you did not import the Fixture to the test case. 之后,测试应该能够在类路径上找到灯具,但是从您发布的代码来看,似乎您没有将灯具导入到测试用例中。 To do this: 去做这个:

!|import |
|CleanCodeFixtures.Common.Diagnostic|

Please post the complete test page code if these two steps cannot resolve it. 如果这两个步骤不能解决问题,请发布完整的测试页代码。

The terms that were working were wiki words. 有效的术语是维基词。 "Word Count" would find WordCountFixture but "Diagnostic" wouldn't find DiagnosticFixture. “字数统计”将找到WordCountFixture,但“诊断”则找不到DiagnosticFixture。 making it into a wiki word, [Diagnostic], seems to have fixed it. 使它成为Wiki单词[诊断]似乎已解决。

Not sure why it works for Micheal, et al. 不确定为什么它适用于Micheal等。 Still seems like the wrong solution. 似乎仍然是错误的解决方案。 But it works for me. 但这对我有用。 I can move forward using wiki words or explicitly specifying Fixture. 我可以使用Wiki单词或明确指定Fixture前进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM