Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-05-09 14:53:34 +0000
committerRoberto E. Escobar2013-06-17 23:09:11 +0000
commit80e157f3a322a6bfecb8696eab66a6c572c3ffdb (patch)
tree1e089f5ee405925b9c6e80cf5911619010a793ad /plugins/org.eclipse.osee.ats.client.integration.tests
parentab7cf02da6c59aeb79f1c8f30834a7e8cf04ff40 (diff)
downloadorg.eclipse.osee-80e157f3a322a6bfecb8696eab66a6c572c3ffdb.tar.gz
org.eclipse.osee-80e157f3a322a6bfecb8696eab66a6c572c3ffdb.tar.xz
org.eclipse.osee-80e157f3a322a6bfecb8696eab66a6c572c3ffdb.zip
feature[ats_605B4]: Create Work Package EV Report
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/ev/AtsTest_EV_TestSuite.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java96
2 files changed, 97 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java
index 7a17c93213..b357e14785 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java
@@ -14,7 +14,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({SearchWorkPackageOperationTest.class})
+@Suite.SuiteClasses({SearchWorkPackageOperationTest.class, EarnedValueReportOperationTest.class})
/**
*
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java
new file mode 100644
index 0000000000..700cf34a56
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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.ats.client.integration.tests.ats.ev;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import junit.framework.Assert;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.ev.IAtsWorkPackage;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.client.demo.DemoArtifactToken;
+import org.eclipse.osee.ats.client.demo.DemoUtil;
+import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
+import org.eclipse.osee.ats.core.client.ev.EarnedValueReportOperation;
+import org.eclipse.osee.ats.core.client.ev.EarnedValueReportResult;
+import org.eclipse.osee.ats.core.client.ev.SearchWorkPackageOperation;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.framework.core.enums.Active;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+import org.junit.Test;
+
+/**
+ * Test case for {@link EarnedValueReportOperation}
+ *
+ * @author Donald G. Dunne
+ */
+public class EarnedValueReportOperationTest {
+
+ @Test
+ public void test() throws OseeCoreException {
+ List<IAtsTeamDefinition> teamDefs = new ArrayList<IAtsTeamDefinition>();
+ IAtsTeamDefinition teamDef =
+ (IAtsTeamDefinition) AtsClientService.get().getAtsConfig().getSoleByGuid(DemoArtifactToken.SAW_SW.getGuid());
+ teamDefs.add(teamDef);
+ SearchWorkPackageOperation srch =
+ new SearchWorkPackageOperation("srch", teamDefs, true, new ArrayList<IAtsActionableItem>(), false, Active.Both);
+ srch.run(null);
+ Set<IAtsWorkPackage> workPackages = srch.getResults();
+ Assert.assertEquals(3, workPackages.size());
+
+ // Confirm that report is empty for Work Packages
+ EarnedValueReportOperation operation = new EarnedValueReportOperation("report", workPackages);
+ operation.run(null);
+ Assert.assertEquals(0, operation.getResults().size());
+
+ // Setup TeamWfs to have selected Work Pacakges
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
+ TeamWorkFlowArtifact commWf = DemoUtil.getSawCodeCommittedWf();
+ commWf.setSoleAttributeValue(AtsAttributeTypes.WorkPackageGuid,
+ DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getGuid());
+ commWf.persist(transaction);
+
+ TeamWorkFlowArtifact unCommWf = DemoUtil.getSawCodeUnCommittedWf();
+ unCommWf.setSoleAttributeValue(AtsAttributeTypes.WorkPackageGuid,
+ DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getGuid());
+ unCommWf.persist(transaction);
+
+ TeamWorkFlowArtifact noBranchWf = DemoUtil.getSawCodeNoBranchWf();
+ noBranchWf.setSoleAttributeValue(AtsAttributeTypes.WorkPackageGuid,
+ DemoArtifactToken.SAW_Code_Team_WorkPackage_03.getGuid());
+ noBranchWf.persist(transaction);
+ transaction.execute();
+
+ // Run report and validate results
+ operation = new EarnedValueReportOperation("report2", workPackages);
+ operation.run(null);
+ Assert.assertEquals(3, operation.getResults().size());
+ int num01 = 0, num03 = 0;
+ for (EarnedValueReportResult result : operation.getResults()) {
+ String id = result.getValue(EarnedValueReportOperation.Work_Package_Id);
+ if (id.endsWith("01")) {
+ num01++;
+ } else if (id.endsWith("03")) {
+ num03++;
+ } else {
+ Assert.fail(String.format("Unexpected result [%s]", id));
+ }
+ }
+ Assert.assertEquals("Should be 2 items with WP_01, was %d", 2, num01);
+ Assert.assertEquals("Should be 1 items with WP_03, was %d", 1, num03);
+ }
+}

Back to the top