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
15 * https://source.collectionspace.org/collection-space/LICENSE.txt
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 permissions and
21 * limitations under the License.
23 package org.collectionspace.services.authorization.client.test;
25 //import java.util.ArrayList;
26 //import java.util.List;
27 import javax.ws.rs.core.Response;
29 import org.collectionspace.services.client.CollectionSpaceClient;
30 import org.collectionspace.services.client.RoleClient;
31 import org.collectionspace.services.authorization.Role;
32 import org.collectionspace.services.authorization.RolesList;
33 import org.collectionspace.services.client.RoleFactory;
34 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
35 import org.collectionspace.services.client.test.ServiceRequestType;
36 import org.collectionspace.services.jaxb.AbstractCommonList;
37 import org.jboss.resteasy.client.ClientResponse;
39 import org.testng.Assert;
40 import org.testng.annotations.Test;
42 import org.slf4j.Logger;
43 import org.slf4j.LoggerFactory;
46 * RoleServiceTest, carries out tests against a
47 * deployed and running Role Service.
49 * $LastChangedRevision: 917 $
50 * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $
52 public class RoleServiceTest extends AbstractServiceTestImpl {
55 private final static String CLASS_NAME = RoleServiceTest.class.getName();
56 private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
58 // Instance variables specific to this test.
59 /** The known resource id. */
60 private String knownResourceId = null;
61 private String knownRoleName = "ROLE_USERS_TEST";
62 private String verifyResourceId = null;
63 private String verifyRoleName = "collections_manager_test";
64 // private List<String> allResourceIdsCreated = new ArrayList<String>();
67 * This method is called only by the parent class, AbstractServiceTestImpl
71 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
74 protected String getServicePathComponent() {
75 return new RoleClient().getServicePathComponent();
79 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
82 protected CollectionSpaceClient getClientInstance() {
83 return new RoleClient();
87 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
90 protected AbstractCommonList getAbstractCommonList(
91 ClientResponse<AbstractCommonList> response) {
92 //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
93 throw new UnsupportedOperationException();
97 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readPaginatedList(java.lang.String)
99 @Test(dataProvider = "testName")
101 public void readPaginatedList(String testName) throws Exception {
102 //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
105 // ---------------------------------------------------------------
106 // CRUD tests : CREATE tests
107 // ---------------------------------------------------------------
110 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
113 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
114 public void create(String testName) throws Exception {
116 if (logger.isDebugEnabled()) {
117 logger.debug(testBanner(testName, CLASS_NAME));
119 // Perform setup, such as initializing the type of service request
120 // (e.g. CREATE, DELETE), its valid and expected status codes, and
121 // its associated HTTP method name (e.g. POST, DELETE).
124 // Submit the request to the service and store the response.
125 RoleClient client = new RoleClient();
126 Role role = createRoleInstance(knownRoleName,
127 "all users are required to be in this role",
129 ClientResponse<Response> res = client.create(role);
130 int statusCode = res.getStatus();
132 // Check the status code of the response: does it match
133 // the expected response(s)?
136 // Does it fall within the set of valid status codes?
137 // Does it exactly match the expected status code?
138 if (logger.isDebugEnabled()) {
139 logger.debug(testName + ": status = " + statusCode);
141 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
142 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
143 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
145 // Store the ID returned from this create operation
146 // for additional tests below.
147 knownResourceId = extractId(res);
148 if (logger.isDebugEnabled()) {
149 logger.debug(testName + ": knownResourceId=" + knownResourceId);
154 * Creates the for unique role.
156 * @param testName the test name
157 * @throws Exception the exception
159 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
160 dependsOnMethods = {"create"})
161 public void createForUniqueRole(String testName) throws Exception {
163 if (logger.isDebugEnabled()) {
164 logger.debug(testBanner(testName, CLASS_NAME));
168 // Submit the request to the service and store the response.
169 RoleClient client = new RoleClient();
170 Role role = createRoleInstance(knownRoleName,
173 ClientResponse<Response> res = client.create(role);
174 int statusCode = res.getStatus();
176 if (logger.isDebugEnabled()) {
177 logger.debug(testName + ": status = " + statusCode);
179 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
180 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
181 Assert.assertEquals(statusCode, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
185 * Creates the without role name.
187 * @param testName the test name
188 * @throws Exception the exception
190 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
191 dependsOnMethods = {"create"})
192 public void createWithoutRoleName(String testName) throws Exception {
194 if (logger.isDebugEnabled()) {
195 logger.debug(testBanner(testName, CLASS_NAME));
199 // Submit the request to the service and store the response.
200 RoleClient client = new RoleClient();
201 Role role = createRoleInstance("",
204 ClientResponse<Response> res = client.create(role);
205 int statusCode = res.getStatus();
206 // Does it exactly match the expected status code?
207 if (logger.isDebugEnabled()) {
208 logger.debug(testName + ": status = " + statusCode);
210 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
211 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
212 Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
215 //to not cause uniqueness violation for role, createList is removed
217 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
220 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
221 dependsOnMethods = {"create"})
222 public void createList(String testName) throws Exception {
224 if (logger.isDebugEnabled()) {
225 logger.debug(testBanner(testName, CLASS_NAME));
229 // Submit the request to the service and store the response.
230 RoleClient client = new RoleClient();
231 //create a role with lowercase role name without role prefix
232 //the service should make it upper case and add the role prefix
233 Role role1 = createRoleInstance(verifyRoleName,
234 "collection manager",
236 ClientResponse<Response> res = client.create(role1);
237 int statusCode = res.getStatus();
238 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
239 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
240 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
241 verifyResourceId = extractId(res);
242 allResourceIdsCreated.add(verifyResourceId);
244 Role role2 = createRoleInstance("ROLE_COLLECTIONS_CURATOR_TEST",
245 "collections curator",
247 res = client.create(role2);
248 statusCode = res.getStatus();
249 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
250 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
251 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
252 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
253 allResourceIdsCreated.add(extractId(res));
255 Role role3 = createRoleInstance("ROLE_MOVINGIMAGE_ADMIN_TEST",
256 "moving image admin",
258 res = client.create(role3);
259 statusCode = res.getStatus();
260 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
261 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
262 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
263 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
264 allResourceIdsCreated.add(extractId(res));
268 // Placeholders until the three tests below can be uncommented.
269 // See Issue CSPACE-401.
271 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
274 public void createWithEmptyEntityBody(String testName) throws Exception {
275 //FIXME: Should this test really be empty? If so, please comment accordingly.
279 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
282 public void createWithMalformedXml(String testName) throws Exception {
283 //FIXME: Should this test really be empty? If so, please comment accordingly.
287 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
290 public void createWithWrongXmlSchema(String testName) throws Exception {
291 //FIXME: Should this test really be empty? If so, please comment accordingly.
294 // ---------------------------------------------------------------
295 // CRUD tests : READ tests
296 // ---------------------------------------------------------------
299 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
302 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
303 dependsOnMethods = {"createForUniqueRole"})
304 public void read(String testName) throws Exception {
306 if (logger.isDebugEnabled()) {
307 logger.debug(testBanner(testName, CLASS_NAME));
312 // Submit the request to the service and store the response.
313 RoleClient client = new RoleClient();
314 ClientResponse<Role> res = client.read(knownResourceId);
315 int statusCode = res.getStatus();
317 // Check the status code of the response: does it match
318 // the expected response(s)?
319 if (logger.isDebugEnabled()) {
320 logger.debug(testName + ": status = " + statusCode);
322 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
323 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
324 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
326 Role output = (Role) res.getEntity();
327 Assert.assertNotNull(output);
330 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
331 dependsOnMethods = {"createList"})
332 public void readToVerify(String testName) throws Exception {
337 // Submit the request to the service and store the response.
338 RoleClient client = new RoleClient();
339 ClientResponse<Role> res = client.read(verifyResourceId);
340 int statusCode = res.getStatus();
342 // Check the status code of the response: does it match
343 // the expected response(s)?
344 if (logger.isDebugEnabled()) {
345 logger.debug(testName + ": status = " + statusCode);
347 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
348 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
349 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
351 Role output = (Role) res.getEntity();
352 Assert.assertNotNull(output);
354 //FIXME: Tenant ID of "1" should not be hard coded
355 String roleNameToVerify = "ROLE_" + "1_" + verifyRoleName.toUpperCase();
356 Assert.assertEquals(output.getRoleName(), roleNameToVerify,
357 "RoleName fix did not work!");
361 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
365 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
366 dependsOnMethods = {"read"})
367 public void readNonExistent(String testName) throws Exception {
369 if (logger.isDebugEnabled()) {
370 logger.debug(testBanner(testName, CLASS_NAME));
373 setupReadNonExistent();
375 // Submit the request to the service and store the response.
376 RoleClient client = new RoleClient();
377 ClientResponse<Role> res = client.read(NON_EXISTENT_ID);
378 int statusCode = res.getStatus();
380 // Check the status code of the response: does it match
381 // the expected response(s)?
382 if (logger.isDebugEnabled()) {
383 logger.debug(testName + ": status = " + statusCode);
385 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
386 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
387 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
390 // ---------------------------------------------------------------
391 // CRUD tests : READ_LIST tests
392 // ---------------------------------------------------------------
395 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
398 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
399 dependsOnMethods = {"createList", "read"})
400 public void readList(String testName) throws Exception {
402 if (logger.isDebugEnabled()) {
403 logger.debug(testBanner(testName, CLASS_NAME));
408 // Submit the request to the service and store the response.
409 RoleClient client = new RoleClient();
410 ClientResponse<RolesList> res = client.readList();
411 RolesList list = res.getEntity();
412 int statusCode = res.getStatus();
414 // Check the status code of the response: does it match
415 // the expected response(s)?
416 if (logger.isDebugEnabled()) {
417 logger.debug(testName + ": status = " + statusCode);
419 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
420 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
421 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
423 // Optionally output additional data about list members for debugging.
424 boolean iterateThroughList = true;
425 if (iterateThroughList && logger.isDebugEnabled()) {
426 printList(testName, list);
433 * @param testName the test name
434 * @throws Exception the exception
436 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
437 dependsOnMethods = {"createList", "read"})
438 public void searchRoleName(String testName) throws Exception {
440 if (logger.isDebugEnabled()) {
441 logger.debug(testBanner(testName, CLASS_NAME));
446 // Submit the request to the service and store the response.
447 RoleClient client = new RoleClient();
448 ClientResponse<RolesList> res = client.readSearchList("movingImage");
449 RolesList list = res.getEntity();
450 int statusCode = res.getStatus();
451 // Check the status code of the response: does it match
452 // the expected response(s)?
453 if (logger.isDebugEnabled()) {
454 logger.debug(testName + ": status = " + statusCode);
456 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
457 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
458 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
459 int EXPECTED_ITEMS = 1;
460 if (logger.isDebugEnabled()) {
461 logger.debug(testName + ": received = " + list.getRoles().size()
462 + " expected=" + EXPECTED_ITEMS);
464 Assert.assertEquals(EXPECTED_ITEMS, list.getRoles().size());
465 // Optionally output additional data about list members for debugging.
466 boolean iterateThroughList = true;
467 if (iterateThroughList && logger.isDebugEnabled()) {
468 printList(testName, list);
474 // ---------------------------------------------------------------
475 // CRUD tests : UPDATE tests
476 // ---------------------------------------------------------------
479 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
482 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
483 dependsOnMethods = {"read", "readList", "readNonExistent"})
484 public void update(String testName) throws Exception {
486 if (logger.isDebugEnabled()) {
487 logger.debug(testBanner(testName, CLASS_NAME));
492 Role roleToUpdate = new Role();
493 roleToUpdate.setCsid(knownResourceId);
494 roleToUpdate.setRoleName(knownRoleName);
496 // Update the content of this resource.
497 roleToUpdate.setDescription("updated role description");
498 if (logger.isDebugEnabled()) {
499 logger.debug("updated object");
500 logger.debug(objectAsXmlString(roleToUpdate,
503 RoleClient client = new RoleClient();
504 // Submit the request to the service and store the response.
505 ClientResponse<Role> res = client.update(knownResourceId, roleToUpdate);
506 int statusCode = res.getStatus();
507 // Check the status code of the response: does it match the expected response(s)?
508 if (logger.isDebugEnabled()) {
509 logger.debug(testName + ": status = " + statusCode);
511 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
512 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
513 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
516 Role roleUpdated = (Role) res.getEntity();
517 Assert.assertNotNull(roleUpdated);
519 Assert.assertEquals(roleUpdated.getDescription(),
520 roleToUpdate.getDescription(),
521 "Data in updated object did not match submitted data.");
524 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
525 dependsOnMethods = {"read", "readList", "readNonExistent"})
526 public void updateNotAllowed(String testName) throws Exception {
531 Role roleToUpdate = new Role();
532 roleToUpdate.setCsid(knownResourceId);
533 // Update the content of this resource.
534 roleToUpdate.setRoleName("UPDATED-ROLE_USERS_TEST");
535 if (logger.isDebugEnabled()) {
536 logger.debug("updated object");
537 logger.debug(objectAsXmlString(roleToUpdate,
540 RoleClient client = new RoleClient();
541 // Submit the request to the service and store the response.
542 ClientResponse<Role> res = client.update(knownResourceId, roleToUpdate);
543 int statusCode = res.getStatus();
544 // Check the status code of the response: does it match the expected response(s)?
545 if (logger.isDebugEnabled()) {
546 logger.debug(testName + ": status = " + statusCode);
548 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
549 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
550 Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
555 // Placeholders until the three tests below can be uncommented.
556 // See Issue CSPACE-401.
558 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
561 public void updateWithEmptyEntityBody(String testName) throws Exception {
562 //FIXME: Should this test really be empty? If so, please comment accordingly.
566 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
569 public void updateWithMalformedXml(String testName) throws Exception {
570 //FIXME: Should this test really be empty? If so, please comment accordingly.
574 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
577 public void updateWithWrongXmlSchema(String testName) throws Exception {
578 //FIXME: Should this test really be empty? If so, please comment accordingly.
582 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
585 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
586 dependsOnMethods = {"readNonExistent", "testSubmitRequest"})
587 public void updateNonExistent(String testName) throws Exception {
589 if (logger.isDebugEnabled()) {
590 logger.debug(testBanner(testName, CLASS_NAME));
593 setupUpdateNonExistent();
595 // Submit the request to the service and store the response.
597 // Note: The ID used in this 'create' call may be arbitrary.
598 // The only relevant ID may be the one used in updateRole(), below.
599 RoleClient client = new RoleClient();
600 Role role = createRoleInstance("ROLE_XXX",
603 ClientResponse<Role> res =
604 client.update(NON_EXISTENT_ID, role);
605 int statusCode = res.getStatus();
607 // Check the status code of the response: does it match
608 // the expected response(s)?
609 if (logger.isDebugEnabled()) {
610 logger.debug(testName + ": status = " + statusCode);
612 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
613 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
614 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
617 // ---------------------------------------------------------------
618 // CRUD tests : DELETE tests
619 // ---------------------------------------------------------------
622 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
625 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
626 dependsOnMethods = {"updateNotAllowed", "testSubmitRequest"})
627 public void delete(String testName) throws Exception {
629 if (logger.isDebugEnabled()) {
630 logger.debug(testBanner(testName, CLASS_NAME));
635 // Submit the request to the service and store the response.
636 RoleClient client = new RoleClient();
637 ClientResponse<Response> res = client.delete(knownResourceId);
638 int statusCode = res.getStatus();
640 // Check the status code of the response: does it match
641 // the expected response(s)?
642 if (logger.isDebugEnabled()) {
643 logger.debug(testName + ": status = " + statusCode);
645 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
646 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
647 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
652 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
655 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
656 dependsOnMethods = {"delete"})
657 public void deleteNonExistent(String testName) throws Exception {
659 if (logger.isDebugEnabled()) {
660 logger.debug(testBanner(testName, CLASS_NAME));
663 setupDeleteNonExistent();
665 // Submit the request to the service and store the response.
666 RoleClient client = new RoleClient();
667 ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
668 int statusCode = res.getStatus();
670 // Check the status code of the response: does it match
671 // the expected response(s)?
672 if (logger.isDebugEnabled()) {
673 logger.debug(testName + ": status = " + statusCode);
675 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
676 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
677 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
680 // ---------------------------------------------------------------
681 // Utility tests : tests of code used in tests above
682 // ---------------------------------------------------------------
684 * Tests the code for manually submitting data that is used by several
685 * of the methods above.
689 @Test(dependsOnMethods = {"create"})
690 public void testSubmitRequest() throws Exception {
692 // Expected status code: 200 OK
693 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
695 // Submit the request to the service and store the response.
696 String method = ServiceRequestType.READ.httpMethodName();
697 String url = getResourceURL(knownResourceId);
698 int statusCode = submitRequest(method, url);
700 // Check the status code of the response: does it match
701 // the expected response(s)?
702 if (logger.isDebugEnabled()) {
703 logger.debug("testSubmitRequest: url=" + url
704 + " status=" + statusCode);
706 Assert.assertEquals(statusCode, EXPECTED_STATUS);
710 // ---------------------------------------------------------------
711 // Utility methods used by tests above
712 // ---------------------------------------------------------------
714 * create role instance
720 public Role createRoleInstance(String roleName,
722 boolean useRoleName) {
724 Role role = RoleFactory.createRoleInstance(roleName, description,
726 if (logger.isDebugEnabled()) {
727 logger.debug("to be created, role");
728 logger.debug(objectAsXmlString(role, Role.class));
737 * @param testName the test name
738 * @param list the list
741 private int printList(String testName, RolesList list) {
745 for (Role role : list.getRoles()) {
746 logger.debug(testName + " role csid=" + role.getCsid()
747 + " name=" + role.getRoleName()
748 + " desc=" + role.getDescription());