Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2012-11-06 19:14:29 +0000
committerRoberto E. Escobar2012-11-06 19:14:29 +0000
commitc533048ede9a95fa79d92fef2ae9f090ef2155b1 (patch)
tree04ff8021247062bb41c47a36e25919b4906b5527 /plugins/org.eclipse.osee.ats.test
parentf04237c591fae74131fb78d8e46b5fe3e029429e (diff)
downloadorg.eclipse.osee-c533048ede9a95fa79d92fef2ae9f090ef2155b1.tar.gz
org.eclipse.osee-c533048ede9a95fa79d92fef2ae9f090ef2155b1.tar.xz
org.eclipse.osee-c533048ede9a95fa79d92fef2ae9f090ef2155b1.zip
bug[ats_6ZC6T]: Open by id with list only opens last id
Diffstat (limited to 'plugins/org.eclipse.osee.ats.test')
-rw-r--r--plugins/org.eclipse.osee.ats.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/AtsTest_Demo_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/AtsTest_Demo_World_Search_Suite.java33
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/LegacyPcrIdQuickSearchTest.java72
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/TeamDefinitionQuickSearchTest.java60
5 files changed, 169 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.ats.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.test/META-INF/MANIFEST.MF
index f674e120ee8..70a33858130 100644
--- a/plugins/org.eclipse.osee.ats.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.test/META-INF/MANIFEST.MF
@@ -23,4 +23,5 @@ Export-Package: org.eclipse.osee.ats,
org.eclipse.osee.ats.navigate,
org.eclipse.osee.ats.render,
org.eclipse.osee.ats.util,
- org.eclipse.osee.ats.workflow
+ org.eclipse.osee.ats.workflow,
+ org.eclipse.osee.ats.world.search
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/AtsTest_Demo_Suite.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/AtsTest_Demo_Suite.java
index fea846ba44e..b9886731704 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/AtsTest_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/AtsTest_Demo_Suite.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.ats.util.AtsXWidgetsExampleBlamTest;
import org.eclipse.osee.ats.util.DemoTestUtil;
import org.eclipse.osee.ats.util.ImportActionsViaSpreadsheetTest;
import org.eclipse.osee.ats.workflow.SMAPromptChangeStatusTest;
+import org.eclipse.osee.ats.world.search.AtsTest_Demo_World_Search_Suite;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
import org.junit.AfterClass;
@@ -41,6 +42,7 @@ import org.junit.runners.Suite;
AtsNavigateItemsToMassEditorTest.class,
AtsNavigateItemsToTaskEditorTest.class,
AtsNavigateItemsToWorldViewTest.class,
+ AtsTest_Demo_World_Search_Suite.class,
AtsBranchConfigurationTest.class,
AtsTest_Demo_Action_Suite.class,
AtsTest_Demo_Access_Suite.class,
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/AtsTest_Demo_World_Search_Suite.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/AtsTest_Demo_World_Search_Suite.java
new file mode 100644
index 00000000000..295b8202fa2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/AtsTest_Demo_World_Search_Suite.java
@@ -0,0 +1,33 @@
+package org.eclipse.osee.ats.world.search;
+
+import static org.junit.Assert.assertTrue;
+import org.eclipse.osee.ats.util.DemoTestUtil;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({LegacyPcrIdQuickSearchTest.class, TeamDefinitionQuickSearchTest.class})
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsTest_Demo_World_Search_Suite {
+ @BeforeClass
+ public static void setUp() throws Exception {
+ OseeProperties.setIsInTest(true);
+ assertTrue("Demo Application Server must be running.",
+ ClientSessionManager.getAuthenticationProtocols().contains("demo"));
+ assertTrue("Client must authenticate using demo protocol",
+ ClientSessionManager.getSession().getAuthenticationProtocol().equals("demo"));
+ System.out.println("\n\nBegin " + AtsTest_Demo_World_Search_Suite.class.getSimpleName());
+ DemoTestUtil.setUpTest();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ System.out.println("End " + AtsTest_Demo_World_Search_Suite.class.getSimpleName());
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/LegacyPcrIdQuickSearchTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/LegacyPcrIdQuickSearchTest.java
new file mode 100644
index 00000000000..5366d072dac
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/LegacyPcrIdQuickSearchTest.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.world.search;
+
+import java.util.Arrays;
+import java.util.Collection;
+import junit.framework.Assert;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.core.client.AtsTestUtil;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.junit.Test;
+
+/**
+ * Test Case for {@link LegacyPcrIdQuickSearch}
+ *
+ * @author Donald G. Dunne
+ */
+public class LegacyPcrIdQuickSearchTest {
+
+ @Test
+ public void testPerformSearch() throws OseeCoreException {
+ AtsTestUtil.cleanupAndReset(getClass().getSimpleName() + ".testPerformSearch");
+ TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf();
+ teamWf.persist(getClass().getSimpleName());
+
+ TeamWorkFlowArtifact teamWf2 = AtsTestUtil.getTeamWf2();
+ teamWf2.persist(getClass().getSimpleName());
+
+ LegacyPcrIdQuickSearch srch = new LegacyPcrIdQuickSearch(Arrays.asList("67676"));
+ Assert.assertTrue("No results should be found", srch.performSearch().isEmpty());
+
+ teamWf.setSoleAttributeValue(AtsAttributeTypes.LegacyPcrId, "67676");
+ teamWf.persist(getClass().getSimpleName());
+
+ srch = new LegacyPcrIdQuickSearch(Arrays.asList("67676"));
+ Assert.assertEquals("Should return teamWf", teamWf, srch.performSearch().iterator().next());
+
+ teamWf2.setSoleAttributeValue(AtsAttributeTypes.LegacyPcrId, "32323");
+ teamWf2.persist(getClass().getSimpleName());
+
+ srch = new LegacyPcrIdQuickSearch(Arrays.asList("67676", "32323"));
+ Collection<Artifact> results = srch.performSearch();
+ Assert.assertTrue(results.contains(teamWf));
+ Assert.assertTrue(results.contains(teamWf2));
+
+ teamWf.setSoleAttributeValue(AtsAttributeTypes.LegacyPcrId, "RPCR_67676");
+ teamWf.persist(getClass().getSimpleName());
+
+ // As single string, neither should be found if exactMatch == true
+ srch = new LegacyPcrIdQuickSearch(Arrays.asList("RPCR 67676"));
+ results = srch.performSearch(true);
+ Assert.assertTrue("No results should be found", results.isEmpty());
+
+ // As single string, both should be found if exactMatch == false
+ srch = new LegacyPcrIdQuickSearch(Arrays.asList("RPCR 67676"));
+ results = srch.performSearch(false);
+ Assert.assertTrue(results.contains(teamWf));
+
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/TeamDefinitionQuickSearchTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/TeamDefinitionQuickSearchTest.java
new file mode 100644
index 00000000000..61d2ae5a238
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/world/search/TeamDefinitionQuickSearchTest.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.world.search;
+
+import java.util.Arrays;
+import java.util.Collection;
+import junit.framework.Assert;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.client.AtsTestUtil;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.junit.Test;
+
+/**
+ * Test Case for {@link TeamDefinitionQuickSearch}
+ *
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionQuickSearchTest {
+
+ @Test
+ public void testPerformSearch() throws OseeCoreException {
+ AtsTestUtil.cleanupAndReset(getClass().getSimpleName() + ".testPerformSearch");
+ TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf();
+ teamWf.persist(getClass().getSimpleName());
+
+ IAtsTeamDefinition randomTeamDef =
+ AtsConfigCache.instance.getTeamDefinitionFactory().createTeamDefinition("tdqst", getClass().getSimpleName());
+
+ TeamDefinitionQuickSearch srch = new TeamDefinitionQuickSearch(Arrays.asList(randomTeamDef));
+ Assert.assertTrue("No results should be found", srch.performSearch().isEmpty());
+
+ IAtsTeamDefinition teamDef = teamWf.getTeamDefinition();
+
+ srch = new TeamDefinitionQuickSearch(Arrays.asList(teamDef));
+ Assert.assertEquals("Should return teamWf", teamWf, srch.performSearch().iterator().next());
+
+ srch = new TeamDefinitionQuickSearch(Arrays.asList(teamDef, randomTeamDef));
+ Assert.assertEquals("Should return teamWf", teamWf, srch.performSearch().iterator().next());
+
+ TeamWorkFlowArtifact teamWf2 = AtsTestUtil.getTeamWf2();
+ teamWf2.persist(getClass().getSimpleName());
+
+ srch = new TeamDefinitionQuickSearch(Arrays.asList(teamDef, randomTeamDef));
+ Collection<Artifact> results = srch.performSearch();
+ Assert.assertTrue(results.contains(teamWf));
+ Assert.assertTrue(results.contains(teamWf2));
+ }
+
+}

Back to the top