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 0000000000000000000000000000000000000000..c58468e8c2b2d1bc3044a26efd058f4cf98ae6c2 --- /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 0000000000000000000000000000000000000000..f56e2b892965c0b1f574bcacb8dc5029ed78d484 --- /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