import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
\r
-import org.argeo.slc.core.test.SimpleResultPart;\r
+import org.argeo.slc.core.test.TestResultListener;\r
import org.argeo.slc.core.test.TestResultPart;\r
import org.argeo.slc.core.test.TestStatus;\r
\r
* @see TreeTestResult\r
* \r
*/\r
-public class TreeTestResultLogger extends AsynchronousTreeTestResultListener {\r
+public class TreeTestResultLogger implements TestResultListener<TreeTestResult> {\r
\r
private static Log log = LogFactory.getLog(TreeTestResultLogger.class);\r
\r
- public TreeTestResultLogger() {\r
- super(true);\r
- }\r
-\r
- @Override\r
- protected void resultPartAdded(PartStruct partStruct) {\r
- TestResultPart part = partStruct.part;\r
- String msg = partStruct.part + " - " + partStruct.uuid + ":"\r
- + partStruct.path;\r
- if (part.getStatus().equals(TestStatus.PASSED)) {\r
+ public void resultPartAdded(TreeTestResult testResult,\r
+ TestResultPart testResultPart) {\r
+ String msg = testResultPart + " - " + testResult.getUuid() + ":"\r
+ + testResult.getCurrentPath();\r
+ if (testResultPart.getStatus().equals(TestStatus.PASSED)) {\r
log.info(msg);\r
- } else if (part.getStatus().equals(TestStatus.FAILED)) {\r
+ } else if (testResultPart.getStatus().equals(TestStatus.FAILED)) {\r
log.warn(msg);\r
- } else if (part.getStatus().equals(TestStatus.ERROR)) {\r
- log.error(msg + ((SimpleResultPart) part).getExceptionMessage());\r
+ } else if (testResultPart.getStatus().equals(TestStatus.ERROR)) {\r
+ log.error(msg + "\n" + testResultPart.getExceptionMessage());\r
} else {\r
log.error("Unknow test status: " + msg);\r
}\r
}\r
\r
+ public void close(TreeTestResult testResult) {\r
+ log.info("Test result " + testResult.getUuid() + " closed.");\r
+ }\r
+\r
}\r