You might have notice in the FitNesse urls, a “?test” at the end when you run a test page. Also, when you edit a page, you are using “?edit”. There are many of these querystring switches you can use to do some interesting things. You can see all of these by opening up the Java source:
addResponder(“edit”, EditResponder.class);
addResponder(“saveData”, SaveResponder.class);
addResponder(“tableWizard”, TableWizardResponder.class);
addResponder(“search”, SearchResponder.class);
addResponder(“searchForm”, SearchFormResponder.class);
addResponder(“test”, TestResponder.class);
addResponder(“suite”, SuiteResponder.class);
addResponder(“proxy”, SerializedPageResponder.class);
addResponder(“versions”, VersionSelectionResponder.class);
addResponder(“viewVersion”, VersionResponder.class);
addResponder(“rollback”, RollbackResponder.class);
addResponder(“names”, NameWikiPageResponder.class);
addResponder(“properties”, PropertiesResponder.class);
addResponder(“saveProperties”, SavePropertiesResponder.class);
addResponder(“whereUsed”, WhereUsedResponder.class);
addResponder(“refactor”, RefactorPageResponder.class);
addResponder(“deletePage”,DeletePageResponder.class);
addResponder(“renamePage”, RenamePageResponder.class);
addResponder(“movePage”, MovePageResponder.class);
addResponder(“pageData”, PageDataWikiPageResponder.class);
addResponder(“createDir”, CreateDirectoryResponder.class);
addResponder(“upload”, UploadResponder.class);
addResponder(“socketCatcher”, SocketCatchingResponder.class);
addResponder(“fitClient”, FitClientResponder.class);
addResponder(“deleteFile”, DeleteFileResponder.class);
addResponder(“renameFile”, RenameFileResponder.class);
addResponder(“deleteConfirmation”,DeleteConfirmationResponder.class);
addResponder(“renameConfirmation”,RenameFileConfirmationResponder.class);
addResponder(“raw”, RawContentResponder.class);
addResponder(“rss”, RssResponder.class);
addResponder(“import”, WikiImportingResponder.class);
addResponder(“files”, FileResponder.class);
addResponder(“shutdown”, ShutdownResponder.class);
addResponder(“format”, TestResultFormattingResponder.class);
addResponder(“symlink”, SymbolicLinkResponder.class);
Some of the more interesting ones I like are rss, fitClient, and raw. Yes, “shutdown” will actually shut down the wiki. Use with care.
The “rss” querystring parameter will give you an rss feed, and the “raw” parameter will spit out the exact contents of the underlying “content.txt” file. This is the exact wiki text that the user entered. “fitClient“ is the one that interests me most because it will spit out the html tables needed to actually run the FitNesse tests offline or in a debugger. The html is rendered to the browser, but there is a bug in the FitClientResponder class that violates a rule of an Http request, so I can’t programmatically get this page with .Net code (say, the WebClient class).
Something very interesting I’ve done with the “raw” switch is to pull it back into an NUnit helper class, run it through some simple translator code:
StringReader reader = new StringReader(wikiText);
string line = reader.ReadLine();
while(line != null)
{
line = line.Trim();
if(line.StartsWith(“!”))
{
string row = line.Trim(‘!’, ‘|’);
this.StartTable(row);
}
else if(line.StartsWith(“|”))
{
// get rid of leading and trailing “|”, and split on the rest.
string[] columns = line.TrimStart(‘|’).TrimEnd(‘|’).Split(‘|’);
this.AddRow(columns);
}
line = reader.ReadLine();
}
reader.Close();
Then, I have the html tables that allow me to create a new Parse object by passing in this html string. Then it’s trivial to execute this against the FitNesse test engine.
By the way, Google Desktop 2 is great. I’ve been using it to search and find source code. Even if the documentation is complete, or you want to dig more, Desktop search is great for finding tidbits in the source code itself (I’ve used MSN search as well. They both work well).