summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-12-13 12:18:20 -0500
committerdonald.g.dunne2017-12-13 12:18:20 -0500
commit930e97d022d47821efc8c110a7078454385676c3 (patch)
tree8903824965a9b9e5071935a631c32c4d6e7d46ff
parent1e146ab6e86abc0d8237756a7063eb14b33e815e (diff)
downloadorg.eclipse.osee-930e97d022d47821efc8c110a7078454385676c3.zip
org.eclipse.osee-930e97d022d47821efc8c110a7078454385676c3.tar.gz
org.eclipse.osee-930e97d022d47821efc8c110a7078454385676c3.tar.xz
feature[ats_TW5538]: Add ability to add action id and legacy pcr to action details copy
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java36
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/CopyActionDetails.java11
2 files changed, 47 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
index 11ef37a..752782e 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
@@ -11,13 +11,18 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.util;
import static org.junit.Assert.assertEquals;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.model.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil.AtsTestUtilState;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.CopyActionDetails;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.AfterClass;
@@ -73,4 +78,35 @@ public class CopyActionDetailsTest {
assertEquals("\"PeerToPeer Review\" - " + review.getAtsId() + " - \"AtsTestUtil Test Peer Review\"", str);
review.persist(getClass().getSimpleName());
}
+
+ @Test
+ public void test05GetDetailsStringForTeamWfWithTeamDefConfig() throws OseeCoreException {
+ AtsTestUtil.cleanupAndReset(getClass().getSimpleName());
+
+ IAtsChangeSet changes = AtsClientService.get().createChangeSet(getClass().getSimpleName());
+ TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf();
+ IAtsTeamDefinition teamDef = teamWf.getTeamDefinition();
+ changes.setSoleAttributeValue(teamDef, AtsAttributeTypes.ActionDetailsFormat,
+ "<atsid> - <name> - <artType> - <changeType>");
+ changes.setSoleAttributeValue((IAtsWorkItem) teamWf, AtsAttributeTypes.LegacyPcrId, "PCR100");
+ changes.execute();
+
+ String str = new CopyActionDetails(teamWf).getDetailsString();
+ assertEquals(teamWf.getAtsId() + " - AtsTestUtil - Team WF [CopyActionDetailsTest] - Team Workflow - Improvement",
+ str);
+
+ changes = AtsClientService.get().createChangeSet(getClass().getSimpleName());
+ changes.setSoleAttributeValue(teamDef, AtsAttributeTypes.ActionDetailsFormat,
+ "[<actionatsid>] - [<atsid>]<legacypcrid> - <name>");
+ changes.setSoleAttributeValue((IAtsWorkItem) teamWf, AtsAttributeTypes.LegacyPcrId, "PCR100");
+ changes.execute();
+
+ IAtsAction action = teamWf.getParentAction();
+ str = new CopyActionDetails(teamWf).getDetailsString();
+ assertEquals(
+ "[" + action.getAtsId() + "] - [" + teamWf.getAtsId() + "] - [PCR100] - AtsTestUtil - Team WF [CopyActionDetailsTest]",
+ str);
+
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/CopyActionDetails.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/CopyActionDetails.java
index e84fb31..039efc9 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/CopyActionDetails.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/CopyActionDetails.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.client.util;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
@@ -46,6 +47,16 @@ public class CopyActionDetails {
String formatStr = getFormatStr(teamDef);
if (Strings.isValid(formatStr)) {
detailsStr = formatStr;
+ IAtsAction action = awa.getParentAction();
+ if (action != null) {
+ detailsStr = detailsStr.replaceAll("<actionatsid>", action.getAtsId());
+ }
+ String legacyPcrId = awa.getSoleAttributeValue(AtsAttributeTypes.LegacyPcrId, null);
+ if (Strings.isValid(legacyPcrId)) {
+ detailsStr = detailsStr.replaceAll("<legacypcrid>", " - [" + legacyPcrId + "]");
+ } else {
+ detailsStr = detailsStr.replaceAll("<legacypcrid>", "");
+ }
detailsStr = detailsStr.replaceAll("<atsid>", awa.getAtsId());
detailsStr = detailsStr.replaceAll("<name>", awa.getName());
detailsStr = detailsStr.replaceAll("<artType>", awa.getArtifactTypeName());