Bug 431047 - test results are not getting summarized on DL page
diff --git a/bundles/org.eclipse.build.tools/buildTools.jar b/bundles/org.eclipse.build.tools/buildTools.jar
index 3cfc119..9d7fbe3 100644
--- a/bundles/org.eclipse.build.tools/buildTools.jar
+++ b/bundles/org.eclipse.build.tools/buildTools.jar
Binary files differ
diff --git a/bundles/org.eclipse.build.tools/buildTools.jar.jardesc b/bundles/org.eclipse.build.tools/buildTools.jar.jardesc
index e6a0295..6e7e319 100644
--- a/bundles/org.eclipse.build.tools/buildTools.jar.jardesc
+++ b/bundles/org.eclipse.build.tools/buildTools.jar.jardesc
@@ -10,15 +10,14 @@
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false">
- <file path="/org.eclipse.build.tools/.classpath"/>
- <folder path="/org.eclipse.build.tools/META-INF"/>
<file path="/org.eclipse.build.tools/build.properties"/>
- <file path="/org.eclipse.build.tools/.project"/>
- <file path="/org.eclipse.build.tools/about.html"/>
- <file path="/org.eclipse.build.tools/plugin.xml"/>
+ <folder path="/org.eclipse.build.tools/META-INF"/>
<file path="/org.eclipse.build.tools/.gitignore"/>
- <folder path="/org.eclipse.build.tools/scripts"/>
- <javaElement handleIdentifier="=org.eclipse.build.tools/src"/>
+ <file path="/org.eclipse.build.tools/plugin.xml"/>
+ <file path="/org.eclipse.build.tools/about.html"/>
<file path="/org.eclipse.build.tools/plugin.properties"/>
+ <javaElement handleIdentifier="=org.eclipse.build.tools/src"/>
+ <file path="/org.eclipse.build.tools/.classpath"/>
+ <file path="/org.eclipse.build.tools/.project"/>
</selectedElements>
</jardesc>
\ No newline at end of file
diff --git a/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java b/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
index 99bcab3..8e973bb 100644
--- a/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
+++ b/bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java
@@ -58,14 +58,14 @@
static final String compileLogsToken = "%compilelogs%";
static final String accessesLogsToken = "%accesseslogs%";
- private static String extractXmlRelativeFileName(final String rootCanonicalPath, final File xmlFile) {
+ private String extractXmlRelativeFileName(final String rootCanonicalPath, final File xmlFile) {
if (rootCanonicalPath != null) {
String xmlFileCanonicalPath = null;
try {
xmlFileCanonicalPath = xmlFile.getCanonicalPath();
}
catch (final IOException e) {
- // ignore
+ logException(e);
}
if (xmlFileCanonicalPath != null) {
// + 1 to remove the '\'
@@ -75,6 +75,14 @@
return "";
}
+ private void logException(final Throwable e) {
+ log(e.getMessage());
+ StackTraceElement[] stackTrace = e.getStackTrace();
+ for (StackTraceElement stackTraceElement : stackTrace) {
+ log(stackTraceElement.toString());
+ }
+ }
+
public static byte[] getFileByteContent(final String fileName) throws IOException {
InputStream stream = null;
try {
@@ -319,17 +327,17 @@
}
catch (final IOException e) {
- System.out.println("IOException: " + fileName);
- // e.printStackTrace();
+ log("IOException: " + fileName);
+ logException(e);
return 0;
}
catch (final SAXException e) {
- System.out.println("SAXException: " + fileName);
- // e.printStackTrace();
+ log("SAXException: " + fileName);
+ logException(e);
return 0;
}
catch (final ParserConfigurationException e) {
- e.printStackTrace();
+ logException(e);
}
return errorCount;
}
@@ -370,12 +378,12 @@
}
- System.out.println("Begin: Generating test results index page");
- System.out.println("Parsing XML files");
+ log("Begin: Generating test results index page");
+ log("Parsing XML files");
parseXml();
- System.out.println("Parsing compile logs");
+ log("Parsing compile logs");
parseCompileLogs();
- System.out.println("End: Generating test results index page");
+ log("End: Generating test results index page");
writeTestResultsFile();
// For the platform build-page, write platform files, in addition to the
// index file
@@ -844,13 +852,13 @@
aDocument = builder.parse(inputSource);
}
catch (final SAXException e) {
- e.printStackTrace();
+ logException(e);
}
catch (final IOException e) {
- e.printStackTrace();
+ logException(e);
}
catch (final ParserConfigurationException e) {
- e.printStackTrace();
+ logException(e);
}
finally {
if (reader != null) {
@@ -899,7 +907,7 @@
}
if (errorCount != 0) {
// use wildcard in place of version number on directory names
- // System.out.println(log + "/n");
+ // log(log + "/n");
String logName = log.substring(getCompileLogsDirectoryName().length() + 1);
final StringBuffer buffer = new StringBuffer(logName);
buffer.replace(logName.indexOf("_") + 1, logName.indexOf(File.separator, logName.indexOf("_") + 1), "*");
@@ -948,7 +956,7 @@
sourceDirectoryCanonicalPath = sourceDirectoryParent.getCanonicalPath();
}
catch (final IOException e) {
- // ignore
+ logException(e);
}
for (int i = 0; i < xmlFileNames.length; i++) {
if (xmlFileNames[i].getPath().endsWith(".xml")) {
@@ -976,7 +984,7 @@
} else {
testsRan = false;
- System.out.println("Test results not found in " + sourceDirectory.getAbsolutePath());
+ log("Test results not found in " + sourceDirectory.getAbsolutePath());
}
}
@@ -1107,7 +1115,7 @@
aByteArray = getFileByteContent(fileName);
}
catch (final IOException e) {
- e.printStackTrace();
+ logException(e);
}
if (aByteArray == null) {
return "";
@@ -1124,7 +1132,7 @@
resultString = resultString + source.substring(replaceIndex + original.length());
return resultString;
} else {
- System.out.println("Could not find token: " + original);
+ log("Could not find token: " + original);
return source;
}
@@ -1317,10 +1325,10 @@
outputStream.write(contents.getBytes());
}
catch (final FileNotFoundException e) {
- System.out.println("File not found exception writing: " + outputFileName);
+ log("File not found exception writing: " + outputFileName);
}
catch (final IOException e) {
- System.out.println("IOException writing: " + outputFileName);
+ log("IOException writing: " + outputFileName);
}
finally {
if (outputStream != null) {