Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominic Guss2018-08-30 17:24:18 -0400
committerDominic Guss2018-09-10 14:49:38 -0400
commitb83191543307ee0b5f255153c57d11aa2bcf01a5 (patch)
treef251ea7d9e20b7827c1f40390f66e042e7b18d49
parentc996a252d8395b4de587410ecd0f3be47d499a80 (diff)
downloadorg.eclipse.osee-b83191543307ee0b5f255153c57d11aa2bcf01a5.tar.gz
org.eclipse.osee-b83191543307ee0b5f255153c57d11aa2bcf01a5.tar.xz
org.eclipse.osee-b83191543307ee0b5f255153c57d11aa2bcf01a5.zip
bug[ats_TW10426]: Coverage tool not accounting for newly added IMPORTED_RESULTS directory LINUX
Change-Id: I79b9688ced84ffea5a6d0dad0992669a102e2bf8 Signed-off-by: Dominic Guss <Dominic.Guss@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java42
1 files changed, 23 insertions, 19 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
index 06e0745c07..1d0a9e3936 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java
@@ -385,33 +385,37 @@ public class LisFileParser implements DispoImporterApi {
private void processResult(VCastResult result, OperationReport report) throws Exception {
String resultPath = result.getPath();
String resultPathAbs = vCastDir + File.separator + resultPath;
-
- boolean exists = false;
File resultsFile = new File(resultPathAbs);
if (!resultsFile.exists()) {
- List<File> resultsDirs = new ArrayList<File>();
- resultsDirs.add(new File(vCastDir + File.separator + RESULTS));
- resultsDirs.add(new File(vCastDir + File.separator + RESULTS + File.separator + IMPORTED_RESULTS));
- for (File resultsDir : resultsDirs) {
- File[] files = resultsDir.listFiles();
- for (File file : files) {
- String inputF = file.toString();
- String outputF = inputF.replaceAll(config.getResultsFileExtRegex(), "");
- if (outputF.toString().equalsIgnoreCase(resultsFile.toString())) {
- process(report, resultPath, file);
- exists = true;
- break;
- }
- }
- if (!exists) {
- report.addEntry("SQL", String.format("Could not find DAT file [%s]", resultPathAbs), WARNING);
- }
+ boolean fileExists = findAndProcessResultFile(resultsFile, resultPath, report);
+
+ if (!fileExists) {
+ report.addEntry("SQL", String.format("Could not find DAT file [%s]", resultPathAbs), WARNING);
}
} else {
process(report, resultPath, resultsFile);
}
}
+ private boolean findAndProcessResultFile(File resultsFile, String resultPath, OperationReport report) {
+ List<File> resultsDirs = new ArrayList<File>();
+ resultsDirs.add(new File(vCastDir + File.separator + RESULTS));
+ resultsDirs.add(new File(vCastDir + File.separator + RESULTS + File.separator + IMPORTED_RESULTS));
+
+ for (File resultsDir : resultsDirs) {
+ File[] files = resultsDir.listFiles();
+ for (File file : files) {
+ String inputF = file.toString();
+ String outputF = inputF.replaceAll(config.getResultsFileExtRegex(), "");
+ if (outputF.toString().equalsIgnoreCase(resultsFile.toString())) {
+ process(report, resultPath, file);
+ return true; // File exists
+ }
+ }
+ }
+ return false; // File does not exist
+ }
+
private void process(OperationReport report, String resultPath, File resultsFile) {
if (!isDuplicateFile(resultsFile, report)) {
//Start reading line by line

Back to the top