Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2018-04-06 14:30:40 +0000
committermegumi.telles2018-04-06 14:30:40 +0000
commit0100a7ff1ad5362cae6f846aaf2c7a225bf91307 (patch)
treed095795b5a8627a535795e9c5c26659abd80302b
parent58271d7ba9526577e6c8272cad977019d1be372a (diff)
downloadorg.eclipse.osee-0100a7ff1ad5362cae6f846aaf2c7a225bf91307.tar.gz
org.eclipse.osee-0100a7ff1ad5362cae6f846aaf2c7a225bf91307.tar.xz
org.eclipse.osee-0100a7ff1ad5362cae6f846aaf2c7a225bf91307.zip
feature[ats_TW8399]: CI-support missing dispo item0.25.3.v201804061436-REL
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java22
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/ContinuousIntegrationResource.java7
3 files changed, 31 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
index e494bc88543..1312c77ea6c 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/DispoApi.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.disposition.rest;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
+import org.eclipse.osee.disposition.model.CiItemData;
import org.eclipse.osee.disposition.model.CiSetData;
import org.eclipse.osee.disposition.model.CopySetParams;
import org.eclipse.osee.disposition.model.Discrepancy;
@@ -103,4 +104,6 @@ public interface DispoApi {
String getDispoItemId(BranchId branch, String setId, String item);
List<CiSetData> getAllCiSets();
+
+ String createDispoItem(BranchId branch, CiItemData data, String userName);
}
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 c1f54ac8c51..bae6ffda17a 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
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.osee.disposition.model.CiItemData;
import org.eclipse.osee.disposition.model.CiSetData;
import org.eclipse.osee.disposition.model.CopySetParams;
import org.eclipse.osee.disposition.model.Discrepancy;
@@ -777,4 +778,25 @@ public class DispoApiImpl implements DispoApi {
return wasUpdated;
}
+ @Override
+ public String createDispoItem(BranchId branch, CiItemData data, String userName) {
+ DispoItemData dispoItemData = new DispoItemData();
+ dispoItemData.setName(data.getScriptName());
+ dispoItemData.setAssignee(getQuery().findUnassignedUser().getName());
+ dispoItemData.setGuid(dataFactory.getNewId());
+ dispoItemData.setCreationDate(new Date());
+ dispoItemData.setDiscrepanciesAsRanges(data.getTestPoints().getFail());
+ dispoItemData.setDiscrepanciesList(new HashMap<String, Discrepancy>());
+ dispoItemData.setAnnotationsList(data.getAnnotations());
+ List<DispoItem> newItem = new ArrayList<>();
+ newItem.add(dispoItemData);
+
+ ArtifactReadable author = getQuery().findUser();
+ DispoSet parentSet = getQuery().findDispoSetsById(branch, data.getSetData().getDispoSetId());
+ if (parentSet != null) {
+ getWriter().createDispoItems(author, branch, parentSet, newItem);
+ }
+ return dispoItemData.getGuid();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/ContinuousIntegrationResource.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/ContinuousIntegrationResource.java
index 9f643b74a67..852ef7bdbb4 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/ContinuousIntegrationResource.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/resources/ContinuousIntegrationResource.java
@@ -31,6 +31,7 @@ import org.eclipse.osee.disposition.model.DispoItemData;
import org.eclipse.osee.disposition.rest.DispoApi;
import org.eclipse.osee.disposition.rest.util.DispoUtil;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Megumi Telles
@@ -89,7 +90,11 @@ public class ContinuousIntegrationResource {
if (data != null) {
BranchId branch = BranchId.valueOf(data.getSetData().getBranchId());
String itemId = dispoApi.getDispoItemId(branch, data.getSetData().getDispoSetId(), data.getScriptName());
- if (itemId != null && !itemId.isEmpty()) {
+ if (Strings.isInValid(itemId)) {
+ dispoApi.createDispoItem(branch, data, userName);
+ itemId = dispoApi.getDispoItemId(branch, data.getSetData().getDispoSetId(), data.getScriptName());
+ }
+ if (Strings.isValid(itemId)) {
updateDiscrepencies(data, branch, itemId, userName);
dispoApi.deleteAllDispoAnnotation(branch, itemId, userName, true);
response = createAndUpdateAnnotation(data, userName, response, branch, itemId);

Back to the top