简体   繁体   中英

How to debug Fitnesse setup

I'm using Fitnesse with CleanCodeFixtures from Michael Sorens article, Acceptance Testing with Fitnesse .
I presume the code is right, the Fitnesse pages are right, and that it is something with my setup.

OVERVIEW
Michael's Fitnesse pages refer to fixtures without the "Fixture" suffix. In many places this works fine, but in many it doesn't.
CleanCodeFixtures.Common.Diagnostic as opposed to CleanCodeFixtures.Common.DiagnosticFixture.
How to debug this situation?

DETAILS
!path is in Fitnesse\\FitNesseRoot\\content.txt and the dll is in the right directory. It is finding the dll, according to ProcMon.

!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.

The file Fitnesse\\FitNesseRoot\\CleanCode\\SuiteSetUp\\content.txt contains

!|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.
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.

CleanCodeFixtures.Common.Diagnostic
Could not find fixture: CleanCodeFixtures.Common.Diagnostic.

I can't figure how it would find the DLL but not find any of the fixtures.

The code has a Diagnostic class and a DiagnosticFixture class.

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.
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. 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. making it into a wiki word, [Diagnostic], seems to have fixed it.

Not sure why it works for Micheal, et al. Still seems like the wrong solution. But it works for me. I can move forward using wiki words or explicitly specifying Fixture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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