]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-1911: 'Banners' output between Services client tests now properly show calling...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 28 May 2010 23:52:22 +0000 (23:52 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 28 May 2010 23:52:22 +0000 (23:52 +0000)
35 files changed:
services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountRoleServiceTest.java
services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java
services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java
services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java
services/authorization-mgt/client/src/test/java/org/collectionspace/services/authorization/client/test/PermissionRoleServiceTest.java
services/authorization-mgt/client/src/test/java/org/collectionspace/services/authorization/client/test/PermissionServiceTest.java
services/authorization-mgt/client/src/test/java/org/collectionspace/services/authorization/client/test/RolePermissionServiceTest.java
services/authorization-mgt/client/src/test/java/org/collectionspace/services/authorization/client/test/RoleServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java
services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java
services/common-test/src/test/java/org/collectionspace/services/client/test/ServiceLayerTest.java
services/contact/client/src/test/java/org/collectionspace/services/client/test/ContactServiceTest.java
services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java
services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java
services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutServiceTest.java
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java
services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementServiceTest.java
services/note/client/src/test/java/org/collectionspace/services/client/test/NoteServiceTest.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthoritySearchTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/security/client/src/test/java/org/collectionspace/services/security/client/test/AuthenticationServiceTest.java
services/security/client/src/test/java/org/collectionspace/services/security/client/test/AuthorizationServiceTest.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java

index 453ed93a97c7550b796620f869eec7c2bd5c2588..e18c9ab3343804e3f4ddd36fbc988fdd2febb502 100644 (file)
@@ -64,8 +64,9 @@ import org.testng.annotations.BeforeClass;
 public class AccountRoleServiceTest extends AbstractServiceTestImpl {
 
     /** The Constant logger. */
-    static private final Logger logger =
-            LoggerFactory.getLogger(AccountRoleServiceTest.class);
+    private final static String CLASS_NAME = AccountRoleServiceTest.class.getName();
+    private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -172,10 +173,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            testBanner(testName, CLASS_NAME);
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountValue pv = accValues.get("acc-role-user1");
@@ -255,8 +259,12 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            testBanner(testName, CLASS_NAME);
+        }
+        
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
@@ -288,8 +296,12 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            testBanner(testName, CLASS_NAME);
+        }
+        
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
@@ -387,8 +399,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
     public void delete(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            testBanner(testName, CLASS_NAME);
+        }
+        
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
@@ -482,7 +499,8 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @AfterClass(alwaysRun = true)
     @Override
     public void cleanUp() {
-        setupDelete("cleanUp");
+        
+        setupDelete();
 
         String noTest = System.getProperty("noTestCleanup");
        if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
@@ -529,7 +547,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createAccount(String userName, String email) {
-        setupCreate("createAccount");
+        
+        if (logger.isDebugEnabled()) {
+            testBanner("createAccount");
+        }
+        
+        setupCreate();
+        
         AccountClient accClient = new AccountClient();
         AccountsCommon account = AccountFactory.createAccountInstance(
                 userName, userName, userName, email,
@@ -553,7 +577,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
      * @param accId the acc id
      */
     private void deleteAccount(String accId) {
-        setupDelete("deleteAccount");
+        
+        if (logger.isDebugEnabled()) {
+            testBanner("deleteAccount");
+        }
+        
+        setupDelete();
+        
         AccountClient accClient = new AccountClient();
         ClientResponse<Response> res = accClient.delete(accId);
         int statusCode = res.getStatus();
@@ -577,7 +607,10 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createRole(String roleName) {
-        setupCreate("createRole");
+        if (logger.isDebugEnabled()) {
+            testBanner("createRole");
+        }
+        setupCreate();
         RoleClient roleClient = new RoleClient();
 
         Role role = RoleFactory.createRoleInstance(roleName,
@@ -601,7 +634,10 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
      * @param roleId the role id
      */
     private void deleteRole(String roleId) {
-        setupDelete("deleteRole");
+        if (logger.isDebugEnabled()) {
+            testBanner("deleteRole");
+        }
+        setupDelete();
         RoleClient roleClient = new RoleClient();
         ClientResponse<Response> res = roleClient.delete(roleId);
         int statusCode = res.getStatus();
index 123230c00e55d3f94d5814303f629bd9973ed28a..94ed4c9a65a5419802d0915b849db47a36c8886f 100644 (file)
@@ -54,8 +54,9 @@ import org.testng.annotations.AfterClass;
 public class AccountServiceTest extends AbstractServiceTestImpl {
 
     /** The Constant logger. */
-    static private final Logger logger =
-            LoggerFactory.getLogger(AccountServiceTest.class);
+    private final String CLASS_NAME = AccountServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -112,10 +113,13 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -156,7 +160,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createForUniqueUser(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -183,7 +190,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithInvalidTenant(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -212,7 +222,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithoutUser(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -240,7 +253,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithInvalidEmail(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -268,7 +284,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithoutScreenName(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -296,7 +315,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithInvalidPassword(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -324,7 +346,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithMostInvalid(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountsCommon account =
@@ -351,7 +376,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createList(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         // Submit the request to the service and store the response.
         AccountsCommon account1 =
                 createAccountInstance("curious", "curious", "hithere08", "curious@george.com",
@@ -426,8 +454,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -456,8 +487,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -486,8 +520,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -521,8 +558,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchScreenName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -557,8 +597,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchUserId(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -593,8 +636,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchEmail(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -629,8 +675,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchScreenNameEmail(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -669,8 +718,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         AccountClient client = new AccountClient();
         ClientResponse<AccountsCommon> res = client.read(knownResourceId);
@@ -727,8 +779,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"update"})
     public void updatePassword(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         AccountClient client = new AccountClient();
         ClientResponse<AccountsCommon> res = client.read(knownResourceId);
@@ -786,8 +841,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"update"})
     public void updatePasswordWithoutUser(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         AccountsCommon accountToUpdate = new AccountsCommon();
         accountToUpdate.setCsid(knownResourceId);
@@ -824,8 +882,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"update"})
     public void updateInvalidPassword(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
         AccountClient client = new AccountClient();
         ClientResponse<AccountsCommon> res = client.read(knownResourceId);
         if (logger.isDebugEnabled()) {
@@ -874,8 +935,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"updatePasswordWithoutUser"})
     public void deactivate(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         AccountClient client = new AccountClient();
         ClientResponse<AccountsCommon> res = client.read(knownResourceId);
@@ -957,8 +1021,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"deactivate", "readNonExistent", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         //
@@ -992,7 +1059,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"deactivate", "readNonExistent", "testSubmitRequest"})
     public void updateWrongUser(String testName) throws Exception {
 
-        setupUpdate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupUpdate();
 
         // Submit the request to the service and store the response.
         //
@@ -1044,8 +1114,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"testSubmitRequest", "updateWrongUser"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -1071,8 +1144,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
@@ -1100,8 +1176,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     @Test(dependsOnMethods = {"create", "read"})
     public void testSubmitRequest() throws Exception {
 
-        // Expected status code: 200 OK
-        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
+        setupRead();
 
         // Submit the request to the service and store the response.
         String method = ServiceRequestType.READ.httpMethodName();
@@ -1114,7 +1189,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
             logger.debug("testSubmitRequest: url=" + url
                     + " status=" + statusCode);
         }
-        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
 
     }
 
index d89c2630a05eebd1c1013b5440912c8922774db8..b8103304bfc09cb0c46fc3aa7870b026e9f41eb8 100644 (file)
@@ -61,8 +61,8 @@ import org.slf4j.LoggerFactory;
  */
 public class AcquisitionAuthRefsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(AcquisitionAuthRefsTest.class);
+    private final String CLASS_NAME = AcquisitionAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "acquisitions";
@@ -104,7 +104,12 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
+        // Perform setup.
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -200,9 +205,13 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
-
+        testSetup(STATUS_OK, ServiceRequestType.READ);
+        
         // Submit the request to the service and store the response.
         AcquisitionClient acquisitionClient = new AcquisitionClient();
         ClientResponse<MultipartInput> res = acquisitionClient.read(knownResourceId);
index d00cead9f844f51a68b54ef44bc591b917d0e930..81cc31267d2b0dcfb652638304b90e4d4fdfb3c1 100644 (file)
@@ -54,8 +54,8 @@ import org.slf4j.LoggerFactory;
 public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-        LoggerFactory.getLogger(AcquisitionServiceTest.class);
+    private final String CLASS_NAME = AcquisitionServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     /** The known resource id. */
@@ -89,10 +89,14 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -175,49 +179,57 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithMalformedXml();
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+            
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
-    public void createWithWrongXmlSchema() throws Exception {
+    public void createWithWrongXmlSchema(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithWrongXmlSchema();
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -233,8 +245,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         AcquisitionClient client = new AcquisitionClient();
 
@@ -267,8 +283,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         AcquisitionClient client = new AcquisitionClient();
@@ -297,8 +317,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         AcquisitionClient client = new AcquisitionClient();
@@ -355,8 +379,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         AcquisitionClient client = new AcquisitionClient();
@@ -442,50 +470,58 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
     
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        (testName + ": url=" + url + " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
-    }
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+            
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            (testName + ": url=" + url + " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        }
 
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
-    public void createWithEmptyEntityBody() throws Exception {
+    public void createWithEmptyEntityBody(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -493,48 +529,56 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
     @Test(dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) {
     
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
     
@@ -546,8 +590,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -580,8 +628,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "read", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         AcquisitionClient client = new AcquisitionClient();
@@ -607,8 +659,12 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
+        
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         AcquisitionClient client = new AcquisitionClient();
@@ -631,13 +687,14 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
     /**
      * Tests the code for manually submitting data that is used by several
      * of the methods above.
+     * 
      * @throws Exception 
      */
     @Test(dependsOnMethods = {"create", "read"})
     public void testSubmitRequest() throws Exception {
 
-        // Expected status code: 200 OK
-        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
+        // Perform setup.
+        setupRead();
 
         // Submit the request to the service and store the response.
         String method = ServiceRequestType.READ.httpMethodName();
@@ -650,7 +707,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
             logger.debug("testSubmitRequest: url=" + url +
                 " status=" + statusCode);
         }
-        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
 
     }
 
@@ -694,3 +751,4 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         return multipart;
     }
 }
+
index 5aae52668287770e5b33783d3292eed010a40a38..00e3d04214a5747a1a55f3c4fc540b4c4a65b2e2 100644 (file)
@@ -65,8 +65,9 @@ import org.testng.annotations.BeforeClass;
 public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
 
     /** The Constant logger. */
-    static private final Logger logger =
-            LoggerFactory.getLogger(PermissionRoleServiceTest.class);
+    private final static String CLASS_NAME = PermissionRoleServiceTest.class.getName();
+    private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -169,10 +170,14 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         PermissionValue pv = permValues.get(TEST_SERVICE_NAME + TEST_MARKER);
@@ -255,8 +260,11 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
@@ -293,8 +301,11 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
@@ -397,8 +408,11 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
@@ -497,7 +511,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
     @AfterClass(alwaysRun = true)
     @Override
     public void cleanUp() {
-        setupDelete("cleanUp");
+        setupDelete();
         String noTest = System.getProperty("noTestCleanup");
         if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
             if (logger.isDebugEnabled()) {
@@ -543,7 +557,10 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createPermission(String resName, EffectType effect) {
-        setupCreate("createPermission");
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner("createPermission"));
+        }
+        setupCreate();
         PermissionClient permClient = new PermissionClient();
         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
         Permission permission = PermissionFactory.createPermissionInstance(resName,
@@ -577,7 +594,10 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
      * @param permId the perm id
      */
     private void deletePermission(String permId) {
-        setupDelete("deletePermission");
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner("deletePermission"));
+        }
+        setupDelete();
         PermissionClient permClient = new PermissionClient();
         ClientResponse<Response> res = null;
         try {
@@ -603,7 +623,10 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createRole(String roleName) {
-        setupCreate("createRole");
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner("createRole"));
+        }
+        setupCreate();
         RoleClient roleClient = new RoleClient();
 
         Role role = RoleFactory.createRoleInstance(roleName,
@@ -634,7 +657,10 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
      * @param roleId the role id
      */
     private void deleteRole(String roleId) {
-        setupDelete("deleteRole");
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner("deleteRole"));
+        }
+        setupDelete();
         RoleClient roleClient = new RoleClient();
         ClientResponse<Response> res = null;
         try {
index 8cfb9964c8f07354a4150b89cf4211f0184b441e..e70def7c718f5dcbd4c1f5b332ef782f403c0f18 100644 (file)
@@ -55,8 +55,9 @@ import org.slf4j.LoggerFactory;
 public class PermissionServiceTest extends AbstractServiceTestImpl {
 
     /** The Constant logger. */
-    static private final Logger logger =
-            LoggerFactory.getLogger(PermissionServiceTest.class);
+    private final static String CLASS_NAME = PermissionServiceTest.class.getName();
+    private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -113,10 +114,13 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
@@ -162,7 +166,10 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithoutResourceName(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
@@ -194,7 +201,10 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createList(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         // Submit the request to the service and store the response.
         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
         Permission permission1 = createPermissionInstance("test-objects",
@@ -280,8 +290,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
@@ -310,8 +323,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
@@ -340,8 +356,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
@@ -375,8 +394,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchResourceName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
@@ -418,8 +440,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         Permission permToUpdate = new Permission();
         permToUpdate.setCsid(knownResourceId);
@@ -457,7 +482,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     public void updateNotAllowed(String testName) throws Exception {
 
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         Permission permToUpdate = new Permission();
         permToUpdate.setCsid(knownResourceId);
@@ -492,8 +517,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"updateNotAllowed"})
     public void updateActions(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         Permission permToUpdate = new Permission();
         permToUpdate.setCsid(knownResourceId);
@@ -572,8 +600,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"readNonExistent", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         //
@@ -614,8 +645,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"updateActions", "testSubmitRequest"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
@@ -641,8 +675,11 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
index 893005232e7431708f14cb6d05a284a546f209bd..f40dc0c3655c89dd33df47cfcef5fc14e3b5b0ff 100644 (file)
@@ -65,8 +65,9 @@ import org.testng.annotations.BeforeClass;
 public class RolePermissionServiceTest extends AbstractServiceTestImpl {
 
     /** The Constant logger. */
-    static private final Logger logger =
-            LoggerFactory.getLogger(RolePermissionServiceTest.class);
+    private final static String CLASS_NAME = RolePermissionServiceTest.class.getName();
+    private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -156,10 +157,13 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RoleValue rv = roleValues.get(TEST_ROLE_NAME + TEST_MARKER);
@@ -242,8 +246,11 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
@@ -279,8 +286,11 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
@@ -384,8 +394,11 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        };
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
@@ -483,7 +496,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
     @AfterClass(alwaysRun = true)
     @Override
     public void cleanUp() {
-        setupDelete("cleanUp");
+        setupDelete();
         String noTest = System.getProperty("noTestCleanup");
         if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
             if (logger.isDebugEnabled()) {
@@ -529,7 +542,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createPermission(String resName, EffectType effect) {
-        setupCreate("createPermission");
+        setupCreate();
         PermissionClient permClient = new PermissionClient();
         List<PermissionAction> actions = PermissionFactory.createDefaultActions();
         Permission permission = PermissionFactory.createPermissionInstance(resName,
@@ -562,7 +575,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
      * @param permId the perm id
      */
     private void deletePermission(String permId) {
-        setupDelete("deletePermission");
+        setupDelete();
         PermissionClient permClient = new PermissionClient();
 
         ClientResponse<Response> res = null;
@@ -591,7 +604,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
      * @return the string
      */
     private String createRole(String roleName) {
-        setupCreate("createRole");
+        setupCreate();
         RoleClient roleClient = new RoleClient();
 
         Role role = RoleFactory.createRoleInstance(roleName,
@@ -623,7 +636,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl {
      * @param roleId the role id
      */
     private void deleteRole(String roleId) {
-        setupDelete("deleteRole");
+        setupDelete();
         RoleClient roleClient = new RoleClient();
         ClientResponse<Response> res = null;
         try {
index abaceb7767faaa0ca776ef9c5cd43f37a0e95176..9818eda81fa25e590fca0addb241b50921a83eb8 100644 (file)
@@ -52,8 +52,9 @@ import org.slf4j.LoggerFactory;
 public class RoleServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-            LoggerFactory.getLogger(RoleServiceTest.class);
+    private final static String CLASS_NAME = RoleServiceTest.class.getName();
+    private final static Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -113,10 +114,13 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -157,7 +161,10 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createForUniqueRole(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -185,7 +192,10 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createWithoutRoleName(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -212,7 +222,10 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void createList(String testName) throws Exception {
 
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -291,8 +304,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -317,7 +333,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     public void readToVerify(String testName) throws Exception {
 
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -350,8 +366,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -380,8 +399,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -415,8 +437,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void searchRoleName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -458,8 +483,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         Role roleToUpdate = new Role();
         roleToUpdate.setCsid(knownResourceId);
@@ -498,7 +526,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     public void updateNotAllowed(String testName) throws Exception {
 
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         Role roleToUpdate = new Role();
         roleToUpdate.setCsid(knownResourceId);
@@ -558,8 +586,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"readNonExistent", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         //
@@ -595,8 +626,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"updateNotAllowed", "testSubmitRequest"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
@@ -622,8 +656,11 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
index c4dfb7efa576557daa1081fa3c8a545ad12c2237..8121204252de0b74ca2f4a05e401266c2d6825ce 100644 (file)
@@ -26,8 +26,6 @@ package org.collectionspace.services.client.test;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.ws.rs.core.Response;
-
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.jboss.resteasy.client.ClientResponse;
@@ -91,25 +89,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up create tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupCreate(String testName) {
-        setupCreate(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up create tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupCreate(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+    protected void setupCreate() {
+        EXPECTED_STATUS_CODE = STATUS_CREATED;
         REQUEST_TYPE = ServiceRequestType.CREATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     /* (non-Javadoc)
@@ -132,25 +116,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up create tests with empty entity body.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupCreateWithEmptyEntityBody(String testName) {
-        setupCreateWithEmptyEntityBody(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up create tests with empty entity body.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupCreateWithEmptyEntityBody(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupCreateWithEmptyEntityBody() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.CREATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     /* (non-Javadoc)
@@ -161,25 +131,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up create tests with malformed xml.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupCreateWithMalformedXml(String testName) {
-        setupCreateWithMalformedXml(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up create tests with malformed xml.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupCreateWithMalformedXml(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupCreateWithMalformedXml() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.CREATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     /* (non-Javadoc)
@@ -190,25 +146,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up create tests with wrong xml schema.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupCreateWithWrongXmlSchema(String testName) {
-        setupCreateWithWrongXmlSchema(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up create tests with wrong xml schema.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupCreateWithWrongXmlSchema(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupCreateWithWrongXmlSchema() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.CREATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // ---------------------------------------------------------------
@@ -225,25 +167,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up read tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupRead(String testName) {
-        setupRead(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up read tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupRead(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+    protected void setupRead() {
+        EXPECTED_STATUS_CODE = STATUS_OK;
         REQUEST_TYPE = ServiceRequestType.READ;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // Failure outcomes
@@ -256,25 +184,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up read non existent tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupReadNonExistent(String testName) {
-        setupReadNonExistent(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up read non existent tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupReadNonExistent(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.NOT_FOUND.getStatusCode();
+    protected void setupReadNonExistent() {
+        EXPECTED_STATUS_CODE = STATUS_NOT_FOUND;
         REQUEST_TYPE = ServiceRequestType.READ;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // ---------------------------------------------------------------
@@ -293,25 +207,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up read list tests.
-     *
-     * @param testName The name of the test being run.
      */
-    protected void setupReadList(String testName) {
-        setupReadList(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up read list tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
-     */
-    protected void setupReadList(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+    protected void setupReadList() {
+        EXPECTED_STATUS_CODE = STATUS_OK;
         REQUEST_TYPE = ServiceRequestType.READ_LIST;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // Failure outcomes
@@ -332,25 +232,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up update tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupUpdate(String testName) {
-        setupUpdate(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up update tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupUpdate(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+    protected void setupUpdate() {
+        EXPECTED_STATUS_CODE = STATUS_OK;
         REQUEST_TYPE = ServiceRequestType.UPDATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // Failure outcomes
@@ -363,25 +249,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up update tests with an empty entity body.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupUpdateWithEmptyEntityBody(String testName) {
-        setupUpdateWithEmptyEntityBody(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up update tests with an empty entity body.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupUpdateWithEmptyEntityBody(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupUpdateWithEmptyEntityBody() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.UPDATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     /* (non-Javadoc)
@@ -392,25 +264,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up update tests with malformed xml.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupUpdateWithMalformedXml(String testName) {
-        setupUpdateWithMalformedXml(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up update tests with malformed xml.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupUpdateWithMalformedXml(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupUpdateWithMalformedXml() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.UPDATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     /* (non-Javadoc)
@@ -421,25 +279,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up update tests with wrong xml schema.
-     *
-     * @param testName The name of the test being run.
      */
-    protected void setupUpdateWithWrongXmlSchema(String testName) {
-        setupUpdateWithWrongXmlSchema(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up update tests with wrong xml schema.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
-     */
-    protected void setupUpdateWithWrongXmlSchema(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
+    protected void setupUpdateWithWrongXmlSchema() {
+        EXPECTED_STATUS_CODE = STATUS_BAD_REQUEST;
         REQUEST_TYPE = ServiceRequestType.UPDATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
     
     /* (non-Javadoc)
@@ -448,27 +292,14 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
     @Override
     public abstract void updateNonExistent(String testName) throws Exception;
 
-    /**
-     * Sets up update non existent tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupUpdateNonExistent(String testName) {
-        setupUpdateNonExistent(testName, LOGGER_NULL);
-    }
 
     /**
      * Sets up update non existent tests
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupUpdateNonExistent(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.NOT_FOUND.getStatusCode();
+    protected void setupUpdateNonExistent() {
+        EXPECTED_STATUS_CODE = STATUS_NOT_FOUND;
         REQUEST_TYPE = ServiceRequestType.UPDATE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // ---------------------------------------------------------------
@@ -485,25 +316,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up delete tests.
-     *
-     * @param testName The name of the test being run.
      */
-    protected void setupDelete(String testName) {
-        setupDelete(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up delete tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
-     */
-    protected void setupDelete(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();
+    protected void setupDelete() {
+        EXPECTED_STATUS_CODE = STATUS_OK;
         REQUEST_TYPE = ServiceRequestType.DELETE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // Failure outcomes
@@ -516,25 +333,11 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
 
     /**
      * Sets up delete non existent tests.
-     *
-     * @param testName The name of the test being run.
-     */
-    protected void setupDeleteNonExistent(String testName) {
-        setupDeleteNonExistent(testName, LOGGER_NULL);
-    }
-
-    /**
-     * Sets up delete non existent tests.
-     *
-     * @param testName The name of the test being run.
-     *
-     * @param testLogger The logger to use within the current base class,
-     *     when generating log statements related to that test.
      */
-    protected void setupDeleteNonExistent(String testName, Logger testLogger) {
-        EXPECTED_STATUS_CODE = Response.Status.NOT_FOUND.getStatusCode();
+    protected void setupDeleteNonExistent() {
+        EXPECTED_STATUS_CODE = STATUS_NOT_FOUND;
         REQUEST_TYPE = ServiceRequestType.DELETE;
-        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE, testName, testLogger);
+        testSetup(EXPECTED_STATUS_CODE, REQUEST_TYPE);
     }
 
     // ---------------------------------------------------------------
@@ -669,7 +472,7 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
            dependsOnMethods = {"leafCreate"}) */
     public void readPaginatedList(String testName) throws Exception {
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
         CollectionSpaceClient client = this.getClientInstance();
 
         // Get the current total number of items.
index 256011ed1a8a314f6b19ea10f864eb280c3a7a06..920b63351b39afb9a27f19237343caf234c4f0cf 100644 (file)
@@ -89,17 +89,26 @@ public abstract class BaseServiceTest {
     protected static final String MALFORMED_XML_DATA = XML_DECLARATION\r
             + "<malformed_xml>wrong schema contents</malformed_xml";\r
     /** The wrong XML schema data. */\r
-    protected final String WRONG_XML_SCHEMA_DATA = XML_DECLARATION\r
+    protected static final String WRONG_XML_SCHEMA_DATA = XML_DECLARATION\r
             + "<wrong_schema>wrong schema contents</wrong_schema>";\r
     /** The null charset. */\r
-    final String NULL_CHARSET = null;\r
+    private static final String NULL_CHARSET = null;\r
 \r
-    protected final static String BANNER_SEPARATOR_LINE =\r
+    private static final String BANNER_SEPARATOR_LINE =\r
         "===================================================";\r
-    protected final static String BANNER_PREFIX =\r
+    private static final String BANNER_PREFIX =\r
         "\n" + BANNER_SEPARATOR_LINE + "\n";\r
-    protected final static String BANNER_SUFFIX =\r
+    private static final String BANNER_SUFFIX =\r
         "\n" + BANNER_SEPARATOR_LINE;\r
+    \r
+    protected static final int STATUS_BAD_REQUEST =\r
+        Response.Status.BAD_REQUEST.getStatusCode();\r
+    protected static final int STATUS_CREATED =\r
+        Response.Status.CREATED.getStatusCode();\r
+    protected static final int STATUS_NOT_FOUND =\r
+        Response.Status.NOT_FOUND.getStatusCode();\r
+    protected static final int STATUS_OK =\r
+        Response.Status.OK.getStatusCode();\r
 \r
     /**\r
      * Instantiates a new base service test.\r
@@ -160,67 +169,12 @@ public abstract class BaseServiceTest {
     }\r
 \r
     /**\r
-     * Initializes setup values for a given test, and prints a banner\r
+     * Initializes setup values for a given test.  Returns a banner\r
      * identifying the test being run, using the local logger for this class.\r
      *\r
      * @param expectedStatusCode  A status code expected to be returned in the response.\r
      *\r
      * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param testName The name of the test being run.\r
-     */\r
-    protected void testSetup(\r
-            int expectedStatusCode,\r
-            ServiceRequestType reqType,\r
-            String testName) {\r
-        testSetup(expectedStatusCode, reqType, testName, null);\r
-    }\r
-\r
-    /**\r
-     * Initializes setup values for a given test, and prints a banner\r
-     * identifying the test being run, using a specified logger.\r
-     *\r
-     * @param expectedStatusCode  A status code expected to be returned in the response.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
-     *\r
-     * @param testName The name of the test being run.\r
-     *\r
-     * @param testLogger An optional logger to use within the current base\r
-     *     class, when generating log statements related to that test.\r
-     *     If null, the logger of the current base class will be used.\r
-     */\r
-    protected void testSetup(\r
-            int expectedStatusCode,\r
-            ServiceRequestType reqType,\r
-            String testName,\r
-            Logger testLogger) {\r
-\r
-        testSetup(expectedStatusCode, reqType);\r
-\r
-        // Print a banner identifying the test being run.\r
-        //\r
-        // If an optional logger has been provided, such as by a\r
-        // calling class, use that logger to print the banner.\r
-        if (testLogger != null) {\r
-            if (testLogger.isDebugEnabled()) {\r
-               testLogger.debug(testBanner(testName, testLogger));\r
-            }\r
-        // Otherwise, use this base class's logger to print the banner.\r
-        } else {\r
-            testLogger = logger;\r
-            if (testLogger.isDebugEnabled()) {\r
-                testLogger.debug(testBanner(testName));\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Initializes setup values for a given test.\r
-     *\r
-     * @param expectedStatusCode  A status code expected to be returned in the response.\r
-     *\r
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
      */\r
     protected void testSetup(\r
             int expectedStatusCode,\r
@@ -582,7 +536,7 @@ public abstract class BaseServiceTest {
     }\r
 \r
     /**\r
-     * Returns label text inside a test-specific banner.\r
+     * Returns a test-specific banner.\r
      *\r
      * @param testName The name of a test method.\r
      *\r
@@ -594,21 +548,6 @@ public abstract class BaseServiceTest {
         return banner(testName);\r
     }\r
 \r
-    /**\r
-     * Returns a test-specific banner.\r
-     *\r
-     * @param testName The name of a test method.\r
-     *\r
-     * @param testLogger An optional logger to use within the current base\r
-     *     class, when generating log statements related to that test.\r
-     *\r
-     * @return A test-specific banner.\r
-     */\r
-    protected static String testBanner(String testName, Logger testLogger) {\r
-        String testClass = testLogger.getName();\r
-        return testBanner(testName, testClass);\r
-    }\r
-\r
     /**\r
      * Returns a test-specific banner.\r
      *\r
index f0f9737e8ff094194770b0d831464f1a0717ea76..d5b42d41979766f49c750ddbfcc5c4f78203facb 100644 (file)
@@ -62,14 +62,14 @@ import org.slf4j.LoggerFactory;
 public class CollectionObjectAuthRefsTest extends BaseServiceTest {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(CollectionObjectAuthRefsTest.class);
+    private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
-    /** The SERVIC e_ pat h_ component. */
+    /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "collectionobjects";
     
-    /** The PERSO n_ authorit y_ name. */
+    /** The person authority name. */
     final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
     
     /** The known resource id. */
@@ -81,12 +81,6 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
     /** The person ids created. */
     private List<String> personIdsCreated = new ArrayList<String>();
     
-    /** The CREATE d_ status. */
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    
-    /** The O k_ status. */
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
-    
     /** The person auth csid. */
     private String personAuthCSID = null; 
     
@@ -102,7 +96,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
     /** The inscriber ref name. */
     private String inscriberRefName = null;
     
-    /** The NU m_ aut h_ ref s_ expected. */
+    /** The number of authority references expected. */
     private final int NUM_AUTH_REFS_EXPECTED = 4;
 
     /* (non-Javadoc)
@@ -135,7 +129,10 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -197,7 +194,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
         
         contentOrganizationRefName = PersonAuthorityClientUtils.createPersonRefName(
@@ -238,7 +235,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -253,8 +250,11 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
index 64e8c70b31ac3d93d5f430653bbd795a4eba9300..0e1e8c350e61052002fe56d46844cf2c8493f044 100644 (file)
@@ -59,8 +59,9 @@ import org.slf4j.LoggerFactory;
 public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-            LoggerFactory.getLogger(CollectionObjectServiceTest.class);
+    private final String CLASS_NAME = CollectionObjectServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     /** The known resource id. */
     private String knownResourceId = null;
@@ -104,10 +105,13 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -284,7 +288,6 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createWithMalformedXml(String testName) throws Exception {
-        setupCreate(testName);
     }
 
     /* (non-Javadoc)
@@ -303,25 +306,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throwsException {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -329,25 +335,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -355,25 +364,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -393,7 +405,10 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createWithRequiredValuesNullOrEmpty(String testName) throws Exception {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Build a payload with invalid content, by omitting a
         // field (objectNumber) which must be present, and in which
@@ -457,8 +472,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -502,8 +520,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -533,8 +554,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -585,8 +609,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Read an existing resource that will be updated.
         ClientResponse<MultipartInput> res = updateRetrieve(testName, knownResourceId);
@@ -714,25 +741,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -740,25 +770,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml() throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    final String entity = MALFORMED_XML_DATA;
-    String mediaType = MediaType.APPLICATION_XML;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        final String entity = MALFORMED_XML_DATA;
+        String mediaType = MediaType.APPLICATION_XML;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -766,25 +799,28 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(String testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -796,8 +832,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         //
@@ -838,8 +877,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
     public void updateWithRequiredValuesNullOrEmpty(String testName) throws Exception {
+  
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
         if (logger.isDebugEnabled()) {
             logger.debug(testName + " got object to update with ID: " + knownResourceId);
         }
@@ -888,8 +931,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -915,8 +961,11 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         CollectionObjectClient client = new CollectionObjectClient();
@@ -1154,10 +1203,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
      * @throws Exception the exception
      */
     private String createFromXmlFile(String testName, String fileName, boolean useJaxb) throws Exception {
-        // Perform setup, such as initializing the type of service request
-        // (e.g. CREATE, DELETE), its valid and expected status codes, and
-        // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+  
+        // Perform setup.
+        setupCreate();
 
         MultipartOutput multipart = null;
 
index ba70241114a586887d3918800ae59e7c3f88c691..6b8f8b45d319ead912b91a1bac322534cb5b5fd2 100644 (file)
@@ -49,7 +49,9 @@ import org.testng.annotations.Test;
  */
 public class ServiceLayerTest {
 
-    final Logger logger = LoggerFactory.getLogger(ServiceTest.class);
+    private final String CLASS_NAME = ServiceLayerTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     private TestServiceClient serviceClient = new TestServiceClient();
     private HttpClient httpClient = serviceClient.getHttpClient();
 
@@ -73,6 +75,10 @@ public class ServiceLayerTest {
 
     @Test
     public void servicesExist() {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("servicesExist", CLASS_NAME));
+        }
         //use ID service that should always be present in a working service layer
         String url = serviceClient.getBaseURL() + "idgenerators";
         OptionsMethod method = new OptionsMethod(url);
@@ -98,6 +104,9 @@ public class ServiceLayerTest {
 
     @Test
     public void methodNotAllowed() {
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("methodNotAllowed", CLASS_NAME));
+        }
         // Delete is not allowed on the root URL of the id service
         String url = serviceClient.getBaseURL() + "idgenerators";
         DeleteMethod method = new DeleteMethod(url);
@@ -122,6 +131,9 @@ public class ServiceLayerTest {
 
     @Test
     public void nonexistentService() {
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("nonexistentService", CLASS_NAME));
+        }
         String url = serviceClient.getBaseURL() + "nonexistent-service";
         GetMethod method = new GetMethod(url);
         try {
@@ -145,6 +157,9 @@ public class ServiceLayerTest {
 
 //    @Test
     public void serviceSecure() {
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("serviceSecure", CLASS_NAME));
+        }
         String url = serviceClient.getBaseURL() + "collectionobjects";
         GetMethod method = new GetMethod(url);
         // This vanilla HTTP client does not contain credentials or any other
@@ -174,6 +189,9 @@ public class ServiceLayerTest {
 
     @Test
     public void traceSupported() {
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("traceSupported", CLASS_NAME));
+        }
         String url = serviceClient.getBaseURL() + "collectionobjects";
         TraceMethod method = new TraceMethod(url);
         try {
@@ -202,6 +220,9 @@ public class ServiceLayerTest {
 
     @Test
     public void headSupported() {
+        if (logger.isDebugEnabled()) {
+            logger.debug(BaseServiceTest.testBanner("headSupported", CLASS_NAME));
+        }
         String url = serviceClient.getBaseURL() + "intakes";
         HeadMethod method = new HeadMethod(url);
         try {
index b3456559da1da9ab833c5a47945e5c0af22c23f3..c5475391b64e53dfc27b75e89769e2470527a622 100644 (file)
@@ -55,8 +55,8 @@ import org.slf4j.LoggerFactory;
  */
 public class ContactServiceTest extends AbstractServiceTestImpl {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(ContactServiceTest.class);
+    private final String CLASS_NAME = ContactServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "contacts";
@@ -87,10 +87,13 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -161,25 +164,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody(testName, logger);
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("createWithEmptyEntityBody url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("createWithEmptyEntityBody url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -187,25 +193,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -213,25 +222,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema(testName, logger);
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -244,8 +256,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -273,8 +288,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -300,8 +318,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -348,8 +369,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -431,25 +455,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
+            if (logger.isDebugEnabled()) {
+                logger.debug(testBanner(testName, CLASS_NAME));
+            }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -457,25 +484,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-         " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+             " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -483,25 +513,28 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -510,8 +543,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -542,8 +578,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
@@ -566,8 +605,11 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         ContactClient client = new ContactClient();
index 39105d7f61d832e847856a4b9b7e8ad634da4b66..9ed5bdbfdb973b9ec49c63c8a5d67cbf45fd23aa 100644 (file)
@@ -56,8 +56,9 @@ import org.slf4j.LoggerFactory;
 public class DimensionServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-            LoggerFactory.getLogger(DimensionServiceTest.class);
+    private final String CLASS_NAME = DimensionServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+
     // Instance variables specific to this test.
     /** The SERVIC e_ pat h_ component. */
     final String SERVICE_PATH_COMPONENT = "dimensions";
@@ -92,10 +93,13 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -178,25 +182,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug("createWithEmptyEntityBody url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug("createWithEmptyEntityBody url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -204,25 +211,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -230,25 +240,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
     // ---------------------------------------------------------------
@@ -263,8 +276,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -295,8 +311,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -325,8 +344,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -376,8 +398,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         DimensionClient client = new DimensionClient();
@@ -464,25 +489,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -490,25 +518,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -516,25 +547,28 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-    logger.debug(testName + ": url=" + url +
-    " status=" + statusCode);
-    }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+        logger.debug(testName + ": url=" + url +
+        " status=" + statusCode);
+        }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -546,8 +580,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -581,8 +618,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -608,8 +648,11 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
index a653700561aad74b84dd6b6cc0795f3f953cc75a..44bfb8314914635a694f7fd8bce26c38ec89d674 100644 (file)
@@ -60,8 +60,8 @@ import org.slf4j.LoggerFactory;
  */
 public class IntakeAuthRefsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(IntakeAuthRefsTest.class);
+    private final String CLASS_NAME = IntakeAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "intakes";
@@ -69,8 +69,6 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
     private String knownResourceId = null;
     private List<String> intakeIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
     private String personAuthCSID = null; 
     private String currentOwnerRefName = null;
     private String depositorRefName = null;
@@ -104,7 +102,10 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -165,7 +166,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
         
         currentOwnerRefName = PersonAuthorityClientUtils.createPersonRefName(
@@ -208,7 +209,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -217,8 +218,11 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         IntakeClient intakeClient = new IntakeClient();
index 51c7cbcf96f39183245091588be2943f053786c2..f4be1b5f15558f17186c90629e6ecf076282ffc7 100644 (file)
@@ -54,11 +54,11 @@ import org.slf4j.LoggerFactory;
 public class IntakeServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(IntakeServiceTest.class);
+    private final String CLASS_NAME = IntakeServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
-    /** The SERVIC e_ pat h_ component. */
+    /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "intakes";
     
     /** The known resource id. */
@@ -92,10 +92,13 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
@@ -177,25 +180,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("createWithEmptyEntityBody url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("createWithEmptyEntityBody url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -203,25 +209,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -229,25 +238,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema(testName, logger);
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -263,8 +275,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
@@ -295,8 +310,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
@@ -325,8 +343,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
@@ -376,8 +397,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         IntakeClient client = new IntakeClient();
@@ -465,25 +489,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -491,25 +518,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-         " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+             " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -517,25 +547,28 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -547,8 +580,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -581,8 +617,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
@@ -608,8 +647,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         IntakeClient client = new IntakeClient();
index 4c7be741e119a8ac43815acd1c5a316f998865df..7a4ecf7bb49156e180f09f349c4fa8b99b828054 100644 (file)
@@ -61,8 +61,8 @@ import org.slf4j.LoggerFactory;
  */\r
 public class OrganizationAuthRefDocsTest extends BaseServiceTest {\r
 \r
-   private final Logger logger =\r
-       LoggerFactory.getLogger(OrganizationAuthRefDocsTest.class);\r
+    private final String CLASS_NAME = OrganizationAuthRefDocsTest.class.getName();\r
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);\r
 \r
     // Instance variables specific to this test.\r
     final String SERVICE_PATH_COMPONENT = "intakes";\r
@@ -70,8 +70,6 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
     private String knownIntakeId = null;\r
     private List<String> intakeIdsCreated = new ArrayList<String>();\r
     private List<String> orgIdsCreated = new ArrayList<String>();\r
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();\r
-    private int OK_STATUS = Response.Status.OK.getStatusCode();\r
     private String orgAuthCSID = null; \r
     private String currentOwnerOrgCSID = null; \r
     private String currentOwnerRefName = null;\r
@@ -106,7 +104,10 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)\r
     public void createIntakeWithAuthRefs(String testName) throws Exception {\r
 \r
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);\r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);\r
 \r
         // Submit the request to the service and store the response.\r
         String identifier = createIdentifier();\r
@@ -173,7 +174,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
 \r
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),\r
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-        Assert.assertEquals(statusCode, CREATED_STATUS);\r
+        Assert.assertEquals(statusCode, STATUS_CREATED);\r
         orgAuthCSID = extractId(res);\r
         \r
         currentOwnerRefName = OrgAuthorityClientUtils.createOrganizationRefName(\r
@@ -217,7 +218,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
 \r
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),\r
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
-        Assert.assertEquals(statusCode, CREATED_STATUS);\r
+        Assert.assertEquals(statusCode, STATUS_CREATED);\r
        return extractId(res);\r
     }\r
 \r
@@ -226,8 +227,11 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
         dependsOnMethods = {"createIntakeWithAuthRefs"})\r
     public void readAndCheckAuthRefDocs(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);\r
+        testSetup(STATUS_OK, ServiceRequestType.READ);\r
         \r
         // Get the auth ref docs and check them\r
        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();\r
index d327824e25d60c3e8eeda27955a1952733d2366d..ae955825ec26c5a92a96f9564608937ce36908c2 100644 (file)
@@ -61,8 +61,8 @@ import org.slf4j.LoggerFactory;
  */
 public class PersonAuthRefDocsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(PersonAuthRefDocsTest.class);
+    private final String CLASS_NAME = PersonAuthRefDocsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "intakes";
@@ -70,8 +70,6 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
     private String knownIntakeId = null;
     private List<String> intakeIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
     private String personAuthCSID = null; 
     private String currentOwnerPersonCSID = null; 
     private String currentOwnerRefName = null;
@@ -106,7 +104,10 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createIntakeWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -173,7 +174,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
         
         currentOwnerRefName = PersonAuthorityClientUtils.createPersonRefName(
@@ -217,7 +218,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -226,8 +227,11 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
         dependsOnMethods = {"createIntakeWithAuthRefs"})
     public void readAndCheckAuthRefDocs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
         
         // Get the auth ref docs and check them
        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
index 5b8fa9c38e6783d0faf0f90d2977f4b89155e411..3c80b24783c9ef87d59600d39c375805b0f0dcd0 100644 (file)
@@ -62,17 +62,15 @@ import org.slf4j.LoggerFactory;
  */
 public class LoaninAuthRefsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(LoaninAuthRefsTest.class);
-
+    private final String CLASS_NAME = LoaninAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "loansin";
     final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
     private String knownResourceId = null;
     private List<String> loaninIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
     private String personAuthCSID = null;
     private String lendersAuthorizerRefName = null;
     private String lendersContactRefName = null;
@@ -105,7 +103,10 @@ public class LoaninAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -171,7 +172,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
             invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
 
         // Create temporary Person resources, and their corresponding refNames
@@ -207,7 +208,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -216,8 +217,11 @@ public class LoaninAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         LoaninClient loaninClient = new LoaninClient();
index 2b79afaeaee52ae81a07876487f499701771473e..29fcb4a3b156413a43b879f3d2ab67a421b6d0b7 100644 (file)
@@ -55,11 +55,11 @@ import org.slf4j.LoggerFactory;
 public class LoaninServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(LoaninServiceTest.class);
+    private final String CLASS_NAME = LoaninServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
-    /** The SERVIC e_ pat h_ component. */
+    /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "loansin";
     
     /** The known resource id. */
@@ -93,10 +93,13 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         LoaninClient client = new LoaninClient();
@@ -184,25 +187,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("createWithEmptyEntityBody url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("createWithEmptyEntityBody url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -210,25 +216,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml(testName, logger);
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -236,25 +245,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema(testName, logger);
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -269,8 +281,12 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         MultipartInput input = null;
@@ -307,8 +323,11 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         LoaninClient client = new LoaninClient();
@@ -340,8 +359,12 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         LoansinCommonList list = null;
@@ -396,8 +419,11 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         MultipartInput input = null;
@@ -494,25 +520,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -520,25 +549,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-         " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+             " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -546,25 +578,28 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -576,8 +611,11 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -614,8 +652,11 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         LoaninClient client = new LoaninClient();
@@ -644,8 +685,12 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         LoaninClient client = new LoaninClient();
index c7cdde9f94e46d4e4a32e19ac6a762f003f0c65d..6b95b3ad3bd773709924329a638cf716dbf9e2aa 100644 (file)
@@ -62,8 +62,8 @@ import org.slf4j.LoggerFactory;
  */
 public class LoanoutAuthRefsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(LoanoutAuthRefsTest.class);
+    private final String CLASS_NAME = LoanoutAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "loansout";
@@ -71,8 +71,6 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
     private String knownResourceId = null;
     private List<String> loanoutIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
     private String personAuthCSID = null;
     private String borrowersContactRefName = null;
     private String lendersAuthorizerRefName = null;
@@ -107,7 +105,10 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -170,7 +171,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
             invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
 
         // Create temporary Person resources, and their corresponding refNames
@@ -201,7 +202,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -210,8 +211,11 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         LoanoutClient loanoutClient = new LoanoutClient();
index a951341e54f7cb4ab90f21677e45f2664f0ac313..22d0653848dd1ffc71d0912ba8ec9af8829f5898 100644 (file)
@@ -53,11 +53,11 @@ import org.slf4j.LoggerFactory;
 public class LoanoutServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(LoanoutServiceTest.class);
+    private final String CLASS_NAME = LoanoutServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
-    /** The SERVIC e_ pat h_ component. */
+    /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "loansout";
     
     /** The known resource id. */
@@ -91,10 +91,13 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
@@ -176,25 +179,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("createWithEmptyEntityBody url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("createWithEmptyEntityBody url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -202,25 +208,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -228,25 +237,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -262,8 +274,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
@@ -294,8 +309,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
@@ -324,8 +342,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
@@ -375,8 +396,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         LoanoutClient client = new LoanoutClient();
@@ -463,25 +487,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -489,25 +516,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-         " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+             " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -515,25 +545,28 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -545,8 +578,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -579,8 +615,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
@@ -606,8 +645,11 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         LoanoutClient client = new LoanoutClient();
index c7aa0dd04f6590fa9fd950be54bf426edc2bd6d4..34759a91f5e9806c283f89fc8f3f2f7e43c8e380 100644 (file)
@@ -62,17 +62,18 @@ import org.testng.annotations.Test;
 public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-        LoggerFactory.getLogger(LocationAuthorityServiceTest.class);
+    private final String CLASS_NAME = LocationAuthorityServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
+    
     /** The SERVICE path component. */
     final String SERVICE_PATH_COMPONENT = "locationauthorities";
     
-    /** The ITEM servicE path component. */
+    /** The ITEM service path component. */
     final String ITEM_SERVICE_PATH_COMPONENT = "items";
     
-    /** The CONTACT servicE path component. */
+    /** The CONTACT service path component. */
     final String CONTACT_SERVICE_PATH_COMPONENT = "contacts";
     
     /** The TEST name. */
@@ -152,10 +153,13 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"})
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -209,7 +213,10 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"create"})
     public void createItem(String testName) {
-        setupCreate(testName);
+        if(logger.isDebugEnabled()){
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         String newID = createItemInAuthority(knownResourceId, knownResourceRefName);
     }
 
@@ -224,7 +231,7 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
 
         final String testName = "createItemInAuthority";
         if(logger.isDebugEnabled()){
-            logger.debug(testName + ":...");
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
 
         // Submit the request to the service and store the response.
@@ -343,8 +350,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnGroups = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
         
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -380,8 +390,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
             groups = {"read"}, dependsOnGroups = {"create"})
         public void readByName(String testName) throws Exception {
 
-            // Perform setup.
-        setupRead(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupRead();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -418,8 +431,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -459,8 +475,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"readItem", "updateItem"})
     public void verifyItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -569,8 +588,12 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"verifyItemDisplayName"})
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-       setupUpdateWithWrongXmlSchema(testName);
+        // FIXME: create a setup configuration for this operation.
+       setupUpdateWithWrongXmlSchema();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -621,8 +644,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -648,8 +674,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readItemNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -680,8 +709,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"readList"}, dependsOnGroups = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -723,6 +755,10 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
      */
     @Test(groups = {"readList"}, dependsOnMethods = {"readList"})
     public void readItemList() {
+        String testName = "readItemList";
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         readItemList(knownResourceId, null);
     }
 
@@ -731,6 +767,10 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
      */
     @Test(groups = {"readList"}, dependsOnMethods = {"readItemList"})
     public void readItemListByAuthorityName() {
+        String testName = "readItemListByAuthorityName";
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         readItemList(null, knownResourceDisplayName);
     }
     
@@ -742,12 +782,12 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
      */
     private void readItemList(String vcsid, String name) {
 
-        final String testName = "readItemList";
+        String testName = "readItemList";
 
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
         
-       // Submit the request to the service and store the response.
+        // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
         ClientResponse<LocationsCommonList> res = null;
         if(vcsid!= null) {
@@ -821,8 +861,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnGroups = {"read", "readList"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -887,8 +930,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update"})
     public void updateItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -978,8 +1024,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID(s) used when creating the request payload may be arbitrary.
@@ -1013,8 +1062,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"updateItem", "testItemSubmitRequest"})
     public void updateNonExistentItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -1061,8 +1113,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnGroups = {"create", "read", "readList", "update"})
     public void deleteItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId +
@@ -1092,8 +1147,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId);
@@ -1123,8 +1181,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
@@ -1150,8 +1211,11 @@ public class LocationAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void deleteNonExistentItem(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         LocationAuthorityClient client = new LocationAuthorityClient();
index 442c928ddd6c4d4007a8d709fca3316563ec114d..a58dc1a6bc7afef91b314bb1f13f50fb57f98c1f 100644 (file)
@@ -62,8 +62,8 @@ import org.slf4j.LoggerFactory;
  */
 public class MovementAuthRefsTest extends BaseServiceTest {
 
-   private final Logger logger =
-       LoggerFactory.getLogger(MovementAuthRefsTest.class);
+    private final String CLASS_NAME = MovementAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "movements";
@@ -71,8 +71,6 @@ public class MovementAuthRefsTest extends BaseServiceTest {
     private String knownResourceId = null;
     private List<String> movementIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
     private String personAuthCSID = null;
     private String movementContactRefName = null;
 
@@ -105,7 +103,10 @@ public class MovementAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
@@ -166,7 +167,7 @@ public class MovementAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
             invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
         personAuthCSID = extractId(res);
 
         // Create temporary Person resources, and their corresponding refNames
@@ -189,7 +190,7 @@ public class MovementAuthRefsTest extends BaseServiceTest {
 
         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, CREATED_STATUS);
+        Assert.assertEquals(statusCode, STATUS_CREATED);
        return extractId(res);
     }
 
@@ -198,8 +199,11 @@ public class MovementAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         MovementClient movementClient = new MovementClient();
index 01854c2af1c192ce23059e71d9c2b6d8a3a2dac1..ff4a9994b3660d1d43e91ca0e456acdd7b7b7bd0 100644 (file)
@@ -54,8 +54,8 @@ import org.slf4j.LoggerFactory;
 public class MovementServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(MovementServiceTest.class);
+    private final String CLASS_NAME = MovementServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     /** The service path component. */
@@ -92,10 +92,13 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -177,25 +180,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("createWithEmptyEntityBody url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("createWithEmptyEntityBody url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -203,25 +209,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -229,25 +238,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -263,8 +275,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -295,8 +310,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -325,8 +343,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -376,8 +397,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         MovementClient client = new MovementClient();
@@ -464,25 +488,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
 
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
 
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -490,25 +517,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-         " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+             " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -516,25 +546,28 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -546,8 +579,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -580,8 +616,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -607,8 +646,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
@@ -687,8 +729,14 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
     private MultipartOutput createMovementInstance(String movementReferenceNumber,
                String locationDate) {
         MovementsCommon movement = new MovementsCommon();
-        movement.setMovementReferenceNumber(movementReferenceNumber);
+        // FIXME: Values of currentLocation, normalLocation,
+        // and movementContact should be refNames.
+        movement.setCurrentLocation("currentLocation value");
+        movement.setCurrentLocationFitness("currentLocationFitness value");
+        movement.setCurrentLocationNote("currentLocationNote value");
         movement.setLocationDate(locationDate);
+        movement.setNormalLocation("normalLocation value");
+        movement.setMovementContact("movementContact value");
         MovementMethodsList movementMethodsList = new MovementMethodsList();
         List<String> methods = movementMethodsList.getMovementMethod();
         // @TODO Use properly formatted refNames for representative movement
@@ -697,6 +745,11 @@ public class MovementServiceTest extends AbstractServiceTestImpl {
         methods.add("First Movement Method-" + identifier);
         methods.add("Second Movement Method-" + identifier);
         movement.setMovementMethods(movementMethodsList);
+        movement.setMovementNote("movementNote value");
+        movement.setMovementReferenceNumber(movementReferenceNumber);
+        movement.setPlannedRemovalDate("plannedRemovalDate value");
+        movement.setRemovalDate("removalDate value");
+        movement.setReasonForMove("reasonForMove value");
         MultipartOutput multipart = new MultipartOutput();
         OutputPart commonPart =
             multipart.addPart(movement, MediaType.APPLICATION_XML_TYPE);
index e610d00dbfed250b106ec3425848054103872242..427bf6fab3a5f93b97b20cf62e06c3f347defee4 100644 (file)
@@ -55,8 +55,8 @@ import org.slf4j.LoggerFactory;
  */\r
 public class NoteServiceTest extends AbstractServiceTestImpl {\r
 \r
-   private final Logger logger =\r
-       LoggerFactory.getLogger(NoteServiceTest.class);\r
+    private final String CLASS_NAME = NoteServiceTest.class.getName();\r
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);\r
 \r
     // Instance variables specific to this test.\r
     final String SERVICE_PATH_COMPONENT = "notes";\r
@@ -87,10 +87,13 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)\r
     public void create(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup, such as initializing the type of service request\r
         // (e.g. CREATE, DELETE), its valid and expected status codes, and\r
         // its associated HTTP method name (e.g. POST, DELETE).\r
-        setupCreate(testName);\r
+        setupCreate();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -166,8 +169,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})\r
     public void read(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupRead(testName);\r
+        setupRead();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -195,8 +201,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})\r
     public void readNonExistent(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupReadNonExistent(testName);\r
+        setupReadNonExistent();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -222,8 +231,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})\r
     public void readList(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupReadList(testName);\r
+        setupReadList();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -270,8 +282,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})\r
     public void update(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupUpdate(testName);\r
+        setupUpdate();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -352,8 +367,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})\r
     public void updateNonExistent(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupUpdateNonExistent(testName);\r
+        setupUpdateNonExistent();\r
 \r
         // Submit the request to the service and store the response.\r
         // Note: The ID used in this 'create' call may be arbitrary.\r
@@ -384,8 +402,11 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})\r
     public void delete(String testName) throws Exception {\r
 \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupDelete(testName);\r
+        setupDelete();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
@@ -407,9 +428,12 @@ public class NoteServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,\r
         dependsOnMethods = {"delete"})\r
     public void deleteNonExistent(String testName) throws Exception {\r
-\r
+        \r
+        if (logger.isDebugEnabled()) {\r
+            logger.debug(testBanner(testName, CLASS_NAME));\r
+        }\r
         // Perform setup.\r
-        setupDeleteNonExistent(testName);\r
+        setupDeleteNonExistent();\r
 \r
         // Submit the request to the service and store the response.\r
         NoteClient client = new NoteClient();\r
index 41933994248411cce94be1d58480978b994589f6..d9404fd9bb0b1a878cc42b06937f11e828a2babc 100644 (file)
@@ -61,8 +61,8 @@ import org.slf4j.LoggerFactory;
 public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
 
    /** The logger. */
-   private final Logger logger =
-       LoggerFactory.getLogger(OrgAuthorityAuthRefsTest.class);
+    private final String CLASS_NAME = OrgAuthorityAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     /** The SERVIC e_ pat h_ component. */
@@ -90,19 +90,13 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
     /** The person ids created. */
     private List<String> personIdsCreated = new ArrayList<String>();
     
-    /** The CREATE d_ status. */
-    private int CREATED_STATUS = Response.Status.CREATED.getStatusCode();
-    
-    /** The O k_ status. */
-    private int OK_STATUS = Response.Status.OK.getStatusCode();
-    
     /** The person auth csid. */
     private String personAuthCSID = null;
     
     /** The organization contact person ref name. */
     private String organizationContactPersonRefName = null;
     
-    /** The NU m_ aut h_ ref s_ expected. */
+    /** The number of authorityreferences expected. */
     private final int NUM_AUTH_REFS_EXPECTED = 1;
 
     /* (non-Javadoc)
@@ -135,7 +129,10 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void createWithAuthRefs(String testName) throws Exception {
 
-        testSetup(CREATED_STATUS, ServiceRequestType.CREATE,testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Create a new Organization Authority resource.
         OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
@@ -216,7 +213,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
                int statusCode = res.getStatus();       
                Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-               Assert.assertEquals(statusCode, CREATED_STATUS);
+               Assert.assertEquals(statusCode, STATUS_CREATED);
                personAuthCSID = extractId(res);
         } finally {
                res.releaseConnection();
@@ -254,7 +251,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
        
                Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-               Assert.assertEquals(statusCode, CREATED_STATUS);
+               Assert.assertEquals(statusCode, STATUS_CREATED);
                result = extractId(res);
        } finally {
                res.releaseConnection();
@@ -274,8 +271,11 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
         dependsOnMethods = {"createWithAuthRefs"})
     public void readAndCheckAuthRefs(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        testSetup(OK_STATUS, ServiceRequestType.READ,testName);
+        testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
index da318a55ff8f5e6a3792a6a806df158094c770fc..f5d384b60b1d09db7a36a5ebca45268a46aabd2d 100644 (file)
@@ -62,23 +62,23 @@ import org.testng.annotations.Test;
 public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-        LoggerFactory.getLogger(OrgAuthorityServiceTest.class);
+    private final String CLASS_NAME = OrgAuthorityServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
-    /** The SERVIC e_ pat h_ component. */
+    /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "orgauthorities";
     
-    /** The ITE m_ servic e_ pat h_ component. */
+    /** The item service path component. */
     final String ITEM_SERVICE_PATH_COMPONENT = "items";
     
-    /** The CONTAC t_ servic e_ pat h_ component. */
+    /** The contact service path component. */
     final String CONTACT_SERVICE_PATH_COMPONENT = "contacts";
     
-    /** The TES t_ or g_ shortname. */
+    /** The test organization shortname. */
     private final String TEST_ORG_SHORTNAME = "Test Org";
     
-    /** The TES t_ or g_ foundin g_ place. */
+    /** The test organization founding place. */
     private final String TEST_ORG_FOUNDING_PLACE = "Anytown, USA";
     
     /** The known resource id. */
@@ -136,10 +136,13 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"})
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -199,7 +202,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"create"})
     public void createItem(String testName) {
-        setupCreate(testName);
+        setupCreate();
         String newID = createItemInAuthority(knownResourceId, knownResourceRefName);
     }
 
@@ -255,7 +258,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"createItem"})
     public void createContact(String testName) {
-        setupCreate(testName);
+        setupCreate();
         String newID = createContactInItem(knownResourceId, knownItemResourceId);
     }
 
@@ -269,10 +272,10 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
    private String createContactInItem(String parentcsid, String itemcsid) {
 
         final String testName = "createContactInItem";
-        setupCreate(testName);
-        if(logger.isDebugEnabled()){
-            logger.debug(testName + ":...");
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -351,51 +354,57 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()) {
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
-    }
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()) {
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        }
 
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -403,25 +412,28 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -483,8 +495,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnGroups = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -524,8 +539,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
             groups = {"read"}, dependsOnGroups = {"create"})
         public void readByName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -560,8 +578,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readByName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         ClientResponse<MultipartInput> res = client.read(knownResourceId);
@@ -597,8 +618,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -642,8 +666,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"readItem", "updateItem"})
     public void verifyItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -770,8 +797,12 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"verifyItemDisplayName"})
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-       setupUpdateWithWrongXmlSchema(testName);
+        testSetup(STATUS_BAD_REQUEST, ServiceRequestType.UPDATE);
+       // setupUpdateWithWrongXmlSchema(testName, logger);
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -822,8 +853,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readContact(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -865,8 +899,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -892,8 +929,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readItemNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -919,8 +959,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readContact"})
     public void readContactNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -951,8 +994,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"readList"}, dependsOnGroups = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1015,8 +1061,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
 
         final String testName = "readItemList";
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1093,8 +1142,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
     private void readContactList(String parentcsid, String itemcsid) {
         final String testName = "readContactList";
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1159,8 +1211,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnGroups = {"read", "readList"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1225,8 +1280,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update"})
     public void updateItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1294,8 +1352,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"updateItem"})
     public void updateContact(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1386,25 +1447,28 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -1412,51 +1476,54 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-           " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
-    }
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
 
-    @Override
-    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
-        groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
-    public void updateWithWrongXmlSchema(String testName) throws Exception {
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+               " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        }
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("updateWithWrongXmlSchema: url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        @Override
+        @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
+            groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
+        public void updateWithWrongXmlSchema(String testName) throws Exception {
+
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("updateWithWrongXmlSchema: url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -1468,8 +1535,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -1500,8 +1570,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"updateItem", "testItemSubmitRequest"})
     public void updateNonExistentItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID(s) used when creating the request payload may be arbitrary.
@@ -1558,8 +1631,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnGroups = {"create", "read", "readList", "update"})
     public void deleteContact(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
          if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId +
@@ -1593,8 +1669,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId +
@@ -1624,8 +1703,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId);
@@ -1655,8 +1737,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1682,8 +1767,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void deleteNonExistentItem(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
@@ -1709,8 +1797,11 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteNonExistentContact(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
index e443935cf6dc1412b4dce40bc85b0e83fb941429..869795cf6f169c601e80bb92e9e19b4aa9aac34d 100644 (file)
@@ -52,8 +52,9 @@ import org.testng.annotations.Test;
  */
 public class PersonAuthoritySearchTest extends BaseServiceTest {
 
-    static final Logger logger = LoggerFactory.getLogger(PersonAuthoritySearchTest.class);
-
+    private final String CLASS_NAME = PersonAuthoritySearchTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     /** The service path component. */
     final String SERVICE_PATH_COMPONENT = "personauthorities";
     
@@ -166,7 +167,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"})
     public void partialTermMatch(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
         String partialTerm = getPartialTerm();
@@ -190,7 +191,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
     public void partialTermMatchCaseInsensitiveLowerCase(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
 
@@ -216,7 +217,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
     public void partialTermMatchCaseInsensitiveUpperCase(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
 
@@ -241,7 +242,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
     public void partialTermMatchMinimumLength(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
         String partialTerm = getPartialTermMinimumLength();
@@ -268,7 +269,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
     public void partialTermMatchUTF8(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
         String partialTerm = getPartialTermUtf8();
@@ -295,7 +296,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
     public void partialTermMatchOnNonexistentTerm(String testName) {
         if (logger.isDebugEnabled()) {
-            logger.debug(testBanner(testName, logger));
+            logger.debug(testBanner(testName, CLASS_NAME));
         }
         int numMatchesFound = 0;
         int ZERO_MATCHES_EXPECTED = 0;
@@ -322,13 +323,14 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
      */
     private int readItemListByPartialTerm(String authorityCsid, String partialTerm) {
 
+        String testName = "readItemListByPartialTerm";
+
         // Perform setup.
         int expectedStatusCode = Response.Status.OK.getStatusCode();
         ServiceRequestType requestType = ServiceRequestType.READ_LIST;
-        String testName = "readItemListByPartialTerm";
-        testSetup(expectedStatusCode, requestType, testName, logger);
+        testSetup(expectedStatusCode, requestType);
 
-       // Submit the request to the service and store the response.
+        // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
         ClientResponse<PersonsCommonList> res = null;
         if (authorityCsid != null) {
@@ -423,11 +425,12 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
 
     public void createAuthority() throws Exception {
 
+        String testName = "createAuthority";
+
         // Perform setup.
         int expectedStatusCode = Response.Status.CREATED.getStatusCode();
         ServiceRequestType requestType = ServiceRequestType.CREATE;
-        String testName = "createPersonAuthority";
-        testSetup(expectedStatusCode, requestType, testName, logger);
+        testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -443,6 +446,11 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
        ClientResponse<Response> res = client.create(multipart);
         try {
             int statusCode = res.getStatus();
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if(logger.isDebugEnabled()){
+                logger.debug(testName + ": status = " + statusCode);
+            }
             Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
             Assert.assertEquals(statusCode, this.EXPECTED_STATUS_CODE);
@@ -473,11 +481,12 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
      */
     private void createItemInAuthorityForPartialTermMatch(String authorityCsid, String authRefName)
         throws Exception {
+            
+        String testName = "createItemInAuthorityForPartialTermMatch";
 
         int expectedStatusCode = Response.Status.CREATED.getStatusCode();
         ServiceRequestType requestType = ServiceRequestType.CREATE;
-        String testName = "createItemInAuthorityForPartialTermMatch";
-        testSetup(expectedStatusCode, requestType, testName);
+        testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
index 0b1da65d6179edf22179f78b8766b38a5c6007a0..ebcb154148966281294acf0a1e1f2af1e84c372f 100644 (file)
@@ -61,8 +61,8 @@ import org.testng.annotations.Test;
 public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
     /** The logger. */
-    private final Logger logger =
-        LoggerFactory.getLogger(PersonAuthorityServiceTest.class);
+    private final String CLASS_NAME = PersonAuthorityServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     /** The service path component. */
@@ -146,11 +146,14 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"})
     public void create(String testName) throws Exception {
-
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -209,7 +212,10 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"create"})
     public void createItem(String testName) {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         String newID = createItemInAuthority(knownResourceId, knownResourceRefName);
     }
 
@@ -296,7 +302,10 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"createItem"})
     public void createContact(String testName) {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         String newID = createContactInItem(knownResourceId, knownItemResourceId);
     }
 
@@ -310,10 +319,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
    private String createContactInItem(String parentcsid, String itemcsid) {
 
         final String testName = "createContactInItem";
-        setupCreate(testName);
         if(logger.isDebugEnabled()){
             logger.debug(testName + ":...");
         }
+        
+        setupCreate();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -392,25 +402,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()) {
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()) {
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -418,25 +431,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -444,25 +460,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"create"}, dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -477,6 +496,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"createList"}, dependsOnGroups = {"create"})
     public void createList(String testName) throws Exception {
+         if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         for (int i = 0; i < nItemsToCreateInList; i++) {
             create(testName);
         }
@@ -491,6 +513,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"createList"}, dependsOnMethods = {"createList"})
     public void createItemList(String testName) throws Exception {
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Add items to the initially-created, known parent record.
         for (int j = 0; j < nItemsToCreateInList; j++) {
             createItem(testName);
@@ -524,8 +549,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnGroups = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
         
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -564,8 +592,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
             groups = {"read"}, dependsOnGroups = {"create"})
         public void readByName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -599,6 +630,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readByName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
         setupRead();
 
@@ -635,8 +669,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readItem(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -678,8 +716,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"readItem", "updateItem"})
     public void verifyItemDisplayName(String testName) throws Exception {
+        
+         if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -808,8 +850,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"verifyItemDisplayName"})
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-       setupUpdateWithWrongXmlSchema(testName);
+        testSetup(STATUS_BAD_REQUEST, ServiceRequestType.UPDATE);
+       // setupUpdateWithWrongXmlSchema(testName);
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -869,8 +915,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readContact(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -918,8 +968,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -948,8 +1001,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readItemNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -979,8 +1035,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"read"}, dependsOnMethods = {"readContact"})
     public void readContactNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1015,8 +1074,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"readList"}, dependsOnGroups = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1086,7 +1148,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         final String testName = "readItemList";
 
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
         
        // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1170,7 +1232,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         final String testName = "readContactList";
 
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1242,8 +1304,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnGroups = {"read", "readList", "readListByPartialTerm"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1318,8 +1383,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update"})
     public void updateItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1407,8 +1475,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"updateItem"})
     public void updateContact(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1509,25 +1581,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody(testName, logger);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -1535,25 +1610,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-           " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+               " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -1561,25 +1639,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("updateWithWrongXmlSchema: url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("updateWithWrongXmlSchema: url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 */
 
@@ -1591,14 +1672,17 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID(s) used when creating the request payload may be arbitrary.
         // The only relevant ID may be the one used in update(), below.
         PersonAuthorityClient client = new PersonAuthorityClient();
-       String displayName = "displayName-NON_EXISTENT_ID";
+        String displayName = "displayName-NON_EXISTENT_ID";
        String fullRefName = PersonAuthorityClientUtils.createPersonAuthRefName(displayName, true);
        MultipartOutput multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                                displayName, fullRefName, client.getCommonPartName());
@@ -1630,8 +1714,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"update"}, dependsOnMethods = {"updateItem", "testItemSubmitRequest"})
     public void updateNonExistentItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -1693,8 +1780,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnGroups = {"create", "read", "readList", "readListByPartialTerm", "update"})
     public void deleteContact(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
          if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId +
@@ -1729,8 +1819,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId +
@@ -1761,8 +1854,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         if(logger.isDebugEnabled()){
             logger.debug("parentcsid =" + knownResourceId);
@@ -1793,8 +1889,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1821,8 +1920,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void deleteNonExistentItem(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
@@ -1849,8 +1951,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteNonExistentContact(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
index 8f82cc420025372fd91db42b07f752918abea7ec..b06af76145a3c01ec48a28d4433f07d1c8168925 100644 (file)
@@ -54,10 +54,10 @@ import org.slf4j.LoggerFactory;
 public class RelationServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
-   private final Logger logger =
-        LoggerFactory.getLogger(RelationServiceTest.class);
+    private final String CLASS_NAME = RelationServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
-    /** The SERVIC e_ pat h_ component. */
+    /** The SERVICE path component. */
     final String SERVICE_PATH_COMPONENT = "relations";
     
     /** The known resource id. */
@@ -91,10 +91,13 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
     @Override
     public void create(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -174,25 +177,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+            if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -200,25 +206,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+            if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -226,25 +235,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
     
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-      logger.debug(testName + ": url=" + url +
-          " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+            if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+          logger.debug(testName + ": url=" + url +
+              " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -260,8 +272,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -294,8 +309,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -324,8 +342,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -375,8 +396,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve an existing resource that we can update.
         RelationClient client = new RelationClient();
@@ -471,25 +495,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
     
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-       logger.debug(testName + ": url=" + url +
-           " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+           logger.debug(testName + ": url=" + url +
+               " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -497,25 +524,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from abstract base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from abstract base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -523,25 +553,28 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
     
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA; // Constant from abstract base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-        " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA; // Constant from abstract base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+            " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -553,8 +586,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -587,8 +623,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -614,8 +653,11 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -653,8 +695,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
     @Test(dependsOnMethods = {"create", "read"})
     public void testSubmitRequest() {
 
-        // Expected status code: 200 OK
-        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
+        setupRead();
 
         // Submit the request to the service and store the response.
         String method = ServiceRequestType.READ.httpMethodName();
@@ -667,7 +708,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
             logger.debug("testSubmitRequest: url=" + url +
                 " status=" + statusCode);
         }
-        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     // ---------------------------------------------------------------
index 72bc9429a9e50b763794969e958b7c498893b20a..9e3d0b1bfd9bafecbb38a44ff58e0d52f6d1e83a 100644 (file)
@@ -62,9 +62,11 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     private String knownResourceId = null;
     private String barneyAccountId = null; //active
     private String georgeAccountId = null; //inactive
+    
     /** The logger. */
-    final Logger logger = LoggerFactory.getLogger(AuthenticationServiceTest.class);
-
+    private final String CLASS_NAME = AuthenticationServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.AbstractServiceTest#getServicePathComponent()
      */
@@ -100,10 +102,15 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
 
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createActiveAccount(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
+        
         AccountClient accountClient = new AccountClient();
         accountClient.setAuth(true, "test", true, "test", true);
 
@@ -132,10 +139,13 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
 
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createInactiveAccount(String testName) throws Exception {
-        // Perform setup, such as initializing the type of service request
-        // (e.g. CREATE, DELETE), its valid and expected status codes, and
-        // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreate();
+        
         AccountClient accountClient = new AccountClient();
         accountClient.setAuth(true, "test", true, "test", true);
 
@@ -160,7 +170,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
         }
         res.releaseConnection();
         //deactivate
-        setupUpdate(testName);
+        setupUpdate();
         account.setStatus(Status.INACTIVE);
         if (logger.isDebugEnabled()) {
             logger.debug(testName + ":updated object");
@@ -189,7 +199,10 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"createActiveAccount"})
     @Override
     public void create(String testName) {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "barney", true, "barney08", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -214,7 +227,10 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"createActiveAccount"})
     public void createWithoutAuthn(String testName) {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(false, "test", true, "test", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -233,7 +249,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
 
     @Test(dataProvider = "testName", dependsOnMethods = {"createInactiveAccount"})
     public void createWithInactiveAccount(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "george", true, "george08", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -255,7 +273,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createActiveAccount"})
     public void createWithoutPassword(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "test", true, "", false);
         String identifier = BaseServiceTest.createIdentifier();
@@ -274,7 +294,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createActiveAccount"})
     public void createWithUnknownUser(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "foo", true, "bar", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -293,7 +315,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createActiveAccount"})
     public void createWithIncorrectPassword(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "test", true, "bar", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -312,7 +336,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createActiveAccount"})
     public void createWithIncorrectUserPassword(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "foo", true, "bar", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -332,7 +358,9 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createActiveAccount"})
     public void createWithoutTenant(String testName) {
-        banner(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName));
+        }
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
         collectionObjectClient.setAuth(true, "babybop", true, "babybop09", true);
         String identifier = BaseServiceTest.createIdentifier();
@@ -354,7 +382,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"create"})
     public void delete(String testName) {
-        setupDelete(testName);
+        setupDelete();
 
     }
 
@@ -362,8 +390,11 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create", "createWithInactiveAccount"})
     public void deleteAccounts(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
         AccountClient accountClient = new AccountClient();
         accountClient.setAuth(true, "test", true, "test", true);
         // Submit the request to the service and store the response.
index fa9242a64106d0b06faa27fc751a1ebb15f4edf9..c537834f6584a9e6ea6527e0e35ecda56af2354b 100644 (file)
@@ -88,8 +88,9 @@ import org.testng.annotations.BeforeClass;
  */
 public class AuthorizationServiceTest extends AbstractServiceTestImpl {
 
-    static private final Logger logger =
-            LoggerFactory.getLogger(AuthorizationServiceTest.class);
+    private final String CLASS_NAME = AuthorizationServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
     // Instance variables specific to this test.
     private String knownResourceId = null;
     private List<String> allResourceIdsCreated = new ArrayList();
@@ -242,7 +243,10 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
-        setupCreate(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupCreate();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -302,8 +306,11 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -334,7 +341,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     public void readNonExistent(String testName) throws Exception {
 
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
     }
 
     // ---------------------------------------------------------------
@@ -345,7 +352,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
-        setupReadList(testName);
+        setupReadList();
     }
 
     // Failure outcomes
@@ -358,14 +365,18 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void update(String testName) throws Exception {
-        setupUpdate(testName);
+        setupUpdate();
 
     }
 
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void updateNotAllowed(String testName) throws Exception {
-        setupUpdate(testName);
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        setupUpdate();
 
         DimensionClient client = new DimensionClient();
 
@@ -421,8 +432,12 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"updateNotAllowed"})
     public void deleteNotAllowed(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -446,8 +461,12 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"deleteNotAllowed"})
     public void delete(String testName) throws Exception {
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         DimensionClient client = new DimensionClient();
@@ -491,7 +510,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     @AfterClass(alwaysRun = true)
     public void cleanUp() {
-        setupDelete("cleanup");
+        setupDelete();
         String noTest = System.getProperty("noTestCleanup");
         if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
             if (logger.isDebugEnabled()) {
@@ -521,7 +540,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
 
     private String createPermission(String resName,
             List<PermissionAction> actions, EffectType effect) {
-        setupCreate("createPermission");
+        setupCreate();
         PermissionClient permClient = new PermissionClient();
         Permission permission = PermissionFactory.createPermissionInstance(resName,
                 "default permissions for " + resName,
@@ -540,7 +559,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     }
 
     private void deletePermission(String permId) {
-        setupDelete("deletePermission");
+        setupDelete();
         PermissionClient permClient = new PermissionClient();
         ClientResponse<Response> res = permClient.delete(permId);
         int statusCode = res.getStatus();
@@ -555,7 +574,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     }
 
     private String createRole(String roleName) {
-        setupCreate("createRole");
+        setupCreate();
         RoleClient roleClient = new RoleClient();
 
         Role role = RoleFactory.createRoleInstance(roleName,
@@ -574,7 +593,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     }
 
     private void deleteRole(String roleId) {
-        setupDelete("deleteRole");
+        setupDelete();
         RoleClient roleClient = new RoleClient();
         ClientResponse<Response> res = roleClient.delete(roleId);
         int statusCode = res.getStatus();
@@ -589,7 +608,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     }
 
     private String createAccount(String userName, String email) {
-        setupCreate("createAccount");
+        setupCreate();
         AccountClient accClient = new AccountClient();
         AccountsCommon account = AccountFactory.createAccountInstance(
                 userName, userName, userName, email,
@@ -608,7 +627,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     }
 
     private void deleteAccount(String accId) {
-        setupDelete("deleteAccount");
+        setupDelete();
         AccountClient accClient = new AccountClient();
         ClientResponse<Response> res = accClient.delete(accId);
         int statusCode = res.getStatus();
@@ -624,7 +643,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
 
     private String createAccountRole(AccountValue av,
             Collection<RoleValue> rvs) {
-        setupCreate("createAccountRole");
+        setupCreate();
 
         // Submit the request to the service and store the response.
         AccountRole accRole = AccountRoleFactory.createAccountRoleInstance(
@@ -645,7 +664,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
 
     private void deleteAccountRole(String screenName) {
         // Perform setup.
-        setupDelete("deleteAccountRole");
+        setupDelete();
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
@@ -666,7 +685,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
 
     private String createPermissionRole(PermissionValue pv,
             Collection<RoleValue> rvs) {
-        setupCreate("createPermissionRole");
+        setupCreate();
                 List<RoleValue> rvls = new ArrayList<RoleValue>();
         rvls.addAll(rvs);
         PermissionRole permRole = PermissionRoleFactory.createPermissionRoleInstance(
@@ -688,7 +707,7 @@ public class AuthorizationServiceTest extends AbstractServiceTestImpl {
     private void deletePermissionRole(String permId) {
 
         // Perform setup.
-        setupDelete("deletePermissionRole");
+        setupDelete();
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
index 7fc7e720e9a3cd0085ada27c16bedcbdb01b776d..befc9d0160532abc6771fdcbb6bc604837c79541 100644 (file)
@@ -58,8 +58,8 @@ import org.testng.annotations.Test;
  */
 public class VocabularyServiceTest extends AbstractServiceTestImpl {
 
-    private final Logger logger =
-        LoggerFactory.getLogger(VocabularyServiceTest.class);
+    private final String CLASS_NAME = VocabularyServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
 
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "vocabularies";
@@ -101,11 +101,14 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
-
+        
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
-        setupCreate(testName);
+        setupCreate();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -148,8 +151,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void createItem(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupCreate(testName);
+        setupCreate();
 
         VocabularyClient client = new VocabularyClient();
         HashMap<String, String> itemInfo = new HashMap<String, String>();
@@ -207,25 +213,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()) {
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithEmptyEntityBody(testName, CLASS_NAME);
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()) {
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -233,25 +242,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA; // Constant from base class.
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA; // Constant from base class.
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -259,25 +271,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupCreateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getServiceRootURL();
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupCreateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getServiceRootURL();
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -290,8 +305,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create"})
     public void read(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -322,39 +340,45 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"read"})
         public void readByName(String testName) throws Exception {
 
-            // Perform setup.
-            setupRead(testName);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupRead();
 
-            // Submit the request to the service and store the response.
-            ClientResponse<MultipartInput> res = client.read(knownResourceId);
-            int statusCode = res.getStatus();
+        // Submit the request to the service and store the response.
+        ClientResponse<MultipartInput> res = client.read(knownResourceId);
+        int statusCode = res.getStatus();
 
-            // Check the status code of the response: does it match
-            // the expected response(s)?
-            if(logger.isDebugEnabled()){
-                logger.debug(testName + ": status = " + statusCode);
-            }
-            Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-                    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-            Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
-            //FIXME: remove the following try catch once Aron fixes signatures
-            try {
-                MultipartInput input = (MultipartInput) res.getEntity();
-                VocabulariesCommon vocabulary = (VocabulariesCommon) extractPart(input,
-                        client.getCommonPartName(), VocabulariesCommon.class);
-                Assert.assertNotNull(vocabulary);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": status = " + statusCode);
         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        //FIXME: remove the following try catch once Aron fixes signatures
+        try {
+            MultipartInput input = (MultipartInput) res.getEntity();
+            VocabulariesCommon vocabulary = (VocabulariesCommon) extractPart(input,
+                    client.getCommonPartName(), VocabulariesCommon.class);
+            Assert.assertNotNull(vocabulary);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
     */
 
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"createItem", "read"})
     public void readItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupRead(testName);
+        setupRead();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -383,8 +407,12 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
             dependsOnMethods = {"updateItem"})
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-       setupUpdateWithWrongXmlSchema(testName);
+        testSetup(STATUS_BAD_REQUEST, ServiceRequestType.UPDATE);
+       // setupUpdateWithWrongXmlSchema(testName);
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -449,8 +477,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void readNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -471,8 +502,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"readItem", "readNonExistent"})
     public void readItemNonExistent(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadNonExistent(testName);
+        setupReadNonExistent();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -498,8 +532,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -546,7 +583,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         final String testName = "readItemList";
 
         // Perform setup.
-        setupReadList(testName);
+        setupReadList();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -601,8 +638,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"read"})
     public void update(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         VocabularyClient client = new VocabularyClient();
@@ -661,8 +701,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"readItem", "update"})
     public void updateItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdate(testName);
+        setupUpdate();
 
         // Retrieve the contents of a resource to update.
         VocabularyClient client = new VocabularyClient();
@@ -740,25 +783,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithEmptyEntityBody(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithEmptyEntityBody(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = "";
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithEmptyEntityBody();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = "";
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -766,25 +812,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithMalformedXml(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithMalformedXml(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = MALFORMED_XML_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug(testName + ": url=" + url +
-           " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithMalformedXml();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = MALFORMED_XML_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": url=" + url +
+               " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
     @Override
@@ -792,25 +841,28 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "update", "testSubmitRequest"})
     public void updateWithWrongXmlSchema(String testName) throws Exception {
 
-    // Perform setup.
-    setupUpdateWithWrongXmlSchema(testName);
-
-    // Submit the request to the service and store the response.
-    String method = REQUEST_TYPE.httpMethodName();
-    String url = getResourceURL(knownResourceId);
-    String mediaType = MediaType.APPLICATION_XML;
-    final String entity = WRONG_XML_SCHEMA_DATA;
-    int statusCode = submitRequest(method, url, mediaType, entity);
-
-    // Check the status code of the response: does it match
-    // the expected response(s)?
-    if(logger.isDebugEnabled()){
-        logger.debug("updateWithWrongXmlSchema: url=" + url +
-            " status=" + statusCode);
-     }
-    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
+        // Perform setup.
+        setupUpdateWithWrongXmlSchema();
+
+        // Submit the request to the service and store the response.
+        String method = REQUEST_TYPE.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        String mediaType = MediaType.APPLICATION_XML;
+        final String entity = WRONG_XML_SCHEMA_DATA;
+        int statusCode = submitRequest(method, url, mediaType, entity);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if(logger.isDebugEnabled()){
+            logger.debug("updateWithWrongXmlSchema: url=" + url +
+                " status=" + statusCode);
+         }
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+        invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
      */
 
@@ -820,8 +872,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -849,8 +904,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"updateItem", "testItemSubmitRequest"})
     public void updateNonExistentItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupUpdateNonExistent(testName);
+        setupUpdateNonExistent();
 
         // Submit the request to the service and store the response.
         // Note: The ID used in this 'create' call may be arbitrary.
@@ -885,8 +943,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
     public void delete(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -908,8 +969,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
             "updateItem", "verifyIllegalItemDisplayName"})
     public void deleteItem(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDelete(testName);
+        setupDelete();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -932,8 +996,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"delete"})
     public void deleteNonExistent(String testName) throws Exception {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -954,8 +1021,11 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         dependsOnMethods = {"deleteItem"})
     public void deleteNonExistentItem(String testName) {
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(testBanner(testName, CLASS_NAME));
+        }
         // Perform setup.
-        setupDeleteNonExistent(testName);
+        setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
         VocabularyClient client = new VocabularyClient();
@@ -983,8 +1053,8 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
     public void testSubmitRequest() {
 
         // Expected status code: 200 OK
-        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
-
+        setupRead();
+        
         // Submit the request to the service and store the response.
         String method = ServiceRequestType.READ.httpMethodName();
         String url = getResourceURL(knownResourceId);
@@ -996,7 +1066,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
             logger.debug("testSubmitRequest: url=" + url +
                 " status=" + statusCode);
         }
-        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
 
     }