Author: lfryc(a)redhat.com
Date: 2010-11-05 11:15:01 -0400 (Fri, 05 Nov 2010)
New Revision: 19961
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
Log:
issue tracking was extended by possibility to annotate whole class
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2010-11-05
15:14:10 UTC (rev 19960)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java 2010-11-05
15:15:01 UTC (rev 19961)
@@ -23,6 +23,9 @@
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
@@ -30,6 +33,8 @@
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.ITestResult;
+import static java.util.Arrays.asList;
+
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
@@ -49,9 +54,19 @@
@Override
protected void onFailure(ITestResult result) {
super.onFailure(result);
+
+ List<String> issueList = new LinkedList<String>();
IssueTracking issueTracking =
result.getMethod().getMethod().getAnnotation(IssueTracking.class);
- if (issueTracking != null && issueTracking.value().length > 0) {
- String issues = StringUtils.join(issueTracking.value(), "\n");
+ if (issueTracking != null) {
+ issueList.addAll(asList(issueTracking.value()));
+ }
+ issueTracking = (IssueTracking)
result.getMethod().getRealClass().getAnnotation(IssueTracking.class);
+ if (issueTracking != null) {
+ issueList.addAll(asList(issueTracking.value()));
+ }
+
+ if (!issueList.isEmpty()) {
+ String issues = StringUtils.join(issueList, "\n");
String filenameIdentification = getFilenameIdentification(result);
File issueTrackingOutputFile = new File(failuresOutputDir,
filenameIdentification + "/issues.txt");
try {
Show replies by date