Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-05-07 16:21:09 +0000
committerRoberto E. Escobar2013-06-17 23:09:10 +0000
commitab7cf02da6c59aeb79f1c8f30834a7e8cf04ff40 (patch)
treebf47d675d6cf7663dbbdf8c1d2fc1718a05f2a71 /plugins/org.eclipse.osee.ats.client.integration.tests
parent1093b5529dd86e0300876b787c59dac7a931ea0e (diff)
downloadorg.eclipse.osee-ab7cf02da6c59aeb79f1c8f30834a7e8cf04ff40.tar.gz
org.eclipse.osee-ab7cf02da6c59aeb79f1c8f30834a7e8cf04ff40.tar.xz
org.eclipse.osee-ab7cf02da6c59aeb79f1c8f30834a7e8cf04ff40.zip
feature[ats_605B4]: Create Search Work Packages Blam
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/AtsTest_Ats_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java24
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java137
3 files changed, 163 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java
index f69bde44f5..9b7d53e6e6 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.ats.client.integration.tests.ats.artifact.log.AtsTest_Lo
import org.eclipse.osee.ats.client.integration.tests.ats.column.AtsTest_Column_Suite;
import org.eclipse.osee.ats.client.integration.tests.ats.config.AtsTest_Config_Suite;
import org.eclipse.osee.ats.client.integration.tests.ats.editor.AtsTest_Editor_Suite;
+import org.eclipse.osee.ats.client.integration.tests.ats.ev.AtsTest_EV_TestSuite;
import org.eclipse.osee.ats.client.integration.tests.ats.health.AtsTest_Health_Suite;
import org.eclipse.osee.ats.client.integration.tests.ats.navigate.AtsTest_Navigate_Suite;
import org.eclipse.osee.ats.client.integration.tests.ats.render.AtsTest_Renderer_Suite;
@@ -41,6 +42,7 @@ import org.junit.runners.Suite;
AtsTest_Column_Suite.class,
AtsTest_Config_Suite.class,
AtsTest_Editor_Suite.class,
+ AtsTest_EV_TestSuite.class,
AtsTest_Health_Suite.class,
AtsTest_Navigate_Suite.class,
AtsTest_Renderer_Suite.class,
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
new file mode 100644
index 0000000000..7a17c93213
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/AtsTest_EV_TestSuite.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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 org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({SearchWorkPackageOperationTest.class})
+/**
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsTest_EV_TestSuite {
+ // TestSuite
+}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
new file mode 100644
index 0000000000..edfc5611b3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * 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.Arrays;
+import java.util.Collection;
+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.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.client.demo.DemoArtifactToken;
+import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
+import org.eclipse.osee.ats.core.client.ev.SearchWorkPackageOperation;
+import org.eclipse.osee.framework.core.enums.Active;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Test case for {@link SearchWorkPackageOperation}
+ *
+ * @author Donald G. Dunne
+ */
+@RunWith(Parameterized.class)
+public class SearchWorkPackageOperationTest {
+
+ private final String resultSize;
+ private final Collection<String> teamDefGuids;
+ private final boolean includeChildrenTeamDefs;
+ private final Collection<String> aiGuids;
+ private final Active activeOption;
+ private final Collection<String> expectedWpGuids;
+ private final boolean includeChildrenAIs;
+
+ public SearchWorkPackageOperationTest(String resultSize, Collection<String> teamDefGuids, boolean includeChildrenTeamDefs, Collection<String> aiGuids, boolean includeChildrenAIs, Active activeOption, Collection<String> expectedWpGuids) {
+ this.resultSize = resultSize;
+ this.teamDefGuids = teamDefGuids;
+ this.includeChildrenTeamDefs = includeChildrenTeamDefs;
+ this.aiGuids = aiGuids;
+ this.includeChildrenAIs = includeChildrenAIs;
+ this.activeOption = activeOption;
+ this.expectedWpGuids = expectedWpGuids;
+ }
+
+ @Parameters
+ public static Collection<Object[]> data() {
+ List<Object[]> data = new ArrayList<Object[]>();
+ List<String> EMPYT_RESULTS = new ArrayList<String>();
+ String WP_01 = DemoArtifactToken.SAW_Code_Team_WorkPackage_01.getGuid();
+ String WP_02 = DemoArtifactToken.SAW_Code_Team_WorkPackage_02.getGuid();
+ String WP_03 = DemoArtifactToken.SAW_Code_Team_WorkPackage_03.getGuid();
+ String WP_0A = DemoArtifactToken.SAW_Test_AI_WorkPackage_0A.getGuid();
+ String WP_0B = DemoArtifactToken.SAW_Test_AI_WorkPackage_0B.getGuid();
+ String WP_0C = DemoArtifactToken.SAW_Test_AI_WorkPackage_0C.getGuid();
+
+ // Test Work Packages configured by Team Def
+ addTest(data, "no work packages should be returned", Arrays.asList(DemoArtifactToken.SAW_SW.getGuid()), false,
+ new ArrayList<String>(), false, Active.Both, EMPYT_RESULTS);
+ addTest(data, "3 work packages should be returned", Arrays.asList(DemoArtifactToken.SAW_SW.getGuid()), true,
+ new ArrayList<String>(), false, Active.Both, Arrays.asList(WP_01, WP_02, WP_03));
+ addTest(data, "2 active work packages should be returned", Arrays.asList(DemoArtifactToken.SAW_SW.getGuid()),
+ true, new ArrayList<String>(), false, Active.Active, Arrays.asList(WP_01, WP_02));
+ addTest(data, "1 in-active work packages should be returned", Arrays.asList(DemoArtifactToken.SAW_SW.getGuid()),
+ true, new ArrayList<String>(), false, Active.InActive, Arrays.asList(WP_03));
+
+ // Test Work Packages configured by AI
+ addTest(data, "no work packages should be returned", new ArrayList<String>(), false,
+ Arrays.asList(DemoArtifactToken.SAW_SW_AI.getGuid()), false, Active.Both, EMPYT_RESULTS);
+ addTest(data, "3 work packages should be returned", new ArrayList<String>(), false,
+ Arrays.asList(DemoArtifactToken.SAW_SW_AI.getGuid()), true, Active.Both, Arrays.asList(WP_0A, WP_0B, WP_0C));
+ addTest(data, "2 active work packages should be returned", new ArrayList<String>(), false,
+ Arrays.asList(DemoArtifactToken.SAW_SW_AI.getGuid()), true, Active.Active, Arrays.asList(WP_0A, WP_0B));
+ addTest(data, "1 in-active work packages should be returned", new ArrayList<String>(), false,
+ Arrays.asList(DemoArtifactToken.SAW_SW_AI.getGuid()), true, Active.InActive, Arrays.asList(WP_0C));
+
+ // Test configured by both
+ addTest(data, "4 active work packages should be returned", Arrays.asList(DemoArtifactToken.SAW_SW.getGuid()),
+ true, Arrays.asList(DemoArtifactToken.SAW_Test_AI.getGuid()), true, Active.Active,
+ Arrays.asList(WP_01, WP_02, WP_0A, WP_0B));
+
+ return data;
+ }
+
+ @Test
+ public void testSearchResults() throws OseeCoreException {
+ List<IAtsTeamDefinition> teamDefs = new ArrayList<IAtsTeamDefinition>();
+ for (String teamDefGuid : teamDefGuids) {
+ IAtsTeamDefinition teamDef =
+ (IAtsTeamDefinition) AtsClientService.get().getAtsConfig().getSoleByGuid(teamDefGuid);
+ teamDefs.add(teamDef);
+ }
+
+ List<IAtsActionableItem> ais = new ArrayList<IAtsActionableItem>();
+ for (String aiGuid : aiGuids) {
+ IAtsActionableItem ai = (IAtsActionableItem) AtsClientService.get().getAtsConfig().getSoleByGuid(aiGuid);
+ ais.add(ai);
+ }
+
+ SearchWorkPackageOperation operation =
+ new SearchWorkPackageOperation("test", teamDefs, includeChildrenTeamDefs, ais, includeChildrenAIs,
+ activeOption);
+ operation.run(null);
+ Set<Artifact> resultArtifacts = operation.getResultArtifacts();
+ Collection<String> resultArtifactGuids = Artifacts.toGuids(resultArtifacts);
+ Assert.assertEquals(resultSize, expectedWpGuids.size(), resultArtifacts.size());
+ for (String expectedGid : expectedWpGuids) {
+ Assert.assertTrue("Expected guid " + expectedGid + " not found in results",
+ resultArtifactGuids.contains(expectedGid));
+ }
+ }
+
+ private static void addTest(List<Object[]> testData, String toSearch, Collection<String> teamDefGuids, boolean includeChildrenTeamDefs, Collection<String> aiGuids, boolean includeChildrenAIs, Active both, Collection<String> expectedWpGuids) {
+ testData.add(new Object[] {
+ toSearch,
+ teamDefGuids,
+ includeChildrenTeamDefs,
+ aiGuids,
+ includeChildrenAIs,
+ both,
+ expectedWpGuids});
+ }
+
+}

Back to the top