| Issue 185: | JUnitXMLTestResult breaks on OpenBlueDragon 1.2 Stable | |
| 1 person starred this issue and may be notified of changes. | Back to list |
|
What steps will reproduce the problem? Run any test case where there is a failure when using the JUnit XML result. What is the expected output? What do you see instead? The cause of the issue is that the "stacktrace" is not available on OpenBlueDragon due to the fact that the engine executes/compiles CFML code differently. The stracktrace on OpenBD is entirely different and not useful to a CFML developer (I've seen it, complete uselessness). What version of the product are you using? On what operating system? Using latest stable of MXUnit. Please provide any additional information below. Use this patch to conditionally check for the stracktrace. I sent patches for this in the Summer of 2009 to Bill. Did they not get rolled in? <cffunction name="buildXmlResults" access="public" output="false" hint="Converts the TestResult into the xml representation"> <cfargument name="results" type="array" required="true" /> <cfscript> var i = ""; this.resultsXML = this.resultsXML & '<testsuite name="#this.name#" hostname="#cgi.remote_host#" tests="#this.testRuns#" failures="#this.failures#" errors="#this.errors#" timestamp="#dateFormat(now(),"mm/dd/yy")# #timeFormat(now(),"medium")#" time="#this.totalExecutionTime/1000#">'; this.resultsXML = this.resultsXML & '<properties>'; this.resultsXML = this.resultsXML & genProps(server.coldfusion); this.resultsXML = this.resultsXML & genProps(server.os); this.resultsXML = this.resultsXML & genProps(cgi); this.resultsXML = this.resultsXML & genProps(cookie); this.resultsXML = this.resultsXML & genProps(request); if(isDefined("application")) this.resultsXML = this.resultsXML & genProps(application); //JUnitReport XSL transformation doesn't like some of the CGI stuff, like query string & //CGI props should not be as important at sever level properties this.resultsXML = this.resultsXML & '</properties>'; for(i = 1; i lte arrayLen(arguments.results); i = i + 1){ testResults = arguments.results[i]; this.resultsXML = this.resultsXML & '<testcase classname="#testResults.component#" name="#testResults.testname#" time="#testResults.time/1000#">'; if( listFindNoCase("Failed",testResults.testStatus)){ this.resultsXML = this.resultsXML & '<failure message="#xmlformat(testResults.error.message)# || details: #xmlformat(testResults.error.detail)#">'; if (StructKeyExists(testresults.error, "stacktrace")) { this.resultsXML = this.resultsXML & '<![CDATA[#testResults.error.stacktrace#]]>'; } this.resultsXML = this.resultsXML & '</failure>'; } else if( listFindNoCase("Error",testResults.testStatus)) { this.resultsXML = this.resultsXML & '<error message="#testResults.error.type#">'; if (StructKeyExists(testresults.error, "stacktrace")) { this.resultsXML = this.resultsXML & '<![CDATA[#testResults.error.stacktrace#]]>'; } this.resultsXML = this.resultsXML & '</failure>'; } this.resultsXML = this.resultsXML & '</testcase>'; } this.resultsXML = this.resultsXML & '</testsuite>'; </cfscript> </cffunction> Optionally, I would offer building a tag context converter. It would take the tag context and convert to a form that MXUnit could stick in the JUnit results. Let me know if you would like me to build one for you.
Apr 26, 2010
#3
petermac...@gmail.com
Apr 27, 2010
thanks, Peter! This is also to note that genProps also needs to escape data as per (http://groups.google.com/group/mxunit/browse_thread/thread/6b575fa819d664eb) ... xmlFormat(prop) ...
Jun 30, 2010
Moving some, but not all, of these to jira.mxunit.org
Status:
Deprecated
|
||||||||