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