Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-06-27 17:12:34 -0400
committerRyan D. Brooks2016-07-29 02:18:28 -0400
commit0ff6aba5036081c457be0ecff42f3c4f3feb543f (patch)
tree8b13d7a05cf3fbdb64247cd69040b47e940cb471 /plugins/org.eclipse.osee.x.server.integration.tests
parent318b5413f15d3e014e23a790043e8b9b1202ac73 (diff)
downloadorg.eclipse.osee-0ff6aba5036081c457be0ecff42f3c4f3feb543f.tar.gz
org.eclipse.osee-0ff6aba5036081c457be0ecff42f3c4f3feb543f.tar.xz
org.eclipse.osee-0ff6aba5036081c457be0ecff42f3c4f3feb543f.zip
feature[ats_ATS286643]: HLR - Implement Types Versioning
Diffstat (limited to 'plugins/org.eclipse.osee.x.server.integration.tests')
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/README_BEFORE_RUNNING_TESTS.txt10
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/AccountClientTest.java11
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java66
4 files changed, 40 insertions, 48 deletions
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
index 52b32b5e04..a08ea4ab47 100644
--- a/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
@@ -13,6 +13,7 @@ Import-Package: javax.ws.rs.core;version="2.0.0",
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.jdk.core.type,
+ org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.jaxrs,
org.eclipse.osee.jaxrs.client,
org.eclipse.osee.orcs.rest.client,
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/README_BEFORE_RUNNING_TESTS.txt b/plugins/org.eclipse.osee.x.server.integration.tests/README_BEFORE_RUNNING_TESTS.txt
new file mode 100644
index 0000000000..f3108551ca
--- /dev/null
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/README_BEFORE_RUNNING_TESTS.txt
@@ -0,0 +1,10 @@
+DO NOT RUN THIS SUITE AS JUNIT PLUGIN TEST (it will connect to Production DB)
+
+Integration test suite run with Application Server
+Data gets written to target directory from org.eclipse.osee.x.server.p2/demo via the pom.xml
+
+To run locally:
+1) unzip org.eclipse.osee.x.server.p2/demo/hsql.zip to your home dir
+2) unzip org.eclipse.osee.x.server.p2/demo/binary_data.zip to your home dir
+3) Launch local hsql application server
+4) Run Server Integration Test Suite as JUnit Test
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/AccountClientTest.java b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/AccountClientTest.java
index 43aeed0875..c338cb5254 100644
--- a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/AccountClientTest.java
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/AccountClientTest.java
@@ -22,8 +22,10 @@ import org.eclipse.osee.account.rest.model.AccountDetailsData;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
import org.eclipse.osee.account.rest.model.AccountPreferencesData;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.x.server.integration.tests.util.IntegrationUtil;
+import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Rule;
@@ -52,9 +54,18 @@ public class AccountClientTest {
private String guid;
private Map<String, String> prefs;
+ @After
+ public void cleanUp() {
+ client = IntegrationUtil.createAccountClient();
+ client.deleteAccount(accountId);
+ }
+
@Before
public void setUp() {
client = IntegrationUtil.createAccountClient();
+ if (!client.isLocalHost()) {
+ throw new OseeStateException("This test should be run with local test server, not %s", client.getBaseUri());
+ }
String methodName = testName.getMethodName();
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java
index c352fda29b..1cb0b42097 100644
--- a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java
@@ -21,14 +21,17 @@ import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.io.StringWriter;
import java.util.Collection;
import java.util.Properties;
import javax.ws.rs.core.MediaType;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.orcs.rest.client.OseeClient;
import org.eclipse.osee.orcs.rest.model.IdeClientEndpoint;
import org.eclipse.osee.orcs.rest.model.IdeVersion;
@@ -48,6 +51,10 @@ public class OseeClientQueryTest {
@BeforeClass
public static void testSetup() throws OseeCoreException {
createClient = IntegrationUtil.createClient();
+ if (!createClient.isLocalHost()) {
+ throw new OseeStateException("This test should be run with local test server, not %s",
+ createClient.getBaseUri());
+ }
// Establish initial connection to the db using this random query
createClient.createQueryBuilder(COMMON).andIds(SystemUser.OseeSystem).getSearchResult(RequestType.IDS);
@@ -88,14 +95,17 @@ public class OseeClientQueryTest {
@Test
public void searchForArtifactByLocalId() throws OseeCoreException {
final int EXPECTED_RESULTS = 1;
- SearchResult results = createClient.createQueryBuilder(COMMON).andLocalId(9).getSearchResult(RequestType.IDS);
+ SearchResult results = createClient.createQueryBuilder(COMMON).andLocalId(
+ CoreArtifactTokens.UserGroups.getId().intValue()).getSearchResult(RequestType.IDS);
assertEquals(EXPECTED_RESULTS, results.getTotal());
}
@Test
public void searchForArtifactByLocalIds() throws OseeCoreException {
final int EXPECTED_RESULTS = 2;
- SearchResult results = createClient.createQueryBuilder(COMMON).andLocalId(19, 9).getSearchResult(RequestType.IDS);
+ SearchResult results =
+ createClient.createQueryBuilder(COMMON).andLocalId(CoreArtifactTokens.UserGroups.getId().intValue(),
+ CoreArtifactTokens.Everyone.getId().intValue()).getSearchResult(RequestType.IDS);
assertEquals(EXPECTED_RESULTS, results.getTotal());
}
@@ -109,7 +119,7 @@ public class OseeClientQueryTest {
@Test
public void searchForArtifactWithActionInName() throws OseeCoreException {
- final int EXPECTED_RESULTS = 43;
+ final int EXPECTED_RESULTS = 45;
SearchResult results = createClient.createQueryBuilder(COMMON).and(CoreAttributeTypes.Name, "SAW",
QueryOption.CASE__IGNORE, QueryOption.TOKEN_MATCH_ORDER__MATCH, QueryOption.TOKEN_DELIMITER__ANY,
QueryOption.TOKEN_COUNT__IGNORE).getSearchResult(RequestType.IDS);
@@ -172,60 +182,20 @@ public class OseeClientQueryTest {
assertEquals(true, !supportedVersions.isEmpty());
}
+ /**
+ * This test simply ensures that the client endpoint to run Orcs Script works. OrcsScriptTest is the more exhaustive
+ * test of Orcs Script.
+ */
@Test
public void orcsScript() {
String script =
"start from branch 570 find artifacts where art-type = 'Folder' collect artifacts {id, attributes { value } };";
- String expected = "{\n" + //
- " 'parameters' : {\n" + //
- " 'output.debug' : 'false'\n" + //
- " },\n" + //
- " 'script' : 'start from branch 570 find artifacts where art-type = 'Folder' collect artifacts {id, attributes { value } };',\n" + //
- " 'results' : [ {\n" + //
- " 'artifacts' : [ {\n" + //
- " 'id' : 8,\n" + //
- " 'attributes' : {\n" + //
- " 'Name' : {\n" + //
- " 'value' : 'User Groups'\n" + //
- " }\n" + //
- " }\n" + //
- " }, {\n" + //
- " 'id' : 26,\n" + //
- " 'attributes' : {\n" + //
- " 'Name' : {\n" + //
- " 'value' : 'Document Templates'\n" + //
- " }\n" + //
- " }\n" + //
- " }, {\n" + //
- " 'id' : 31,\n" + //
- " 'attributes' : {\n" + //
- " 'Name' : {\n" + //
- " 'value' : 'Action Tracking System'\n" + //
- " }\n" + //
- " }\n" + //
- " }, {\n" + //
- " 'id' : 34,\n" + //
- " 'attributes' : {\n" + //
- " 'Name' : {\n" + //
- " 'value' : 'Config'\n" + //
- " }\n" + //
- " }\n" + //
- " }, {\n" + //
- " 'id' : 35,\n" + //
- " 'attributes' : {\n" + //
- " 'Name' : {\n" + //
- " 'value' : 'Work Definitions'\n" + //
- " }\n" + //
- " }\n" + //
- " } ]\n" + //
- " } ]\n" + //
- "}";
StringWriter writer = new StringWriter();
Properties properties = new Properties();
createClient.executeScript(script, properties, false, MediaType.APPLICATION_JSON_TYPE, writer);
- assertEquals(expected, normalize(writer.toString()));
+ assertTrue(normalize(writer.toString()).contains("'value' : 'User Groups'"));
}
private String normalize(String value) {

Back to the top