Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-11-25 16:46:46 -0500
committerAngel Avila2014-11-25 16:46:46 -0500
commit0c8445df02cd72786f360f489425ce2088ddecdf (patch)
treea9079d07e58adf0001c0f19d4b62c384a95af578 /plugins/org.eclipse.osee.x.server.integration.tests
parent64c9287856678919697b65a55b2ab32b5b358d4c (diff)
downloadorg.eclipse.osee-0c8445df02cd72786f360f489425ce2088ddecdf.tar.gz
org.eclipse.osee-0c8445df02cd72786f360f489425ce2088ddecdf.tar.xz
org.eclipse.osee-0c8445df02cd72786f360f489425ce2088ddecdf.zip
feature[ats_ATS137214]: Add ORCS Script Tests
Diffstat (limited to 'plugins/org.eclipse.osee.x.server.integration.tests')
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/OseeClientQueryTest.java65
1 files changed, 65 insertions, 0 deletions
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 83a5cb6a92..3281f83f4f 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
@@ -19,6 +19,8 @@ import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.AccessCon
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import static org.junit.Assert.assertEquals;
+import java.io.StringWriter;
+import java.util.Properties;
import org.databene.contiperf.PerfTest;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -189,4 +191,67 @@ public class OseeClientQueryTest {
assertEquals(EXPECTED_RESULTS, results.getTotal());
}
+ @PerfTest(threads = 1, invocations = 1)
+ @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, writer);
+
+ assertEquals(expected, normalize(writer.toString()));
+ }
+
+ private String normalize(String value) {
+ value = value.replaceAll("\r\n", "\n");
+ value = value.replaceAll("\"", "'");
+ return value;
+ }
}

Back to the top