]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
4616bba3a0feb09d1b54564a9617cd794621878e
[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  * https://source.collectionspace.org/collection-space/LICENSE.txt
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permRoles and
21  * limitations under the License.
22  */
23 package org.collectionspace.services.authorization.client.test;
24
25 import java.util.ArrayList;
26 import java.util.Collection;
27 import java.util.Date;
28 import java.util.Hashtable;
29 import java.util.List;
30
31 import javax.ws.rs.core.Response;
32
33 import org.collectionspace.services.authorization.perms.EffectType;
34 import org.collectionspace.services.authorization.perms.Permission;
35 import org.collectionspace.services.authorization.perms.PermissionAction;
36 import org.collectionspace.services.authorization.PermissionRole;
37 import org.collectionspace.services.authorization.PermissionValue;
38 import org.collectionspace.services.authorization.Role;
39 import org.collectionspace.services.authorization.RoleValue;
40 import org.collectionspace.services.client.CollectionSpaceClient;
41 import org.collectionspace.services.client.PermissionClient;
42 import org.collectionspace.services.client.PermissionFactory;
43 import org.collectionspace.services.client.RolePermissionClient;
44 import org.collectionspace.services.client.PermissionRoleFactory;
45 import org.collectionspace.services.client.RoleClient;
46 import org.collectionspace.services.client.RoleFactory;
47 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
48 import org.collectionspace.services.client.test.ServiceRequestType;
49
50 import org.testng.Assert;
51 import org.testng.annotations.Test;
52 import org.slf4j.Logger;
53 import org.slf4j.LoggerFactory;
54 import org.testng.annotations.AfterClass;
55 import org.testng.annotations.BeforeClass;
56
57 /**
58  * PermissionServiceTest, carries out tests against a
59  * deployed and running Permission, Role and PermissionRole Services.
60  * 
61  * $LastChangedRevision: 917 $
62  * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $
63  */
64 public class RolePermissionServiceTest extends AbstractServiceTestImpl<PermissionRole, PermissionRole,
65                 PermissionRole, PermissionRole> {
66
67     /** The Constant logger. */
68     private final static String CLASS_NAME = RolePermissionServiceTest.class.getName();
69     private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
70     // Instance variables specific to this test.
71     final private static String TEST_MARKER = "_RolePermissionServiceTest";
72     final private static String TEST_ROLE_NAME = "ROLE";
73     final private static String NO_REL_SUFFIX = "-no-rel";
74     /** The perm values. */
75     private Hashtable<String, PermissionValue> permValues = new Hashtable<String, PermissionValue>();
76     /** The role values. */
77     private Hashtable<String, RoleValue> roleValues = new Hashtable<String, RoleValue>();
78     private Date now = new Date();
79
80     /* (non-Javadoc)
81      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
82      */
83     @Override
84     protected String getServicePathComponent() {
85         return new RolePermissionClient().getServicePathComponent();
86     }
87     
88     @Override
89     public String getServiceName() { 
90         return RoleClient.SERVICE_NAME; // RolePermission is a sub-resource of 'roles' resource.
91     }
92     
93     private String getRoleName() {
94         return TEST_ROLE_NAME + TEST_MARKER + now.toString();
95     }
96
97     /**
98      * The entity type expected from the JAX-RS Response object
99      */
100     public Class<PermissionRole> getEntityResponseType() {
101         return PermissionRole.class;
102     }
103     
104     /**
105      * Seed data.
106      */
107     @BeforeClass(alwaysRun = true)
108     public void seedData() {
109
110         String rn1 = getRoleName();
111         String r1RoleId = createRole(rn1);
112         RoleValue rv1 = new RoleValue();
113         rv1.setRoleId(r1RoleId);
114         rv1.setRoleName(rn1);
115         roleValues.put(rv1.getRoleName(), rv1);
116
117         String rn2 = getRoleName() + NO_REL_SUFFIX;
118         String r2RoleId = createRole(rn2);
119         RoleValue rv2 = new RoleValue();
120         rv2.setRoleId(r2RoleId);
121         rv2.setRoleName(rn2);
122         roleValues.put(rv2.getRoleName(), rv2);
123
124         String ra1 = "fooService" + TEST_MARKER;
125         String permId1 = createPermission(ra1, EffectType.PERMIT);
126         PermissionValue pva1 = new PermissionValue();
127         pva1.setResourceName(ra1);
128         pva1.setPermissionId(permId1);
129         permValues.put(pva1.getResourceName(), pva1);
130
131         String ra2 = "barService" + TEST_MARKER;
132         String permId2 = createPermission(ra1, EffectType.PERMIT);
133         PermissionValue pva2 = new PermissionValue();
134         pva2.setResourceName(ra2);
135         pva2.setPermissionId(permId2);
136         permValues.put(pva2.getResourceName(), pva2);
137     }
138
139     /* (non-Javadoc)
140      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
141      */
142     @Override
143     protected CollectionSpaceClient getClientInstance() {
144         return new RolePermissionClient();
145     }
146
147         @Override
148         protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
149         return new RolePermissionClient(clientPropertiesFilename);
150         }       
151
152     /* (non-Javadoc)
153      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readPaginatedList(java.lang.String)
154      */
155 //    @Test(dataProvider = "testName")
156     @Override
157     public void readPaginatedList(String testName) throws Exception {
158         //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
159     }
160     
161     // ---------------------------------------------------------------
162     // CRUD tests : CREATE tests
163     // ---------------------------------------------------------------
164     // Success outcomes
165     /* (non-Javadoc)
166      * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
167      */
168
169     @Override
170 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
171     public void create(String testName) throws Exception {
172         // Perform setup, such as initializing the type of service request
173         // (e.g. CREATE, DELETE), its valid and expected status codes, and
174         // its associated HTTP method name (e.g. POST, DELETE).
175         setupCreate();
176
177         // Submit the request to the service and store the response.
178         RoleValue rv = roleValues.get(getRoleName());
179         PermissionRole permRole = createPermissionRoleInstance(rv,
180                 permValues.values(), true, true);
181         RolePermissionClient client = new RolePermissionClient();
182         Response res = client.create(rv.getRoleId(), permRole);
183         try {
184             int statusCode = res.getStatus();
185             if (logger.isDebugEnabled()) {
186                 logger.debug(testName + ": status = " + statusCode);
187             }
188             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
189                     invalidStatusCodeMessage(testRequestType, statusCode));
190             Assert.assertEquals(statusCode, testExpectedStatusCode);
191
192             knownResourceId = extractId(res); //This is meaningless in this test, see getKnowResourceId() method for details
193             if (logger.isDebugEnabled()) {
194                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
195             }
196         } finally {
197             if (res != null) {
198                 res.close();
199             }
200         }
201     }
202
203     //to not cause uniqueness violation for permRole, createList is removed
204     /* (non-Javadoc)
205      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
206      */
207     @Override
208 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
209 //      dependsOnMethods = {"create"})
210     public void createList(String testName) throws Exception {
211         //Should this really be empty?
212     }
213
214     // Failure outcomes
215     // Placeholders until the three tests below can be uncommented.
216     // See Issue CSPACE-401.
217     /* (non-Javadoc)
218      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
219      */
220     @Override
221     public void createWithEmptyEntityBody(String testName) throws Exception {
222         //Should this really be empty?
223     }
224
225     /* (non-Javadoc)
226      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
227      */
228     @Override
229     public void createWithMalformedXml(String testName) throws Exception {
230         //Should this really be empty?
231     }
232
233     /* (non-Javadoc)
234      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
235      */
236     @Override
237     public void createWithWrongXmlSchema(String testName) throws Exception {
238         //Should this really be empty?
239     }
240
241     // ---------------------------------------------------------------
242     // CRUD tests : READ tests
243     // ---------------------------------------------------------------
244     // Success outcomes
245     /* (non-Javadoc)
246      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
247      */
248     @Override
249 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
250 //      dependsOnMethods = {"create"})
251     public void read(String testName) throws Exception {
252         // Perform setup.
253         setupRead();
254
255         // Submit the request to the service and store the response.
256         RolePermissionClient client = new RolePermissionClient();
257         Response res = client.read(roleValues.get(getRoleName()).getRoleId());
258         try {
259             int statusCode = res.getStatus();
260
261             // Check the status code of the response: does it match
262             // the expected response(s)?
263             if (logger.isDebugEnabled()) {
264                 logger.debug(testName + ": status = " + statusCode);
265             }
266             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
267                     invalidStatusCodeMessage(testRequestType, statusCode));
268             Assert.assertEquals(statusCode, testExpectedStatusCode);
269
270             PermissionRole output = res.readEntity(PermissionRole.class);
271             Assert.assertNotNull(output);
272         } finally {
273             if (res != null) {
274                 res.close();
275             }
276         }
277     }
278
279     // Failure outcomes
280     /* (non-Javadoc)
281      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
282      */
283     @Override
284 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
285     public void readNonExistent(String testName) throws Exception {
286         // Perform setup.
287         setupReadNonExistent();
288
289         // Submit the request to the service and store the response.
290         RolePermissionClient client = new RolePermissionClient();
291         Response res = client.read(NON_EXISTENT_ID);
292         try {
293             int statusCode = res.getStatus();
294
295             // Check the status code of the response: does it match
296             // the expected response(s)?
297             if (logger.isDebugEnabled()) {
298                 logger.debug(testName + ": status = " + statusCode);
299             }
300             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
301                     invalidStatusCodeMessage(testRequestType, statusCode));
302             Assert.assertEquals(statusCode, testExpectedStatusCode);
303         } finally {
304             if (res != null) {
305                 res.close();
306             }
307         }
308     }
309
310     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
311     public void readNoRelationship(String testName) throws Exception {
312         setupRead();
313         // Submit the request to the service and store the response.
314         RolePermissionClient client = new RolePermissionClient();
315         Response res = client.read(roleValues.get(getRoleName() + NO_REL_SUFFIX).getRoleId());
316         try {
317             int statusCode = res.getStatus();
318
319             // Check the status code of the response: does it match
320             // the expected response(s)?
321             if (logger.isDebugEnabled()) {
322                 logger.debug(testName + ": status = " + statusCode);
323             }
324             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
325                     invalidStatusCodeMessage(testRequestType, statusCode));
326             Assert.assertEquals(statusCode, Response.Status.OK.getStatusCode());
327             PermissionRole output = res.readEntity(PermissionRole.class);
328
329             String sOutput = objectAsXmlString(output, PermissionRole.class);
330             if (logger.isDebugEnabled()) {
331                 logger.debug(testName + " received " + sOutput);
332             }
333         } finally {
334             if (res != null) {
335                 res.close();
336             }
337         }
338     }
339
340     // ---------------------------------------------------------------
341     // CRUD tests : READ_LIST tests
342     // ---------------------------------------------------------------
343     // Success outcomes
344     /* (non-Javadoc)
345      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
346      */
347     @Override
348 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
349 //      dependsOnMethods = {"createList", "read"})
350     public void readList(String testName) throws Exception {
351         //Should this really be empty?
352     }
353
354     // Failure outcomes
355     // None at present.
356     // ---------------------------------------------------------------
357     // CRUD tests : UPDATE tests
358     // ---------------------------------------------------------------
359     // Success outcomes
360     /* (non-Javadoc)
361      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
362      */
363     @Override
364 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
365 //      dependsOnMethods = {"read", "readList", "readNonExistent"})
366     public void update(String testName) throws Exception {
367         //Should this really be empty?
368     }
369
370     // Failure outcomes
371     // Placeholders until the three tests below can be uncommented.
372     // See Issue CSPACE-401.
373     /* (non-Javadoc)
374      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
375      */
376     @Override
377     public void updateWithEmptyEntityBody(String testName) throws Exception {
378         //Should this really be empty?
379     }
380
381     /* (non-Javadoc)
382      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
383      */
384     @Override
385     public void updateWithMalformedXml(String testName) throws Exception {
386         //Should this really be empty?
387     }
388
389     /* (non-Javadoc)
390      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
391      */
392     @Override
393     public void updateWithWrongXmlSchema(String testName) throws Exception {
394         //Should this really be empty?
395     }
396
397     /* (non-Javadoc)
398      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
399      */
400     @Override
401 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
402 //    dependsOnMethods = {"readNonExistent", "testSubmitRequest"})
403     public void updateNonExistent(String testName) throws Exception {
404         //Should this really be empty?
405     }
406
407     // ---------------------------------------------------------------
408     // CRUD tests : DELETE tests
409     // ---------------------------------------------------------------
410     // Success outcomes
411     /* (non-Javadoc)
412      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
413      */
414     @Override
415 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
416 //    dependsOnMethods = {"read"})
417     public void delete(String testName) throws Exception {
418         // Perform setup.
419         setupDelete();
420                 
421         // Submit the request to the service and store the response.
422         RolePermissionClient client = new RolePermissionClient();
423         RoleValue rv = roleValues.get(getRoleName());
424         Response delRes = client.delete(rv.getRoleId());
425         try {
426             int statusCode = delRes.getStatus();
427             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
428                     invalidStatusCodeMessage(testRequestType, statusCode));
429             Assert.assertEquals(statusCode, testExpectedStatusCode);
430         } finally {
431             if (delRes != null) {
432                 delRes.close();
433             }
434         }
435
436         // reset for next delete
437         create(testName);
438         setupDelete();
439         
440         rv = roleValues.get(getRoleName());
441         Response readResponse = client.read(rv.getRoleId());
442         PermissionRole toDelete = null;
443         try {
444                 toDelete = readResponse.readEntity(PermissionRole.class);
445         } finally {
446                 readResponse.close();
447         }
448         
449         rv = toDelete.getRole().get(0);
450         Response res = client.delete(rv.getRoleId(), toDelete);
451         try {
452             int statusCode = res.getStatus();
453             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
454                     invalidStatusCodeMessage(testRequestType, statusCode));
455             Assert.assertEquals(statusCode, testExpectedStatusCode);
456         } finally {
457             if (res != null) {
458                 res.close();
459             }
460         }
461     }
462
463     // Failure outcomes
464     /* (non-Javadoc)
465      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
466      */
467     @Override
468 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
469     public void deleteNonExistent(String testName) throws Exception {
470         //ignoring this test as the service side returns 200 now even if it does
471         //not find a record in the db
472     }
473     
474     // ---------------------------------------------------------------
475     // Search tests
476     // ---------------------------------------------------------------
477     
478     @Override
479 //    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
480     public void searchWorkflowDeleted(String testName) throws Exception {
481         // Fixme: null test for now, overriding test in base class
482     }
483
484     // ---------------------------------------------------------------
485     // Utility tests : tests of code used in tests above
486     // ---------------------------------------------------------------
487     /**
488      * Tests the code for manually submitting data that is used by several
489      * of the methods above.
490      */
491     @Override
492 //    @Test(dependsOnMethods = {"create"}) //FIXME: REM - This is not a test of a submit to the permroles service, but to just authorization/roles
493     public void testSubmitRequest() {
494
495         // Expected status code: 200 OK
496         final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
497
498         // Submit the request to the service and store the response.
499         String method = ServiceRequestType.READ.httpMethodName();
500         String url = getResourceURL(roleValues.get(getRoleName()).getRoleId());
501         int statusCode = submitRequest(method, url);
502
503         // Check the status code of the response: does it match
504         // the expected response(s)?
505         if (logger.isDebugEnabled()) {
506             logger.debug("testSubmitRequest: url=" + url
507                     + " status=" + statusCode);
508         }
509         Assert.assertEquals(statusCode, EXPECTED_STATUS);
510     }
511
512     // ---------------------------------------------------------------
513     // Utility methods used by tests above
514     // ---------------------------------------------------------------
515     /**
516      * create PermissionRole instance
517      * @param rv rolevalue
518      * @param pvs permission value array
519      * @param usePermId 
520      * @param useRoleId
521      * @return PermissionRole
522      */
523     public static PermissionRole createPermissionRoleInstance(RoleValue rv,
524             Collection<PermissionValue> pvs,
525             boolean usePermId,
526             boolean useRoleId) {
527         List<PermissionValue> pvls = new ArrayList<PermissionValue>();
528         pvls.addAll(pvs);
529         PermissionRole permRole = PermissionRoleFactory.createPermissionRoleInstance(
530                 rv, pvls, usePermId, useRoleId);
531         if (logger.isDebugEnabled()) {
532             logger.debug("" +
533                     "permRole");
534             logger.debug(objectAsXmlString(permRole, PermissionRole.class));
535         }
536         return permRole;
537     }
538
539     /**
540      * Clean up.
541      */
542     @AfterClass(alwaysRun = true)
543     @Override
544     public void cleanUp() {
545         setupDelete();
546         String noTest = System.getProperty("noTestCleanup");
547         if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
548             if (logger.isDebugEnabled()) {
549                 logger.debug("Skipping Cleanup phase ...");
550             }
551             return;
552         }
553         if (logger.isDebugEnabled()) {
554             logger.debug("Cleaning up temporary resources created for testing ...");
555         }
556         for (PermissionValue pv : permValues.values()) {
557             deletePermission(pv.getPermissionId());
558         }
559         for (RoleValue rv : roleValues.values()) {
560             deleteRole(rv.getRoleId());
561         }
562     }
563
564     /**
565      * Creates the permission.
566      *
567      * @param resName the res name
568      * @param effect the effect
569      * @return the string
570      */
571     private String createPermission(String resName, EffectType effect) {
572         setupCreate();
573         PermissionClient permClient = new PermissionClient();
574         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
575         Permission permission = PermissionFactory.createPermissionInstance(resName,
576                 "default permissions for " + resName,
577                 actions, effect, true, true, true);
578         Response res = null;
579         String id = null;
580         try {
581             res = permClient.create(permission);
582             int statusCode = res.getStatus();
583             if (logger.isDebugEnabled()) {
584                 logger.debug("createPermission: resName=" + resName
585                         + " status = " + statusCode);
586             }
587             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
588                     invalidStatusCodeMessage(testRequestType, statusCode));
589             Assert.assertEquals(statusCode, testExpectedStatusCode);
590             id = extractId(res);
591         } finally {
592             if (res != null) {
593                 res.close();
594             }
595         }
596         return id;
597     }
598
599     /**
600      * Delete permission.
601      *
602      * @param permId the perm id
603      */
604     private void deletePermission(String permId) {
605         setupDelete();
606         PermissionClient permClient = new PermissionClient();
607
608         Response res = permClient.delete(permId);
609         try {
610             int statusCode = res.getStatus();
611             if (logger.isDebugEnabled()) {
612                 logger.debug("deletePermission: delete permission id="
613                         + permId + " status=" + statusCode);
614             }
615             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
616                     invalidStatusCodeMessage(testRequestType, statusCode));
617             Assert.assertEquals(statusCode, testExpectedStatusCode);
618
619         } finally {
620             if (res != null) {
621                 res.close();
622             }
623         }
624     }
625
626     /**
627      * Creates the role.
628      *
629      * @param roleName the role name
630      * @return the string
631      */
632     private String createRole(String roleName) {
633         setupCreate();
634         RoleClient roleClient = new RoleClient();
635
636         Role role = RoleFactory.createRoleInstance(roleName,
637                         roleName, //the display name
638                 "role for " + roleName, true);
639         role.setRoleGroup("something");
640         Response res = null;
641         String id = null;
642         try {
643             res = roleClient.create(role);
644             int statusCode = res.getStatus();
645             if (logger.isDebugEnabled()) {
646                 logger.debug("createRole: name=" + roleName
647                         + " status = " + statusCode);
648             }
649             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
650                     invalidStatusCodeMessage(testRequestType, statusCode));
651             Assert.assertEquals(statusCode, testExpectedStatusCode);
652             id = extractId(res);
653         } finally {
654             if (res != null) {
655                 res.close();
656             }
657         }
658         return id;
659     }
660
661     /**
662      * Delete role.
663      *
664      * @param roleId the role id
665      */
666     private void deleteRole(String roleId) {
667         setupDelete();
668         RoleClient roleClient = new RoleClient();
669         Response res = null;
670         try {
671             res = roleClient.delete(roleId);
672             int statusCode = res.getStatus();
673             if (logger.isDebugEnabled()) {
674                 logger.debug("deleteRole: delete role id=" + roleId
675                         + " status=" + statusCode);
676             }
677             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
678                     invalidStatusCodeMessage(testRequestType, statusCode));
679             Assert.assertEquals(statusCode, testExpectedStatusCode);
680         } finally {
681             res.close();
682         }
683
684     }
685
686         @Override
687         protected PermissionRole createInstance(String commonPartName,
688                         String identifier) {
689                 // TODO Auto-generated method stub
690                 return null;
691         }
692
693         @Override
694         protected PermissionRole updateInstance(PermissionRole commonPartObject) {
695                 // TODO Auto-generated method stub
696                 return null;
697         }
698
699         @Override
700         protected void compareUpdatedInstances(PermissionRole original,
701                         PermissionRole updated) throws Exception {
702                 // TODO Auto-generated method stub
703                 
704         }
705
706         @Override
707         protected Class<PermissionRole> getCommonListType() {
708                 // TODO Auto-generated method stub
709                 return null;
710         }
711
712     @Override
713     protected String getKnowResourceId() {
714         return roleValues.get(getRoleName()).getRoleId();
715     }
716         
717         @Override
718         protected long getSizeOfList(PermissionRole permRole) {
719                 // TODO Auto-generated method stub
720                 throw new UnsupportedOperationException("Method getSizeOfList() is not implemented because this service does not support lists.");
721         }
722     
723     /*
724      * For convenience and terseness, this test method is the base of the test execution dependency chain.  Other test methods may
725      * refer to this method in their @Test annotation declarations.
726      */
727     @Override
728     @Test(dataProvider = "testName",
729                 dependsOnMethods = {
730                         "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})    
731     public void CRUDTests(String testName) {
732         // Do nothing.  Simply here to for a TestNG execution order for our tests
733     }
734 }