From 7355469ee7b2662d62960daef2006791d7ab755b Mon Sep 17 00:00:00 2001
From: pkupczyk <pkupczyk>
Date: Tue, 22 Dec 2015 08:18:44 +0000
Subject: [PATCH] SSDM-2978 : V3 AS API - change the package structure ("as" is
 a Python keyword) - add tests that were accidentally removed during package
 rename

SVN: 35390
---
 .../asapi/v3/ExecuteServiceTest.java          | 46 +++++++++++++++++++
 .../asapi/v3/SearchServiceTest.java           | 43 +++++++++++++++++
 2 files changed, 89 insertions(+)
 create mode 100644 openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteServiceTest.java
 create mode 100644 openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java

diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteServiceTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteServiceTest.java
new file mode 100644
index 00000000000..c58468e8c2b
--- /dev/null
+++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteServiceTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2015 ETH Zuerich, SIS
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.systemtest.asapi.v3;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.Serializable;
+
+import org.testng.annotations.Test;
+
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.ExecutionOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.id.ServiceCode;
+
+/**
+ * @author Franz-Josef Elmer
+ */
+public class ExecuteServiceTest extends AbstractTest
+{
+
+    @Test(enabled = false)
+    public void testSearchServices()
+    {
+        String sessionToken = v3api.login(TEST_USER, PASSWORD);
+        ExecutionOptions options = new ExecutionOptions();
+        options.withParameter("name", Math.PI);
+
+        Serializable result = v3api.executeService(sessionToken, new ServiceCode("simple-service"), options);
+
+        assertEquals(result, "hello 3.14159265359. Spaces: [Space CISD]");
+    }
+
+}
\ No newline at end of file
diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java
new file mode 100644
index 00000000000..f56e2b89296
--- /dev/null
+++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/SearchServiceTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015 ETH Zuerich, SIS
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.systemtest.asapi.v3;
+
+import static org.testng.Assert.assertEquals;
+
+import org.testng.annotations.Test;
+
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchResult;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.Service;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.fetchoptions.ServiceFetchOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.service.search.ServiceSearchCriteria;
+
+/**
+ * @author Franz-Josef Elmer
+ */
+public class SearchServiceTest extends AbstractTest
+{
+
+    @Test(enabled = false)
+    public void testSearchServices()
+    {
+        String sessionToken = v3api.login(TEST_USER, PASSWORD);
+
+        SearchResult<Service> result = v3api.searchServices(sessionToken, new ServiceSearchCriteria(), new ServiceFetchOptions());
+
+        assertEquals(result.getTotalCount(), 1);
+    }
+}
\ No newline at end of file
-- 
GitLab