2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright © 2009 Regents of the University of California
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
24 package org.collectionspace.services.client.test;
27 * ServiceTest, interface specifying the client tests to be performed
28 * to test an entity or relation service.
30 public interface ServiceTest {
32 // ---------------------------------------------------------------
33 // CRUD tests : CREATE tests
34 // ---------------------------------------------------------------
39 * Tests creation of a new resource.
41 * Relied upon by 'read', 'update' and 'delete' tests, below.
46 * Tests creation of two or more new resources by repeatedly
47 * calling create(), and relies on the latter's test assertion(s).
49 * Relied upon by 'read multiple' tests, below.
51 public void createMultiple();
56 * Tests creation of a null resource via the
57 * Java Client Library.
59 public void createNull();
62 * Tests creation of a resource by submitting
63 * a representation with malformed XML data.
65 public void createWithMalformedXml();
68 * Tests creation of a resource by submitting
69 * a representation in the wrong XML schema
70 * (e.g. not matching the object's schema).
72 public void createWithWrongXmlSchema();
74 // @TODO If feasible, implement a negative (failure)
75 // test for creation of duplicate resources.
78 // ---------------------------------------------------------------
79 // CRUD tests : READ tests
80 // ---------------------------------------------------------------
85 * Tests reading (i.e. retrieval) of a resource.
92 * Tests reading (i.e. retrieval) of a non-existent
93 * resource, whose resource identifier does not exist
94 * at the specified URL.
96 public void readNonExistent();
99 // ---------------------------------------------------------------
100 // CRUD tests : READ (list, or multiple) tests
101 // ---------------------------------------------------------------
106 * Tests reading (i.e. retrieval) of a list of
107 * multiple resources.
109 public void readList();
111 // If feasible, implement a test for reading
112 // an empty list returned by the service.
116 // If feasible, implement a negative (failure) test
117 // with unrecognized query parameters, other than
118 // filtering or chunking parameters, etc., recognized
121 // ---------------------------------------------------------------
122 // CRUD tests : UPDATE tests
123 // ---------------------------------------------------------------
129 * Tests updating the content of a resource.
131 public void update();
136 * Tests updating the content of a resource
137 * by submitting a representation with malformed
140 public void updateWithMalformedXml();
143 * Tests updating the content of a resource
144 * by submitting a representation in the wrong
145 * XML schema (e.g. not matching the object's schema).
147 public void updateWithWrongXmlSchema();
150 * Tests updating the content of a non-existent
151 * resource, whose resource identifier does not exist.
153 public void updateNonExistent();
156 // ---------------------------------------------------------------
157 // CRUD tests : DELETE tests
158 // ---------------------------------------------------------------
163 * Tests deleting a resource.
165 public void delete();
170 * Tests deleting a non-existent resource, whose resource
171 * identifier does not exist at the specified URL.
173 public void deleteNonExistent();