diff options
author | jmisinco | 2013-01-18 19:31:46 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2013-01-18 19:37:25 +0000 |
commit | 1be9de09381c28eebb3df604ae645f3210d9474c (patch) | |
tree | 7adb1584383fcb58a4fe6e45334056788b060227 /plugins/org.eclipse.osee.client.integration.tests | |
parent | 020d9bb530a0f53cc18e2be4520c8bed49fb3dcc (diff) | |
download | org.eclipse.osee-1be9de09381c28eebb3df604ae645f3210d9474c.tar.gz org.eclipse.osee-1be9de09381c28eebb3df604ae645f3210d9474c.tar.xz org.eclipse.osee-1be9de09381c28eebb3df604ae645f3210d9474c.zip |
feature[ats_L63H6]: Implement client rest search api
Change-Id: I347fdba26114f77d342df599a588fd7a2bebbe7f
Diffstat (limited to 'plugins/org.eclipse.osee.client.integration.tests')
4 files changed, 26 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF index a2aa664dc78..dc8a01ff749 100644 --- a/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.client.integration.tests/META-INF/MANIFEST.MF @@ -18,6 +18,7 @@ Import-Package: org.eclipse.core.runtime, org.eclipse.osee.framework.core.enums, org.eclipse.osee.framework.core.exception, org.eclipse.osee.framework.core.model, + org.eclipse.osee.framework.core.model.cache, org.eclipse.osee.framework.core.model.event, org.eclipse.osee.framework.core.model.type, org.eclipse.osee.framework.core.operation, diff --git a/plugins/org.eclipse.osee.client.integration.tests/osee-application-server.xml b/plugins/org.eclipse.osee.client.integration.tests/osee-application-server.xml index 13fb313ccc7..61d7d5c9a05 100644 --- a/plugins/org.eclipse.osee.client.integration.tests/osee-application-server.xml +++ b/plugins/org.eclipse.osee.client.integration.tests/osee-application-server.xml @@ -62,7 +62,7 @@ <forget> <echo message="Launching Osee Application Server..." /> <!-- Test Should Complete in 30 mins (timeout vale) - currently, they only take ~13 mins --> - <java taskname="build" failonerror="true" maxmemory="1024m" timeout="1800000" jar="${launcherJarPath}" fork="true"> + <java taskname="int-test-server" failonerror="true" maxmemory="1024m" timeout="1800000" jar="${launcherJarPath}" fork="true"> <classpath> <fileset dir="${xserver-home}/plugins" includes="org.eclipse.equinox.launcher_*.jar" /> <pathelement location="${xserver-home}/plugins" /> diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactLoaderTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactLoaderTest.java index c73183be3a7..27590331acf 100644 --- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactLoaderTest.java +++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactLoaderTest.java @@ -10,8 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.client.integration.tests.integration.skynet.core; -import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO; -import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; +import static org.eclipse.osee.client.demo.DemoChoice.*; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; @@ -78,7 +77,7 @@ public class ArtifactLoaderTest { public void tearDown() throws Exception { SkynetTransaction transaction = TransactionManager.createTransaction(branch, testInfo.getQualifiedTestName()); List<Artifact> artifacts = - ArtifactQuery.getArtifactListFromName(testInfo.getQualifiedTestName(), branch, EXCLUDE_DELETED); + ArtifactQuery.getArtifactListFromName(testInfo.getQualifiedTestName(), branch, DeletionFlag.EXCLUDE_DELETED); ArtifactPersistenceManager.deleteArtifactCollection(transaction, false, artifacts); transaction.execute(); } @@ -92,7 +91,7 @@ public class ArtifactLoaderTest { * Another interesting side-effect, is this test also gives a repeatable case for duplicate relation loading. These * are caught by the SevereLoggingMonitor. */ - @Test(timeout = 5000) + @Test(timeout = 10000) public void testThreadSafeLoading() throws Exception { // Create some software artifacts SkynetTransaction transaction = @@ -117,7 +116,7 @@ public class ArtifactLoaderTest { tasks.add(new LoadArtifacts()); } - ExecutorService executor = Executors.newFixedThreadPool(7, new LoadThreadFactory()); + ExecutorService executor = Executors.newFixedThreadPool(TOTAL_THREADS, new LoadThreadFactory()); List<Future<List<Artifact>>> futures = executor.invokeAll(tasks, 81, TimeUnit.SECONDS); int completed = 0; int cancelled = 0; @@ -137,7 +136,8 @@ public class ArtifactLoaderTest { // Load and check artifacts artifacts = - ArtifactQuery.getArtifactListFromName("ArtifactLoaderTest", BranchManager.getCommonBranch(), EXCLUDE_DELETED); + ArtifactQuery.getArtifactListFromName("ArtifactLoaderTest", BranchManager.getCommonBranch(), + DeletionFlag.EXCLUDE_DELETED); Assert.assertEquals(NUM_ARTIFACTS, artifacts.size()); for (Artifact artifact : artifacts) { Assert.assertEquals(ATTRIBUTE_VALUE, artifact.getSoleAttributeValue(CoreAttributeTypes.DefaultMailServer)); @@ -273,7 +273,7 @@ public class ArtifactLoaderTest { public List<Artifact> call() throws Exception { List<Artifact> artifacts = ArtifactQuery.getArtifactListFromName("ArtifactLoaderTest", BranchManager.getCommonBranch(), - EXCLUDE_DELETED); + DeletionFlag.EXCLUDE_DELETED); if (artifacts.size() != NUM_ARTIFACTS) { throw new OseeStateException("Should have loaded %d not %d", NUM_ARTIFACTS, artifacts.size()); } diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java index 8e0d4e083da..adc75d7909a 100644 --- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java +++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactQueryTest.java @@ -10,23 +10,27 @@ *******************************************************************************/ package org.eclipse.osee.client.integration.tests.integration.skynet.core; -import static org.eclipse.osee.client.demo.DemoChoice.OSEE_CLIENT_DEMO; -import static org.eclipse.osee.framework.core.enums.DeletionFlag.INCLUDE_DELETED; +import static org.eclipse.osee.client.demo.DemoChoice.*; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule; import org.eclipse.osee.client.test.framework.OseeLogMonitorRule; +import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.DeletionFlag; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.Branch; +import org.eclipse.osee.framework.core.model.cache.BranchFilter; import org.eclipse.osee.framework.jdk.core.util.GUID; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; +import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -55,7 +59,8 @@ public class ArtifactQueryTest { // Should exist with allowDeleted searchedArtifact = - ArtifactQuery.getArtifactFromId(newArtifact.getGuid(), BranchManager.getCommonBranch(), INCLUDE_DELETED); + ArtifactQuery.getArtifactFromId(newArtifact.getGuid(), BranchManager.getCommonBranch(), + DeletionFlag.INCLUDE_DELETED); Assert.assertNotNull(searchedArtifact); newArtifact.deleteAndPersist(); @@ -77,7 +82,8 @@ public class ArtifactQueryTest { // Should still exist with allowDeleted searchedArtifact = - ArtifactQuery.getArtifactFromId(newArtifact.getGuid(), BranchManager.getCommonBranch(), INCLUDE_DELETED); + ArtifactQuery.getArtifactFromId(newArtifact.getGuid(), BranchManager.getCommonBranch(), + DeletionFlag.INCLUDE_DELETED); Assert.assertNotNull(searchedArtifact); } @@ -85,8 +91,11 @@ public class ArtifactQueryTest { @Test public void testGetArtifactListFromType() throws OseeCoreException { // Should exist - List<Artifact> searchedArtifacts = - ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, DeletionFlag.INCLUDE_DELETED); + Set<Artifact> searchedArtifacts = new LinkedHashSet<Artifact>(); + for (IOseeBranch branch : BranchManager.getBranches(new BranchFilter())) { + searchedArtifacts.addAll(ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, branch, + DeletionFlag.INCLUDE_DELETED)); + } // make sure at least one artifact exists Assert.assertTrue("No artifacts found", searchedArtifacts.size() > 0); @@ -127,8 +136,8 @@ public class ArtifactQueryTest { artifact1.persist("testLargeAttributeIndexing"); Thread.sleep(1000); List<Artifact> artifacts = - ArtifactQuery.getArtifactListFromAttributeKeywords(branch, "Wikipedia", false, DeletionFlag.EXCLUDE_DELETED, - false, CoreAttributeTypes.Name); + ArtifactQuery.getArtifactListFromName("Wikipedia", branch, DeletionFlag.EXCLUDE_DELETED, + QueryOptions.CONTAINS_MATCH_OPTIONS); Job job = BranchManager.deleteBranch(branch); job.join(); Assert.assertEquals(1, artifacts.size()); |