Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2008-10-14 19:59:40 +0000
committerddunne2008-10-14 19:59:40 +0000
commita005ac5c1a4e0078ccdccaf85801a85ee236f105 (patch)
tree5af56371d2d51e28af0f32ad32c3b0782c25b1ab
parent603e40cb5b09684a8af0e2dfb3ab98f6fd1340b3 (diff)
downloadorg.eclipse.osee-a005ac5c1a4e0078ccdccaf85801a85ee236f105.tar.gz
org.eclipse.osee-a005ac5c1a4e0078ccdccaf85801a85ee236f105.tar.xz
org.eclipse.osee-a005ac5c1a4e0078ccdccaf85801a85ee236f105.zip
"Team Workflow" - 99YZE - "Convert ValidateChangeReports to be historical regression test"
-rw-r--r--org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
index 132f64cf60c..7359ccdf1af 100644
--- a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
+++ b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
@@ -171,19 +171,26 @@ public class ValidateChangeReports extends XNavigateItemAction {
List<Artifact> arts =
ArtifactQuery.getArtifactsFromTypeAndName(GeneralData.ARTIFACT_TYPE, name, AtsPlugin.getAtsBranch());
String storedChangeReport = null;
+ Artifact artifactForStore = null;
if (arts.size() > 1) {
throw new OseeStateException("Multiple artifacts found of name \"" + name + "\"");
} else if (arts.size() == 1) {
+ artifactForStore = arts.iterator().next();
storedChangeReport =
- arts.iterator().next().getSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, null);
+ artifactForStore.getSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, null);
}
// Retrieve current
ChangeData currentChangeData = teamArt.getSmaMgr().getBranchMgr().getChangeData();
// Store
if (storedChangeReport == null) {
- Artifact artifact = ArtifactTypeManager.addArtifact(GeneralData.ARTIFACT_TYPE, AtsPlugin.getAtsBranch(), name);
- artifact.setSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, getReport(currentChangeData));
- artifact.persistAttributes();
+ // Reuse same artifact if already exists
+ if (artifactForStore == null) {
+ artifactForStore =
+ ArtifactTypeManager.addArtifact(GeneralData.ARTIFACT_TYPE, AtsPlugin.getAtsBranch(), name);
+ }
+ artifactForStore.setSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME,
+ getReport(currentChangeData));
+ artifactForStore.persistAttributes();
resultData.log("Stored Change Report for " + teamArt.getHumanReadableId());
return new Result(true, "Stored Change Report for " + teamArt.getHumanReadableId());
}

Back to the top