]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
7c5bb579069f729cc6a62ebef7aa0858fd9fc75b
[tmp/jakarta-migration.git] /
1 /**
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:
5  *
6  * http://www.collectionspace.org
7  * http://wiki.collectionspace.org
8  *
9  * Copyright © 2009 Regents of the University of California
10  *
11  * Licensed under the Educational Community License (ECL), Version 2.0.
12  * You may not use this file except in compliance with this License.
13  *
14  * You may obtain a copy of the ECL 2.0 License at
15  *
16  * https://source.collectionspace.org/collection-space/LICENSE.txt
17  *
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.
23  */
24 package org.collectionspace.services.client.test;
25
26 /**
27  * ServiceTest, interface specifying the client tests to be performed
28  * to test an entity or relation service.
29  */
30 public interface ServiceTest {
31
32     // ---------------------------------------------------------------
33     // CRUD tests : CREATE tests
34     // ---------------------------------------------------------------
35
36     // Success outcomes
37
38     /**
39      * Tests creation of a new resource.
40      *
41      * Relied upon by 'read', 'update' and 'delete' tests, below.
42      */
43     public void create(); 
44
45     /**
46      * Tests creation of two or more new resources by repeatedly
47      * calling create(), and relies on the latter's test assertion(s).
48      *
49      * Relied upon by 'read multiple' tests, below.
50      */
51     public void createMultiple();
52
53     // Failure outcomes
54
55     /**
56      * Tests creation of a null resource via the
57      * Java Client Library. 
58      */
59     public void createNull();
60
61     /**
62      * Tests creation of a resource by submitting
63      * a representation with malformed XML data. 
64      */
65     public void createWithMalformedXml();
66
67     /**
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). 
71      */
72     public void createWithWrongXmlSchema();
73         
74     // @TODO If feasible, implement a negative (failure)
75     // test for creation of duplicate resources.
76
77
78     // ---------------------------------------------------------------
79     // CRUD tests : READ tests
80     // ---------------------------------------------------------------
81
82     // Success outcomes
83     
84     /**
85      * Tests reading (i.e. retrieval) of a resource. 
86      */
87     public void read();
88
89     // Failure outcomes
90
91     /**
92      * Tests reading (i.e. retrieval) of a non-existent
93      * resource, whose resource identifier does not exist
94      * at the specified URL.
95      */
96     public void readNonExistent(); 
97
98
99     // ---------------------------------------------------------------
100     // CRUD tests : READ (list, or multiple) tests
101     // ---------------------------------------------------------------
102
103     // Success outcomes
104
105     /**
106      * Tests reading (i.e. retrieval) of a list of
107      * multiple resources.
108      */
109     public void readList(); 
110
111     // If feasible, implement a test for reading
112     // an empty list returned by the service.
113
114     // Failure outcomes
115     
116     // If feasible, implement a negative (failure) test
117     // with unrecognized query parameters, other than
118     // filtering or chunking parameters, etc., recognized
119     // by the service.
120
121     // ---------------------------------------------------------------
122     // CRUD tests : UPDATE tests
123     // ---------------------------------------------------------------
124
125     // Success outcomes
126     // ----------------
127
128     /**
129      * Tests updating the content of a resource. 
130      */
131     public void update();
132
133     // Failure outcomes
134
135     /**
136      * Tests updating the content of a resource 
137      * by submitting a representation with malformed
138      * XML data. 
139      */
140     public void updateWithMalformedXml();
141
142     /**
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). 
146      */
147     public void updateWithWrongXmlSchema();
148
149     /**
150      * Tests updating the content of a non-existent
151      * resource, whose resource identifier does not exist.
152      */
153     public void updateNonExistent();
154
155
156     // ---------------------------------------------------------------
157     // CRUD tests : DELETE tests
158     // ---------------------------------------------------------------
159
160     // Success outcomes
161
162     /**
163      * Tests deleting a resource.
164      */
165     public void delete(); 
166     
167     // Failure outcomes
168     
169     /**
170      * Tests deleting a non-existent resource, whose resource
171      * identifier does not exist at the specified URL.
172      */
173     public void deleteNonExistent();
174     
175 }
176
177