summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominic Guss2017-12-07 12:17:08 -0500
committerMegumi Telles2017-12-14 11:28:36 -0500
commit094565dee5d0571598950b07e09dfef46d256c04 (patch)
treef933cf9ff1213bf464ed17bb7d05cea535bdc853
parentdaaf6bea6b1f7820d74ba14f03e5c850e5bcd4c9 (diff)
downloadorg.eclipse.osee-094565dee5d0571598950b07e09dfef46d256c04.zip
org.eclipse.osee-094565dee5d0571598950b07e09dfef46d256c04.tar.gz
org.eclipse.osee-094565dee5d0571598950b07e09dfef46d256c04.tar.xz
feature[ats_TW5124]: Support Dispo/Coverage all resolutions for MCDC
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/DispoApiImpl.java5
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java5
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java35
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/legacy/js/userController.js2
4 files changed, 27 insertions, 20 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index 1502760..42a670b 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -476,10 +476,11 @@ public class DispoApiImpl implements DispoApi {
HashMap<String, DispoItem> nameToItemMap = getItemsMap(branch, setToEdit);
DispoImporterApi importer;
+
if (setToEdit.getDispoType().equalsIgnoreCase("codeCoverage")) {
- importer = importerFactory.createImporter(ImportFormat.LIS);
+ importer = importerFactory.createImporter(ImportFormat.LIS, dispoConnector);
} else {
- importer = importerFactory.createImporter(ImportFormat.TMO);
+ importer = importerFactory.createImporter(ImportFormat.TMO, dispoConnector);
}
List<DispoItem> itemsFromParse =
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
index 53425bb..2b64d41 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoImporterFactory.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.disposition.rest.internal.importer;
import org.eclipse.osee.disposition.rest.DispoApiConfiguration;
import org.eclipse.osee.disposition.rest.DispoImporterApi;
+import org.eclipse.osee.disposition.rest.internal.DispoConnector;
import org.eclipse.osee.disposition.rest.internal.DispoDataFactory;
import org.eclipse.osee.disposition.rest.internal.importer.coverage.LisFileParser;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
@@ -41,14 +42,14 @@ public class DispoImporterFactory {
this.config = config;
}
- public DispoImporterApi createImporter(ImportFormat format) {
+ public DispoImporterApi createImporter(ImportFormat format, DispoConnector connector) {
switch (format) {
case TMO:
return new TmoImporter(dataFactory, executor, logger);
case TMZ:
return new TmzImporter(logger, dataFactory);
case LIS:
- return new LisFileParser(logger, dataFactory, config);
+ return new LisFileParser(logger, dataFactory, config, connector);
default:
throw new OseeArgumentException("Unsupported format type: [%s]", format);
}
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 fa2e7e5..208f3a0 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
@@ -77,14 +77,15 @@ public class LisFileParser implements DispoImporterApi {
private final Set<String> alreadyUsedDatIds = new HashSet<>();
private final Set<String> alreadyUsedFileNames = new HashSet<>();
- private final DispoConnector dispoConnector = new DispoConnector();
+ private final DispoConnector dispoConnector;
private final DispoApiConfiguration config;
private String vCastDir;
- public LisFileParser(Log logger, DispoDataFactory dataFactory, DispoApiConfiguration config) {
+ public LisFileParser(Log logger, DispoDataFactory dataFactory, DispoApiConfiguration config, DispoConnector connector) {
this.dataFactory = dataFactory;
this.config = config;
+ this.dispoConnector = connector;
}
@Override
@@ -161,16 +162,14 @@ public class LisFileParser implements DispoImporterApi {
}
private void createPlaceHolderAnnotations(DispoItemData item, OperationReport report) {
- DispoConnector connetor = new DispoConnector();
- List<String> uncovered = connetor.getAllUncoveredDiscprepancies(item);
+ List<String> uncovered = dispoConnector.getAllUncoveredDiscprepancies(item);
if (!uncovered.isEmpty()) {
Map<String, Discrepancy> discrepanciesList = item.getDiscrepanciesList();
for (String id : discrepanciesList.keySet()) {
Discrepancy discrepancy = discrepanciesList.get(id);
if (uncovered.contains(discrepancy.getLocation())) {
- addBlankAnnotationForForUncoveredLine(item, discrepancy.getLocation(), discrepancy.getText());
+ addBlankAnnotationForUncoveredLine(item, discrepancy.getLocation(), discrepancy.getText());
}
-
}
}
}
@@ -190,7 +189,7 @@ public class LisFileParser implements DispoImporterApi {
text = matchingDiscrepancy.getText();
Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
discrepancies.remove(matchingDiscrepancy.getId());
- addAnnotationForForCoveredLine(item, line, Exception_Handling_Resolution, "", text);
+ addAnnotationForCoveredLine(item, line, Exception_Handling_Resolution, "", text);
}
}
}
@@ -414,7 +413,7 @@ public class LisFileParser implements DispoImporterApi {
} else if (count == 5) {
Matcher m = fileMethod5LineNumberPattern.matcher(resultsLine);
if (m.find()) {
- processSingleResultMCDC(resultPath, m);
+ processMultiResultMCDC(resultPath, m);
}
} else {
// ERROR
@@ -453,7 +452,7 @@ public class LisFileParser implements DispoImporterApi {
Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
discrepancies.remove(matchingDiscrepancy.getId());
item.setDiscrepanciesList(discrepancies);
- addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
+ addAnnotationForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
}
}
@@ -469,12 +468,12 @@ public class LisFileParser implements DispoImporterApi {
Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
discrepancies.remove(matchingDiscrepancy.getId());
item.setDiscrepanciesList(discrepancies);
- addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
+ addAnnotationForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
}
}
}
- private void processSingleResultMCDC(String resultPath, Matcher m) {
+ private void processMultiResultMCDC(String resultPath, Matcher m) {
DispoItemData item = datIdToItem.get(generateDatId(m.group(1), m.group(2)));
if (item != null) {
@@ -487,18 +486,24 @@ public class LisFileParser implements DispoImporterApi {
for (String abbrevCond : bitsTrueMap.keySet()) {
String TorF = bitsTrueMap.get(abbrevCond) ? "T" : "F";
- String location = String.format("%s.%s.%s", lineNumber, abbrevCond, TorF);
+ String location = formatLocation(lineNumber, abbrevCond, TorF);
Discrepancy matchingDiscrepancy = matchDiscrepancy(location, item.getDiscrepanciesList());
if (matchingDiscrepancy != null) {
String text = matchingDiscrepancy.getText();
Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList();
discrepancies.remove(matchingDiscrepancy.getId());
item.setDiscrepanciesList(discrepancies);
- addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
+ addAnnotationForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text);
}
}
}
+ }
+ private String formatLocation(int lineNumber, String abbrevCond, String TorF) {
+ if (abbrevCond.length() != 1 || abbrevCond.charAt(0) < 65 || abbrevCond.charAt(0) > 90) {
+ return String.format("%s.%s.%s", lineNumber, abbrevCond, TorF);
+ }
+ return String.format("%s.%s.%s", lineNumber, abbrevCond.charAt(0) - 64 + " (" + abbrevCond + ")", TorF);
}
private Map<String, Boolean> getBitToBoolean(String bitsTrue, String bitsUsed) {
@@ -540,7 +545,7 @@ public class LisFileParser implements DispoImporterApi {
return toReturn;
}
- private void addBlankAnnotationForForUncoveredLine(DispoItemData item, String location, String text) {
+ private void addBlankAnnotationForUncoveredLine(DispoItemData item, String location, String text) {
DispoAnnotationData newAnnotation = new DispoAnnotationData();
dataFactory.initAnnotation(newAnnotation);
String idOfNewAnnotation = dataFactory.getNewId();
@@ -560,7 +565,7 @@ public class LisFileParser implements DispoImporterApi {
annotationsList.add(newIndex, newAnnotation);
}
- private void addAnnotationForForCoveredLine(DispoItemData item, String location, String resolutionType, String coveringFile, String text) {
+ private void addAnnotationForCoveredLine(DispoItemData item, String location, String resolutionType, String coveringFile, String text) {
DispoAnnotationData newAnnotation = new DispoAnnotationData();
dataFactory.initAnnotation(newAnnotation);
String idOfNewAnnotation = dataFactory.getNewId();
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/legacy/js/userController.js b/plugins/org.eclipse.osee.disposition.rest/web/legacy/js/userController.js
index 5e4932c..5af91c4 100644
--- a/plugins/org.eclipse.osee.disposition.rest/web/legacy/js/userController.js
+++ b/plugins/org.eclipse.osee.disposition.rest/web/legacy/js/userController.js
@@ -744,7 +744,7 @@ app.directive('focusMe', function($timeout) {
scope: { trigger: '=focusMe' },
link: function(scope, element) {
scope.$watch('trigger', function(value) {
- if(value === true) {
+ if(value === true) {
element[0].focus();
}
});