|
From: <luk...@us...> - 2007-11-09 18:09:21
|
Revision: 177
http://asunit.svn.sourceforge.net/asunit/?rev=177&view=rev
Author: lukebayes
Date: 2007-11-09 10:09:26 -0800 (Fri, 09 Nov 2007)
Log Message:
-----------
Improving Continuous Integration Printer
Modified Paths:
--------------
trunk/framework/as3/asunit/framework/TestFailure.as
trunk/framework/as3/asunit/textui/XMLResultPrinter.as
Modified: trunk/framework/as3/asunit/framework/TestFailure.as
===================================================================
--- trunk/framework/as3/asunit/framework/TestFailure.as 2007-11-09 17:55:54 UTC (rev 176)
+++ trunk/framework/as3/asunit/framework/TestFailure.as 2007-11-09 18:09:26 UTC (rev 177)
@@ -21,8 +21,13 @@
}
public function failedFeature():String {
- return failedTest().getName() + '.' + fFailedTestMethod + "()";
+ return failedTest().getName() + '.' + fFailedTestMethod;
}
+
+ public function failedMethod():String {
+ return fFailedTestMethod;
+ }
+
/**
* Gets the failed test case.
*/
Modified: trunk/framework/as3/asunit/textui/XMLResultPrinter.as
===================================================================
--- trunk/framework/as3/asunit/textui/XMLResultPrinter.as 2007-11-09 17:55:54 UTC (rev 176)
+++ trunk/framework/as3/asunit/textui/XMLResultPrinter.as 2007-11-09 18:09:26 UTC (rev 177)
@@ -71,7 +71,7 @@
private var errors:Array;
public function XMLTestResult(test:Test) {
- this.test = test;
+ this.test = test;
failures = new Array();
}
@@ -88,11 +88,33 @@
return result;
}
+ private function renderOpener(methodName:String):String {
+ return "<testcase classname='" + test.getName() + "' name='" + methodName + "'>\n";
+ }
+
+ private function renderFailure(methodName:String):String {
+ var failure:TestFailure;
+ for each(failure in failures) {
+ if(failure.failedMethod() == methodName) {
+ return "<failure type='" + failure.thrownException().name + "'>" + failure.thrownException().getStackTrace() + "\n</failure>\n";
+ }
+ }
+ return '';
+ }
+
+ private function renderCloser():String {
+ return '</testcase>\n';
+ }
+
public function toString():String {
- var str:String = "";
- str += "<testcase classname='" + test.getName() + "' name='[method name here]'>\n";
- str += renderFailures();
- str += "</testcase>";
+ var str:String = '';
+ var method:String;
+ var failure:TestFailure;
+ for each(method in test.getTestMethods()) {
+ str += renderOpener(method);
+ str += renderFailure(method);
+ str += renderCloser();
+ }
return str;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|