Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-07-29 18:57:48 +0000
committerRoberto E. Escobar2013-08-19 22:20:41 +0000
commitca2c211e5e8a5a3db185ff868b02b6f7e909dbb2 (patch)
tree6b98774ed3e3da313fa3b537020fc56dd97ed015 /plugins/org.eclipse.osee.ats.client.integration.tests
parent592bc26a8b16a8f275bdaede87c0785a1a40db0a (diff)
downloadorg.eclipse.osee-ca2c211e5e8a5a3db185ff868b02b6f7e909dbb2.tar.gz
org.eclipse.osee-ca2c211e5e8a5a3db185ff868b02b6f7e909dbb2.tar.xz
org.eclipse.osee-ca2c211e5e8a5a3db185ff868b02b6f7e909dbb2.zip
bug[ats_AHTKQ]: New Stand-alone review does not set Actionable Item attribute
Diffstat (limited to 'plugins/org.eclipse.osee.ats.client.integration.tests')
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java46
1 files changed, 44 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
index 4afb497c38..af72394c28 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
@@ -11,7 +11,8 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.review;
import java.util.Date;
-import org.junit.Assert;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
@@ -20,11 +21,16 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -38,6 +44,16 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
@AfterClass
public static void cleanup() throws Exception {
AtsTestUtil.cleanup();
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
+ PeerToPeerReviewManagerTest.class.getSimpleName());
+ for (Artifact art : ArtifactQuery.getArtifactListFromTypeAndName(AtsArtifactTypes.PeerToPeerReview,
+ "PeerToPeerReviewManagerTest", AtsUtil.getAtsBranchToken(), QueryOptions.CONTAINS_MATCH_OPTIONS)) {
+ if (art.getName().contains("StandAlone")) {
+ art.deleteAndPersist(transaction);
+ }
+ }
+ transaction.execute();
}
@org.junit.Test
@@ -52,7 +68,8 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, reviewTitle,
- AtsTestUtil.getAnalyzeStateDef().getName(), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
+ AtsTestUtil.getAnalyzeStateDef().getName(), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
transaction.execute();
Assert.assertNotNull(peerArt);
@@ -92,4 +109,29 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
peerArt.getSoleAttributeValue(AtsAttributeTypes.RelatedToState));
}
+
+ @org.junit.Test
+ public void testCreateNewPeerToPeerReview__StandAlone() throws OseeCoreException {
+ AtsTestUtil.cleanupAndReset("PeerToPeerReviewManagerTest - StandAlone");
+ IAtsActionableItem testAi = AtsTestUtil.getTestAi();
+
+ // create and transition peer review
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ String reviewTitle = "Test Review - " + testAi;
+
+ PeerToPeerReviewArtifact peerArt =
+ PeerToPeerReviewManager.createNewPeerToPeerReview(testAi, reviewTitle, null, new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
+ transaction.execute();
+
+ Assert.assertNotNull(peerArt);
+ Assert.assertFalse(
+ String.format("PeerToPeer Review artifact should not be dirty [%s]", Artifacts.getDirtyReport(peerArt)),
+ peerArt.isDirty());
+ Assert.assertEquals(PeerToPeerReviewState.Prepare.getName(), peerArt.getCurrentStateName());
+ Assert.assertEquals("Joe Smith", peerArt.getStateMgr().getAssigneesStr());
+ Assert.assertEquals(peerArt.getSoleAttributeValue(AtsAttributeTypes.ActionableItem), testAi.getGuid());
+ }
+
}

Back to the top