| Issue 186: | HttpAntRunner fails to return data on OpenBD | |
| 1 person starred this issue and may be notified of changes. | Back to list |
|
What steps will reproduce the problem?
Run any test via the ANT test runner.
What is the expected output? What do you see instead?
The expected output is (in this case) JUnit XML. All I see is a WDDX packet.
What version of the product are you using?
Latest stable of MXUnit with OpenBD 1.2.
Please provide any additional information below.
I supplied a fix for this issue in the Summer of 2009 to Bill but it
appears that the fix was never rolled into the trunk. Below are the fixed
methods in the HttpAntRunner.cfc:
<cffunction name="run" access="remote" output="true" returntype="void"
hint="Generates and prints HTML, JUnit style XML, or XML data based on a
directory of tests.">
<cfargument name="type" type="string" hint="Specifies the type to run:
TestCase(testcase) or Directory Path (dir)" required="true" />
<cfargument name="value" type="string" hint="The value for the type:
com.foo.MyTestCase or C:/my/tests/" required="true" />
<cfargument name="packagename" type="string" hint="The package name for
JUnitReportTask" required="false" default="mxunit.testresults" />
<cfargument name="outputformat" type="string" hint="Valid Values:
HTML,XML, or JUNITXML" required="false" default="junitxml" />
<cfargument name="recurse" required="false" default="true"
hint="whether to recurse down the directory tree">
<cfargument name="excludes" required="false" default="" hint="List of
files to exclude if type is DIR">
<cfargument name="componentPath" required="false" hint="performance
improver: pass the cfc-notation. See DirectoryTestSuite for details."
default="">
<cfset var suite =
createObject("component","mxunit.framework.TestSuite").TestSuite()/>
<cfset var results =
createObject("component","mxunit.framework.TestResult").TestResult()/>
<cfscript>
if(arguments.type is "testcase"){
suite =
createObject("component","mxunit.framework.TestSuite").TestSuite();
suite.addAll(arguments.value);
results = suite.run();
}
if(arguments.type is "dir"){
//To Do: add args for recursion, includes, and excludes
if(not isBoolean(arguments.recurse)){
arguments.recurse = false;
}
results =
createObject("component","DirectoryTestSuite").run(directory=arguments.value,
componentPath=arguments.componentPath, recurse=arguments.recurse,
excludes=arguments.excludes);
}
//package name for JUnit reports
results.setPackage(arguments.packagename);
</cfscript>
<!--- Read by Ant client and used to print summary to stdout --->
<cfcookie name="mxunit_summary"
value="#results.testRuns#,#results.testErrors#,#results.testFailures#,#results.totalExecutionTime#"
/>
<cfif arguments.outputformat EQ "html">
<cfcontent reset="true" type="text/html"
/><cfoutput>#printResults(arguments.outputformat,results)#</cfoutput>
<cfelse
<cfcontent reset="true" type="application/xml"
/><cfoutput>#printResults(arguments.outputformat,results)#</cfoutput>
</cfif>
</cffunction>
<cffunction name="printResults" access="private" output="false"
returntype="string">
<cfargument name="type">
<cfargument name="results">
<cfswitch expression="#type#">
<cfcase value="html">
<cfreturn trim(arguments.results.getHTMLResults()) />
</cfcase>
<cfcase value="xml">
<cfreturn trim(arguments.results.getXMLResults()) />
</cfcase>
<cfcase value="junitxml">
<cfreturn trim(arguments.results.getJUnitXMLResults()) />
</cfcase>
<cfdefaultcase><cfreturn trim(arguments.results.getJUnitXMLResults())
/></cfdefaultcase>
</cfswitch>
</cffunction>
Apr 26, 2010
#1
petermac...@gmail.com
Jun 30, 2010
Moving some, but not all, of these to jira.mxunit.org
Status:
Deprecated
|
||||||||