Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2017-11-08 14:54:39 +0000
committermegumi.telles2017-11-28 17:12:58 +0000
commitdf46aead154115407876927592697d9fc143e2c6 (patch)
treee71af70939cea697b95d6992574fb5f9d1e56c84
parent8e082af162e65f086b4b0cea25e7d62f922a7abe (diff)
downloadorg.eclipse.osee-df46aead154115407876927592697d9fc143e2c6.tar.gz
org.eclipse.osee-df46aead154115407876927592697d9fc143e2c6.tar.xz
org.eclipse.osee-df46aead154115407876927592697d9fc143e2c6.zip
feature[ats_TW3987]: Provide coverage rerun list
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java9
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java10
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/AnnotationCopierTest.java4
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoSetCopierTest.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java1
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java19
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java5
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java28
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/coverage/LisFileParser.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/FindReruns.java49
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee10
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java37
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js68
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js1
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html24
17 files changed, 259 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
index 4ab251ed85..5a6c69d6d2 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
@@ -31,4 +31,6 @@ public interface DispoSet extends Identifiable<String> {
OperationReport getOperationSummary();
String getCiSet();
+
+ String getRerunList();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
index 0381a58fa8..ff565f2b65 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
@@ -27,6 +27,7 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
private String importState;
private OperationReport operationSummary;
private String ciSet;
+ private String rerunList;
public DispoSetData() {
@@ -85,4 +86,12 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
return ciSet;
}
+ public String getRerunList() {
+ return rerunList;
+ }
+
+ public void setRerunList(String rerunList) {
+ this.rerunList = rerunList;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
index 67c224936f..66cfa748de 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoStrings.java
@@ -54,4 +54,14 @@ public class DispoStrings {
public static final String Test_Unit_Resolution = "Test_Script";
public static final String Exception_Handling_Resolution = "Exception_Handling";
+ public static final String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ public static final String BATCH_RERUN_LIST =
+ XML_HEADER + "<TestManagerConfig>\n" + "\t<ScriptPageConfig>\n" + "\t\t<ServicesSettings/>\n";
+ public static final String BATCH_RERUN_LIST_END = "\t</ScriptPageConfig>\n" + "</TestManagerConfig>";
+ public static final String SCRIPT_ENTRY = "\t\t<ScriptEntry>\n";
+ public static final String SCRIPT_ENTRY_END = "\t\t</ScriptEntry>\n";
+ public static final String IS_RUNNABLE = "\t\t\t<IsRunnable>true</IsRunnable>\n";
+ public static final String SCRIPT_NAME = "\t\t\t<Name>%s</Name>\n";
+ public static final String SCRIPT_PATH = "\t\t\t<Path>%s</Path>\n";
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/AnnotationCopierTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/AnnotationCopierTest.java
index 69733710ec..f05982c35e 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/AnnotationCopierTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/AnnotationCopierTest.java
@@ -162,7 +162,7 @@ public class AnnotationCopierTest {
Map<String, Set<DispoItemData>> nameToItems = new HashMap<>();
nameToItems.put(destItem.getName(), Collections.singleton(destItem));
List<DispoItem> toModify =
- copier.copyAllDispositions(nameToItems, Collections.singletonList((DispoItem) sourceItem), true, report);
+ copier.copyAllDispositions(nameToItems, Collections.singletonList((DispoItem) sourceItem), true, null, report);
DispoItem modifiedItem = toModify.get(0);
List<DispoAnnotationData> modifiedItemAnnotations = modifiedItem.getAnnotationsList();
@@ -215,7 +215,7 @@ public class AnnotationCopierTest {
Map<String, Set<DispoItemData>> nameToItems = new HashMap<>();
nameToItems.put(destItem.getName(), Collections.singleton(destItem));
List<DispoItem> toModify =
- copier.copyAllDispositions(nameToItems, Collections.singletonList((DispoItem) sourceItem), true, report);
+ copier.copyAllDispositions(nameToItems, Collections.singletonList((DispoItem) sourceItem), true, null, report);
DispoItem modifiedItem = toModify.get(0);
List<DispoAnnotationData> modifiedItemAnnotations = modifiedItem.getAnnotationsList();
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoSetCopierTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoSetCopierTest.java
index db7a645d63..38592577c3 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoSetCopierTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoSetCopierTest.java
@@ -162,7 +162,7 @@ public class DispoSetCopierTest {
DispoSetCopier copier = new DispoSetCopier(dispoConnector);
List<DispoItem> copyResults =
copier.copyAllDispositions(getNameToDestItemsMap(Collections.singletonList(destItem)),
- Collections.singletonList(sourceItem), false, report);
+ Collections.singletonList(sourceItem), false, null, report);
DispoItem resultItem = copyResults.get(0);
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
index ec0ae5bce8..4c47c390cf 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoConstants.java
@@ -50,6 +50,7 @@ public final class DispoConstants {
public static final AttributeTypeToken DispoItemFileNumber = AttributeTypeToken.valueOf(3458764513820541715L, "dispo.File Number");
public static final AttributeTypeToken DispoItemMethodNumber = AttributeTypeToken.valueOf(3458764513820541460L, "dispo.Method Number");
public static final AttributeTypeToken DispoCiSet = AttributeTypeToken.valueOf(5225296359986133054L, "dispo.Ci Set");
+ public static final AttributeTypeToken DispoRerunList = AttributeTypeToken.valueOf(3587660131087940587L, "dispo.Rerun List");
public static final ArtifactToken DISPO_ARTIFACT = ArtifactToken.valueOf(4757831, "DispositionTypes", COMMON, CoreArtifactTypes.OseeTypeDefinition);
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 e4343f2439..3b243bfc5a 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
@@ -19,6 +19,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osee.disposition.model.CopySetParams;
import org.eclipse.osee.disposition.model.Discrepancy;
@@ -610,12 +611,13 @@ public class DispoApiImpl implements DispoApi {
namesToDestItems.put(name, itemsWithSameName);
}
}
+ HashMap<String, String> reruns = new HashMap<>();
Map<String, DispoItem> namesToToEditItems = new HashMap<>();
OperationReport report = new OperationReport();
DispoSetCopier copier = new DispoSetCopier(dispoConnector);
if (!params.getAnnotationParam().isNone()) {
- List<DispoItem> copyResults = copier.copyAllDispositions(namesToDestItems, sourceItems, true, report);
+ List<DispoItem> copyResults = copier.copyAllDispositions(namesToDestItems, sourceItems, true, reruns, report);
for (DispoItem item : copyResults) {
namesToToEditItems.put(item.getName(), item);
}
@@ -630,7 +632,22 @@ public class DispoApiImpl implements DispoApi {
editDispoItems(branch, destSetId, namesToToEditItems.values(), false, operation);
storageProvider.get().updateOperationSummary(getQuery().findUser(), branch, destSetId, report);
}
+ storeRerunData(branch, destSetId, reruns);
+ }
+ private void storeRerunData(BranchId branch, String destSetId, HashMap<String, String> reruns) {
+ StringBuilder sb = new StringBuilder();
+ for (Entry<String, String> entry : reruns.entrySet()) {
+ sb = sb.append(DispoStrings.SCRIPT_ENTRY);
+ sb = sb.append(String.format(DispoStrings.SCRIPT_NAME, entry.getKey()));
+ sb = sb.append(String.format(DispoStrings.SCRIPT_PATH, entry.getValue()));
+ sb = sb.append(DispoStrings.IS_RUNNABLE);
+ sb = sb.append(DispoStrings.SCRIPT_ENTRY_END);
+ }
+ DispoSetData dispoSetData = new DispoSetData();
+ dispoSetData.setRerunList(DispoStrings.BATCH_RERUN_LIST + sb.toString() + DispoStrings.BATCH_RERUN_LIST_END);
+ ArtifactReadable author = getQuery().findUser();
+ storageProvider.get().updateDispoSet(author, branch, destSetId, dispoSetData);
}
@Override
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
index c3db4bfa3e..4a94a54edb 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
@@ -92,4 +92,9 @@ public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet {
return artifact.getSoleAttributeAsString(DispoConstants.DispoCiSet, "");
}
+ @Override
+ public String getRerunList() {
+ return artifact.getSoleAttributeAsString(DispoConstants.DispoRerunList, "");
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index f877163514..1828cc41e1 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -237,6 +237,7 @@ public class OrcsStorageImpl implements Storage {
JSONArray notesJarray = DispoUtil.noteListToJsonObj(descriptor.getNotesList());
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoNotesJson, notesJarray.toString());
tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoCiSet, descriptor.getCiSet());
+ tx.setSoleAttributeFromString(creatdArtId, DispoConstants.DispoRerunList, descriptor.getRerunList());
tx.commit();
return creatdArtId.getUuid();
}
@@ -272,6 +273,7 @@ public class OrcsStorageImpl implements Storage {
String name = newData.getName();
String importPath = newData.getImportPath();
String ciSet = newData.getCiSet();
+ String rerunList = newData.getRerunList();
JSONArray notesList = null;
if (newData.getNotesList() != null) {
@@ -291,6 +293,9 @@ public class OrcsStorageImpl implements Storage {
if (ciSet != null && !ciSet.equals(origSetAs.getCiSet())) {
tx.setSoleAttributeFromString(dispoSet, DispoConstants.DispoCiSet, ciSet);
}
+ if (rerunList != null && !rerunList.equals(origSetAs.getRerunList())) {
+ tx.setSoleAttributeFromString(dispoSet, DispoConstants.DispoRerunList, rerunList);
+ }
tx.commit();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java
index 3dbfe39315..b551d888fb 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/importer/DispoSetCopier.java
@@ -19,6 +19,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osee.disposition.model.CopySetParamOption;
import org.eclipse.osee.disposition.model.Discrepancy;
@@ -28,6 +29,7 @@ import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.model.DispoStrings;
import org.eclipse.osee.disposition.model.OperationReport;
import org.eclipse.osee.disposition.rest.internal.DispoConnector;
+import org.eclipse.osee.disposition.rest.internal.report.FindReruns;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -38,11 +40,14 @@ public class DispoSetCopier {
private final DispoConnector connector;
+ private final List<DispoAnnotationData> needsRerun = new ArrayList<>();
+ String batchRunList = "";
+
public DispoSetCopier(DispoConnector connector) {
this.connector = connector;
}
- public List<DispoItem> copyAllDispositions(Map<String, Set<DispoItemData>> nameToDestItems, Collection<DispoItem> sourceItems, boolean isCoverageCopy, OperationReport report) {
+ public List<DispoItem> copyAllDispositions(Map<String, Set<DispoItemData>> nameToDestItems, Collection<DispoItem> sourceItems, boolean isCoverageCopy, HashMap<String, String> reruns, OperationReport report) {
List<DispoItem> modifiedItems = new ArrayList<>();
// Iterate through every source item since we want to try to find a match for every item in the source
@@ -52,7 +57,8 @@ public class DispoSetCopier {
if (destItem != null) {
// Only try to copy over annotations if matching dest item is NOT PASS
if (!destItem.getStatus().equals(DispoStrings.Item_Pass)) {
- DispoItemData newItem = createNewItemWithCopiedAnnotations(destItem, sourceItem, isCoverageCopy, report);
+ DispoItemData newItem =
+ createNewItemWithCopiedAnnotations(destItem, sourceItem, isCoverageCopy, reruns, report);
if (newItem != null) {
modifiedItems.add(newItem);
@@ -100,7 +106,7 @@ public class DispoSetCopier {
return destItem;
}
- private DispoItemData createNewItemWithCopiedAnnotations(DispoItemData destItem, DispoItem sourceItem, boolean isCoverageCopy, OperationReport report) {
+ private DispoItemData createNewItemWithCopiedAnnotations(DispoItemData destItem, DispoItem sourceItem, boolean isCoverageCopy, HashMap<String, String> reruns, OperationReport report) {
DispoItemData toReturn = null;
boolean isSameDiscrepancies = matchAllDiscrepancies(destItem, sourceItem);
if (!isSameDiscrepancies) {
@@ -109,11 +115,11 @@ public class DispoSetCopier {
WARNING);
}
- toReturn = buildNewItem(destItem, sourceItem, isCoverageCopy, report, isSameDiscrepancies);
+ toReturn = buildNewItem(destItem, sourceItem, isCoverageCopy, reruns, report, isSameDiscrepancies);
return toReturn;
}
- private DispoItemData buildNewItem(DispoItemData destItem, DispoItem sourceItem, boolean isCoverageCopy, OperationReport report, boolean isSameDiscrepancies) {
+ private DispoItemData buildNewItem(DispoItemData destItem, DispoItem sourceItem, boolean isCoverageCopy, HashMap<String, String> reruns, OperationReport report, boolean isSameDiscrepancies) {
boolean isChangesMade = false;
DispoItemData newItem = initNewItem(destItem, sourceItem);
List<DispoAnnotationData> newAnnotations = newItem.getAnnotationsList();
@@ -133,6 +139,10 @@ public class DispoSetCopier {
* user should be aware.Currently only for Coverage
*/
if (!destDefaultAnntationLocations.contains(sourceLocation)) {
+ if (!nonDefaultAnnotationLocations.containsKey(sourceLocation)) {
+ newItem.setNeedsRerun(true);
+ needsRerun.add(sourceAnnotation);
+ }
report.addEntry(destItem.getName(),
String.format("Did not copy annotations for location(s) [%s] because they are default annotations",
sourceAnnotation.getLocationRefs()),
@@ -205,6 +215,14 @@ public class DispoSetCopier {
// 2. None of the non-default Annotations cover a Discrepancy in the new import, in which case don't copy them over: MIGHT CHANGE THIS
newItem = destItem;
newItem.setGuid(sourceItem.getGuid());
+ } else if (newItem.getNeedsRerun() != null && newItem.getNeedsRerun()) {
+ report.addEntry(destItem.getName(), "Needs Rerun", UPDATE);
+ if (reruns != null) {
+ HashMap<String, String> tmpList = new FindReruns().createList(needsRerun);
+ for (Entry<String, String> entry : tmpList.entrySet()) {
+ reruns.put(entry.getKey(), entry.getValue());
+ }
+ }
} else {
report.addEntry(destItem.getName(), "Nothing to copy", IGNORE);
newItem = null;
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 29866b05e9..fa2e7e5393 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
@@ -146,7 +146,7 @@ public class LisFileParser implements DispoImporterApi {
}
}
- toReturn = copier.copyAllDispositions(namesToDestItems, exisitingItems.values(), false, report);
+ toReturn = copier.copyAllDispositions(namesToDestItems, exisitingItems.values(), false, null, report);
} else {
toReturn = new ArrayList<>();
toReturn.addAll(values);
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/FindReruns.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/FindReruns.java
new file mode 100644
index 0000000000..f54a64cc82
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/report/FindReruns.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.disposition.rest.internal.report;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.disposition.model.DispoAnnotationData;
+
+/**
+ * @author Megumi Telles
+ */
+public class FindReruns {
+ Pattern removeLastDot = Pattern.compile("[^\\.]([^.]*)$", Pattern.CASE_INSENSITIVE);
+
+ public HashMap<String, String> createList(List<DispoAnnotationData> annotations) {
+ HashMap<String, String> reruns = new HashMap<>();
+ for (DispoAnnotationData data : annotations) {
+ String name = "", path = "", comment = "";
+ String resolution = data.getResolution();
+ if (!resolution.isEmpty()) {
+ String[] split = resolution.split("___");
+ if (split.length > 1) {
+ path = split[0];
+ comment = split[1];
+ } else {
+ path = split.toString();
+ }
+ path = path.replaceFirst("results", "");
+ Matcher matcher = removeLastDot.matcher(path);
+ while (matcher.find()) {
+ name = matcher.group() + ".java";
+ }
+ path = path.replaceAll("\\.", "/");
+ }
+ reruns.put(name, path);
+ }
+ return reruns;
+ }
+}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
index 3f528dcbe6..72cf60cad4 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/types/OseeTypes_Dispo.osee
@@ -12,6 +12,7 @@ artifactType "Disposition Set" extends "Artifact" {
attribute "dispo.Dispo Config"
attribute "dispo.Operation Summary"
attribute "dispo.CI Set"
+ attribute "dispo.Rerun List"
}
artifactType "dispo.Dispositionable Item" extends "Artifact" {
@@ -297,4 +298,13 @@ attributeType "dispo.CI Set" extends StringAttribute {
max 1
defaultValue ""
mediaType "text/plain"
+}
+
+attributeType "dispo.Rerun List" extends StringAttribute {
+ id 3587660131087940587
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ defaultValue ""
+ mediaType "text/plain"
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
index eb2fc601e9..6801d837f6 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/DispoAdminResource.java
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.resources;
+import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.security.RolesAllowed;
@@ -35,6 +38,7 @@ import org.eclipse.osee.disposition.rest.DispoRoles;
import org.eclipse.osee.disposition.rest.internal.report.ExportSet;
import org.eclipse.osee.disposition.rest.internal.report.STRSReport;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
* @author Angel Avila
@@ -122,9 +126,8 @@ public class DispoAdminResource {
@RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR)
@Produces(MediaType.APPLICATION_JSON)
public Response getDispoSetCopy(@QueryParam("destinationSet") String destinationSet, @QueryParam("sourceProgram") BranchId sourceBranch, @QueryParam("sourceSet") String sourceSet, CopySetParams params) {
- Response.Status status;
dispoApi.copyDispoSet(branch, destinationSet, sourceBranch, sourceSet, params);
- status = Status.OK;
+ Response.Status status = Status.OK;
return Response.status(status).build();
}
@@ -140,4 +143,34 @@ public class DispoAdminResource {
return Response.status(status).build();
}
+ @Path("/rerun")
+ @GET
+ @RolesAllowed(DispoRoles.ROLES_ADMINISTRATOR)
+ @Produces(MediaType.APPLICATION_XML)
+ public Response getRerunReport(@QueryParam("primarySet") String primarySet) {
+ DispoSet set = dispoApi.getDispoSetById(branch, primarySet);
+ String rerunList = set.getRerunList();
+
+ StreamingOutput streamingOutput = new StreamingOutput() {
+
+ @Override
+ public void write(OutputStream outputStream) throws IOException, WebApplicationException {
+ Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
+ BufferedWriter out = new BufferedWriter(writer);
+ try {
+ out.write(rerunList);
+ } finally {
+ Lib.close(out);
+ }
+ outputStream.flush();
+ }
+
+ };
+
+ String contentDisposition =
+ String.format("attachment; filename=\"%s.xml\"; creation-date=\"%s\"", "batch-list", new Date());
+ return Response.ok(streamingOutput).header("Content-Disposition", contentDisposition).type(
+ "application/xml").build();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
index 375fad1ea3..226a337434 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
@@ -8,8 +8,9 @@ app.controller('adminController', [
'CopySet',
'CopySetCoverage',
'MultiItemEdit',
+ 'Config',
'uiGridConstants',
- function($scope, $rootScope, $modal, Program, Set, Report, CopySet, CopySetCoverage, MultiItemEdit, uiGridConstants) {
+ function($scope, $rootScope, $modal, Program, Set, Report, CopySet, CopySetCoverage, MultiItemEdit, Config, uiGridConstants) {
$scope.readOnly = true;
$scope.programSelection = null;
$scope.modalShown = false;
@@ -21,13 +22,14 @@ app.controller('adminController', [
$scope.selectedItems = [];
$scope.isRunningOperation = false;
$scope.cachedValue = "";
-
+ $scope.types = [];
+ $scope.isCoverage = $rootScope.type == 'codeCoverage';
$scope.programs = Program.query();
var isPrimary = function(importState) {
return row.entity.importState != "Warnings" && row.entity.importState != "Failed";
}
-
+
$scope.createNewProgram = function() {
if ($scope.newProgramName != "") {
var loadingModal = $scope.showLoadingModal();
@@ -218,6 +220,12 @@ app.controller('adminController', [
loadingModal.close();
alert(data.statusText);
});
+ Config.get({
+ programId: $scope.programSelection,
+ type: $rootScope.type
+ }, function(data) {
+ $scope.types = data.validResolutions;
+ });
};
$scope.editSet = function editSet(set) {
@@ -354,6 +362,21 @@ app.controller('adminController', [
};
+ $scope.rerunReportStatus = function rerunReportStatus (input) {
+ var newSet = $scope.getSetById(input.rerunDispositionSet);
+ var request = [];
+ request.push(
+ "/dispo/program/",
+ $scope.programSelection,
+ "/admin/rerun?primarySet=",
+ newSet.guid
+ );
+ var url = request.join("");
+ window.open(url);
+ };
+
+
+
// -------------------- Summary Grids ----------------------\\
var filterBarPlugin = {
init: function(scope, grid) {
@@ -742,5 +765,44 @@ app.controller('adminController', [
$modalInstance.dismiss('cancel');
};
}
+
+
+ // Report Reruns
+ $scope.openRerunReportStatusModal = function() {
+ var modalInstance = $modal.open({
+ templateUrl: 'rerunReportStatus.html',
+ controller: RerunReportStatusCtrl,
+ size: 'sm',
+ windowClass: 'rerunReportStatusModal',
+ resolve: {
+ sets: function() {
+ return $scope.sets;
+ },
+ types: function() {
+ return $scope.types;
+ }
+ }
+ });
+
+ modalInstance.result.then(function(inputs) {
+ $scope.rerunReportStatus(inputs);
+ });
+ }
+
+ var RerunReportStatusCtrl = function($scope, $modalInstance, sets, types) {
+ $scope.rerunDispositionSet = "";
+ $scope.setsLocal = angular.copy(sets);
+ $scope.typesLocal = angular.copy(types);
+ $scope.ok = function() {
+ var inputs = {};
+ inputs.rerunDispositionSet = this.dispositionSet;
+ inputs.rerunResolutionTypes = this.resolutionTypes;
+ $modalInstance.close(inputs);
+ };
+
+ $scope.cancel = function() {
+ $modalInstance.dismiss('cancel');
+ };
+ }
}
]); \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
index 5dd107798c..f689c66cf7 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js
@@ -279,4 +279,3 @@ app.provider('Annotation', function() {
];
});
-
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
index 0d10da4dde..8f3de586ca 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html
@@ -51,7 +51,8 @@
<button ng-disabled="isRunningOperation" ng-click="openCopySetModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Merge Annotations</button>
<button ng-disabled="isRunningOperation" ng-click="openMassAssignTeamModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Mass Assign Team</button>
<button ng-disabled="isRunningOperation" ng-click="openConfigureCiSetModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Configure CI Set</button>
- <button ng-disabled="isRunningOperation" ng-click="openMassSendDispoItemStatusModal()" ng-show="sets.length > 0" class="btn btn-primary" id=generateReportBtn>Mass Send Dispo Item Status</button>
+ <button ng-disabled="isRunningOperation" ng-click="openMassSendDispoItemStatusModal()" ng-show="!isCoverage && sets.length > 0" class="btn btn-primary" id=generateReportBtn>Mass Send Dispo Item Status</button>
+ <button ng-disabled="isRunningOperation" ng-click="openRerunReportStatusModal()" ng-show="isCoverage && sets.length > 0" class="btn btn-primary" id=generateReportBtn>Get Rerun Report</button>
</div>
</div>
</div>
@@ -242,6 +243,27 @@
</script>
+ <script type="text/ng-template" id="rerunReportStatus.html">
+ <div class="modal-header">
+ <h3 class="modal-title">Get Rerun Report</h3>
+ </div>
+ <div class="modal-body" overflow: auto;">
+ <div class="form-group">
+ Retrieves the rerun list from last known merge.
+ </div>
+ <div class="form-group">
+ Select Disposition Set
+ <select class="form-control" ng-model="dispositionSet" ng-options="obj.guid as obj.name for obj in setsLocal">
+ </select>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-primary" ng-click="ok()">OK</button>
+ <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
+ </div>
+
+ </script>
+
</body>
</html>

Back to the top