Bug DefaultTestscriptStorage now tries to use xml file first instead of json. That fixes reports that were generated before 3.2 build 52.
@@ -222,13 +222,14 @@ public class DefaultTestScriptStorage implements ITestScriptStorage {
if (FilenameUtils.isExtension(reportRootPath, ZipReport.ZIP_EXTENSION)) {
try (ZipFile zipFile = new ZipFile(reportRoot)) {
- ZipEntry zipJson = zipFile.getEntry(FilenameUtils.removeExtension(reportRoot.getName()) + "/" + ROOT_JSON_REPORT_FILE);
- if (zipJson == null) {
ZipEntry zipXmlProperties = zipFile.getEntry(FilenameUtils.removeExtension(reportRoot.getName()) + "/" + XML_PROPERTIES_FILE);
+
+ if (zipXmlProperties != null) {
try (InputStream stream = zipFile.getInputStream(zipXmlProperties)) {
return convertToTestScriptDescription(reportRootPath, (XmlReportProperties) xmlUnmarshaller.get().unmarshal(stream));
}
} else {
+ ZipEntry zipJson = zipFile.getEntry(FilenameUtils.removeExtension(reportRoot.getName()) + "/" + ROOT_JSON_REPORT_FILE);
try (InputStream stream = zipFile.getInputStream(zipJson)) {
return convertToTestScriptDescription(reportRootPath, jsonObjectMapper.readValue(stream, ReportRoot.class));
}
@@ -236,15 +237,15 @@ public class DefaultTestScriptStorage implements ITestScriptStorage {
}
}
else {
- if (workspaceDispatcher.exists(FolderType.REPORT, reportRootPath, ROOT_JSON_REPORT_FILE)) {
- try (InputStream stream = new FileInputStream(workspaceDispatcher.getFile(FolderType.REPORT, reportRootPath, ROOT_JSON_REPORT_FILE))) {
- return convertToTestScriptDescription(reportRootPath, jsonObjectMapper.readValue(stream, ReportRoot.class));
- }
- } else {
+ if (workspaceDispatcher.exists(FolderType.REPORT, reportRootPath, XML_PROPERTIES_FILE)) {
File xmlPropertiesFile = workspaceDispatcher.getFile(FolderType.REPORT, reportRootPath, XML_PROPERTIES_FILE);
try (InputStream stream = new FileInputStream(xmlPropertiesFile)) {
return convertToTestScriptDescription(reportRootPath, (XmlReportProperties) xmlUnmarshaller.get().unmarshal(stream));
}
+ } else {
+ try (InputStream stream = new FileInputStream(workspaceDispatcher.getFile(FolderType.REPORT, reportRootPath, ROOT_JSON_REPORT_FILE))) {
+ return convertToTestScriptDescription(reportRootPath, jsonObjectMapper.readValue(stream, ReportRoot.class));
+ }
}
}
} catch (Exception e) {
