]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6770: Late commit after all tests passing. More changes for RESTEasy client...
authorremillet <remillet@yahoo.com>
Fri, 14 Aug 2015 01:29:38 +0000 (18:29 -0700)
committerremillet <remillet@yahoo.com>
Fri, 14 Aug 2015 01:29:38 +0000 (18:29 -0700)
94 files changed:
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/CollectionSpaceIntegrationTest.java
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java
services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/CollectionSpacePerformanceTest.java
services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountProxy.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountRoleClient.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountRoleProxy.java
services/account/client/src/main/java/org/collectionspace/services/client/TenantClient.java
services/account/client/src/main/java/org/collectionspace/services/client/TenantProxy.java
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/main/java/org/collectionspace/services/client/PermissionClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionRoleClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionRoleProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RoleClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RolePermissionClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RolePermissionProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RoleProxy.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/blob/client/src/main/java/org/collectionspace/services/client/BlobClient.java
services/blob/client/src/main/java/org/collectionspace/services/client/BlobProxy.java
services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java
services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobScaleTest.java
services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobServiceTest.java
services/client/pom.xml
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClientUtils.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceCommonListPoxProxy.java
services/client/src/main/java/org/collectionspace/services/client/TestServiceClient.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/workflow/WorkflowClient.java
services/collectionobject/client/src/main/java/org/collectionspace/services/client/CollectionObjectClient.java
services/collectionobject/client/src/main/java/org/collectionspace/services/client/CollectionObjectProxy.java
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto-unified.xml
services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckAuthRefsTest.java
services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckServiceTest.java
services/contact/client/src/test/java/org/collectionspace/services/client/test/ContactServiceTest.java
services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java
services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java
services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java
services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionDocumentModelHandler.java
services/exhibition/client/src/test/java/org/collectionspace/services/client/test/ExhibitionServiceTest.java
services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java
services/id/client/src/main/java/org/collectionspace/services/client/IdProxy.java
services/id/service/src/test/java/org/collectionspace/services/id/IdServiceTest.java
services/intake/client/src/main/java/org/collectionspace/services/client/IntakeProxy.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/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/media/client/src/main/java/org/collectionspace/services/client/MediaClient.java
services/media/client/src/main/java/org/collectionspace/services/client/MediaProxy.java
services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java
services/media/client/src/test/java/org/collectionspace/services/client/test/MediaServiceTest.java
services/movement/client/src/main/java/org/collectionspace/services/client/MovementClient.java
services/movement/client/src/main/java/org/collectionspace/services/client/MovementProxy.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/MovementSortByTest.java
services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java
services/organization/client/pom.xml
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.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/pom.xml
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/place/client/src/test/java/org/collectionspace/services/client/test/PlaceAuthorityServiceTest.java
services/publicitem/client/src/test/java/org/collectionspace/services/client/test/PublicItemServiceTest.java
services/relation/client/src/main/java/org/collectionspace/services/client/RelationClient.java
services/relation/client/src/main/java/org/collectionspace/services/client/RelationProxy.java
services/report/client/src/main/java/org/collectionspace/services/client/ReportClient.java
services/report/client/src/main/java/org/collectionspace/services/client/ReportProxy.java
services/report/client/src/test/java/org/collectionspace/services/client/test/ReportServiceTest.java
services/security/client/pom.xml
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/security/client/src/test/java/org/collectionspace/services/security/client/test/MultiTenancyTest.java
services/servicegroup/client/src/test/java/org/collectionspace/services/client/test/ServiceGroupServiceTest.java
services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java
services/valuationcontrol/client/src/test/java/org/collectionspace/services/client/test/ValuationcontrolServiceTest.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java
services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java

index c7b598880e3a96c741ecefa44c6ec7eea4657aa5..8fe6645c7cde57ed0adb63960142ea2b3aa65882 100644 (file)
@@ -42,7 +42,6 @@ import org.collectionspace.services.collectionobject.TitleGroupList;
 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.relation.RelationsCommon;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * The Class CollectionSpaceIntegrationTest.
@@ -138,26 +137,6 @@ public abstract class CollectionSpaceIntegrationTest {
                return Long.toString(identifier);
        }
 
-       /**
-        * Extract id.
-        * 
-        * @param res the res
-        * 
-        * @return the string
-        */
-       String extractId(ClientResponse<Response> res) {
-               String result = null;
-               
-               MultivaluedMap mvm = res.getMetadata();
-               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
-               verbose("extractId:uri=" + uri);
-               String[] segments = uri.split("/");
-               result = segments[segments.length - 1];
-               verbose("id=" + result);
-               
-               return result;
-       }
-       
        String extractId(Response res) {
                String result = null;
                
index 6e8c33e3be580f127ab0f074b063b3e504668db3..22eea86d83ebdd5b0022dc4812ddbe95582519ea 100644 (file)
@@ -38,8 +38,6 @@ import org.testng.annotations.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.jboss.resteasy.client.ClientResponse;
-
 import org.collectionspace.services.client.CollectionObjectClient;
 import org.collectionspace.services.client.DimensionClient;
 import org.collectionspace.services.client.DimensionFactory;
@@ -190,6 +188,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                Response workflowResponse = dimensionClient.updateWorkflowWithTransition(
                                dimensionCsid1, WorkflowClient.WORKFLOWTRANSITION_LOCK);
            System.out.println("Locked dimension record with CSID=" + dimensionCsid1);
+           workflowResponse.close();
            
            // Finally, try to delete the relationship
            
@@ -204,6 +203,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            // Also, try to soft-delete.  This should also fail.
                workflowResponse = dimensionClient.updateWorkflowWithTransition(dimensionCsid1, WorkflowClient.WORKFLOWTRANSITION_DELETE);
            System.out.println("Locked dimension record with CSID=" + dimensionCsid1);
+           workflowResponse.close();
        }
        
        @Test void createCollectionObjectRelationshipToManyDimensions() {
@@ -461,7 +461,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            // Now try to retrieve the Intake record of the CollectionObject.
            //
            String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.toString();
-           ClientResponse<RelationsCommonList> resultResponse = relationClient.readList(
+           Response resultResponse = relationClient.readList(
                        collectionObjectCsid,
                        null, //CollectionobjectsCommon.class.getSimpleName(),
                        predicate,
@@ -470,7 +470,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
         RelationsCommonList relationList = null;
            try {
                Assert.assertEquals(resultResponse.getStatus(), Response.Status.OK.getStatusCode());
-               relationList = resultResponse.getEntity();
+               relationList = resultResponse.readEntity(RelationsCommonList.class);
            } finally {
                resultResponse.close();
            }
@@ -492,7 +492,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                        multiPartResponse = relationClient.read(foundCsid);
                        int responseStatus = multiPartResponse.getStatus();
                        Assert.assertEquals(responseStatus, Response.Status.OK.getStatusCode());
-                       PoxPayloadIn input = new PoxPayloadIn((String)multiPartResponse.getEntity());
+                       PoxPayloadIn input = new PoxPayloadIn(multiPartResponse.readEntity(String.class));
                        resultRelation = (RelationsCommon) extractPart(input,
                                        relationClient.getCommonPartName(),
                                        RelationsCommon.class);
@@ -591,7 +591,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.toString();
                RelationsCommonList relationList = null;
            for (String collectionObjectCsid : collectionObjectIDList) {
-                   ClientResponse<RelationsCommonList> resultResponse = relationClient.readList(
+                   Response resultResponse = relationClient.readList(
                                intakeCsid,
                                null, //IntakesCommon.class.getSimpleName(), //subject
                                predicate,
@@ -600,7 +600,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
 
                    try {
                        Assert.assertEquals(resultResponse.getStatus(), Response.Status.OK.getStatusCode());
-                       relationList = resultResponse.getEntity();
+                       relationList = resultResponse.readEntity(RelationsCommonList.class);
                    } finally {
                        resultResponse.close();
                    }
@@ -621,7 +621,7 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
                                multiPartResponse = relationClient.read(foundCsid);
                                int responseStatus = multiPartResponse.getStatus();
                                Assert.assertEquals(responseStatus, Response.Status.OK.getStatusCode());
-                               PoxPayloadIn input = new PoxPayloadIn((String)multiPartResponse.getEntity());
+                               PoxPayloadIn input = new PoxPayloadIn(multiPartResponse.readEntity(String.class));
                                resultRelation = (RelationsCommon) extractPart(input,
                                                relationClient.getCommonPartName(),
                                                RelationsCommon.class);
index 282013877c24b5a9c7ebfead72985eb88addf742..77c13bdc3c28f62ad9086673e8f1ea60ffdb8080 100644 (file)
@@ -41,7 +41,6 @@ import org.collectionspace.services.collectionobject.TitleGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.relation.RelationsCommon;
 import org.collectionspace.services.relation.RelationshipType;
-import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.InputPart;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 
@@ -139,26 +138,6 @@ public abstract class CollectionSpacePerformanceTest {
                return Long.toString(identifier);
        }
 
-       /**
-        * Extract id.
-        * 
-        * @param res the res
-        * 
-        * @return the string
-        */
-       String extractId(ClientResponse<Response> res) {
-               String result = null;
-               
-               MultivaluedMap mvm = res.getMetadata();
-               String uri = (String) ((ArrayList) mvm.get("Location")).get(0);
-               verbose("extractId:uri=" + uri);
-               String[] segments = uri.split("/");
-               result = segments[segments.length - 1];
-               verbose("id=" + result);
-               
-               return result;
-       }
-       
        String extractId(Response res) {
                String result = null;
                
index 415d9a0b4e150c811bf0e997b6c6fd18d1cb901d..387ce3f4b51a76acc7e4053b5e08af935c0e7eca 100644 (file)
@@ -28,13 +28,13 @@ import java.util.Random;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.jboss.resteasy.util.HttpResponseCodes;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.util.HttpResponseCodes;
+
 import org.collectionspace.services.client.AbstractCommonListUtils;
 import org.collectionspace.services.client.CollectionObjectClient;
 import org.collectionspace.services.client.PayloadOutputPart;
@@ -86,7 +86,7 @@ public class PerformanceTest extends CollectionSpacePerformanceTest {
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
 
         long totalTime = 0;
-        ClientResponse<Response> response;
+        Response response;
         for (int i = 0; i < numOfCalls; i++) {
             Date startTime = new Date();
             response = collectionObjectClient.roundtrip(0);
index 9bbe68de867b7341dc9e5cb292906c7f5df81dc3..9f74353e0fb2706feace065d1e7211f8e146e2ac 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.account.AccountsCommonList;
@@ -74,11 +73,11 @@ public class AccountClient extends AbstractServiceClientImpl<AccountsCommonList,
      * @return response
      * @see org.collectionspace.hello.client.AccountProxy#readList()
      */
-    public ClientResponse<AccountsCommonList> readList() {
+    public Response readList() {
         return getProxy().readList();
     }
 
-    public ClientResponse<AccountsCommonList> readSearchList(String screenName, String uid, String email) {
+    public Response readSearchList(String screenName, String uid, String email) {
         return getProxy().readSearchList(screenName, uid, email);
     }
 
@@ -87,7 +86,7 @@ public class AccountClient extends AbstractServiceClientImpl<AccountsCommonList,
      * @return response
      * @see org.collectionspace.hello.client.AccountProxy#getAccount(java.lang.String)
      */
-    public ClientResponse<AccountsCommon> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
 
@@ -97,7 +96,7 @@ public class AccountClient extends AbstractServiceClientImpl<AccountsCommonList,
      * @return response
      * @see org.collectionspace.hello.client.AccountProxy#create(org.collectionspace.services.account.AccountsCommon)
      */
-    public ClientResponse<Response> create(AccountsCommon multipart) {
+    public Response create(AccountsCommon multipart) {
         return getProxy().create(multipart);
     }
 
@@ -108,7 +107,7 @@ public class AccountClient extends AbstractServiceClientImpl<AccountsCommonList,
      * @return response
      * @see org.collectionspace.hello.client.AccountProxy#updateAccount(java.lang.Long, org.collectionspace.services.account.AccountsCommon)
      */
-    public ClientResponse<AccountsCommon> update(String csid, AccountsCommon multipart) {
+    public Response update(String csid, AccountsCommon multipart) {
         return getProxy().update(csid, multipart);
     }
 }
index dd13fe7c0f979b0e3d85c6c5e0f48a0049d27f0b..95bf2edfe8edc009093eced069c913f6ea42930a 100644 (file)
@@ -38,7 +38,6 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.account.AccountsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -50,23 +49,23 @@ public interface AccountProxy extends CollectionSpaceProxy<AccountsCommonList> {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AccountsCommonList> readList();
+    Response readList();
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AccountsCommonList> readSearchList(@QueryParam("sn") String screenName, @QueryParam("uid") String uid, @QueryParam("email") String email);
+    Response readSearchList(@QueryParam("sn") String screenName, @QueryParam("uid") String uid, @QueryParam("email") String email);
 
     //(C)reate
     @POST
-    ClientResponse<Response> create(AccountsCommon multipart);
+    Response create(AccountsCommon multipart);
 
     //(R)ead
     @GET
     @Path("/{csid}")
-    ClientResponse<AccountsCommon> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
 
     //(U)pdate
     @PUT
     @Path("/{csid}")
-    ClientResponse<AccountsCommon> update(@PathParam("csid") String csid, AccountsCommon multipart);    
+    Response update(@PathParam("csid") String csid, AccountsCommon multipart);    
 }
index 2b771d5b773b482dbf240817b0cf35a35afd5186..7bbba3d1effc66a3418a9dc7876ea4aeb69b9797 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.authorization.AccountRole;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -68,7 +67,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * @return
      * @see 
      */
-    public ClientResponse<AccountRole> read(String csid, String arcsid) {
+    public Response read(String csid, String arcsid) {
         return getProxy().read(csid, arcsid);
     }
 
@@ -79,7 +78,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * @param arcsid the arcsid
      * @return the client response
      */
-    public ClientResponse<AccountRole> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
 
@@ -89,7 +88,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * @return
      * @see 
      */
-    public ClientResponse<Response> create(String csid, AccountRole accRole) {
+    public Response create(String csid, AccountRole accRole) {
         return getProxy().create(csid, accRole);
     }
     
@@ -99,7 +98,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * 
      */
        @Override
-       public ClientResponse<AccountRole> update(String csid, AccountRole payload) {
+       public Response update(String csid, AccountRole payload) {
                throw new RuntimeException("You cannot update an AccountRole object.  You must delete and recreate it instead.");
        }
 
@@ -109,7 +108,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * @return
      * @see 
      */
-    public ClientResponse<Response> delete(String csid, AccountRole accRole) {
+    public Response delete(String csid, AccountRole accRole) {
         return getProxy().delete(csid, "delete", accRole);
     }
 
@@ -117,13 +116,13 @@ public class AccountRoleClient extends AbstractServiceClientImpl<AbstractCommonL
      * Not supported.
      */
        @Override
-       public ClientResponse<Response> create(AccountRole payload) {
+       public Response create(AccountRole payload) {
                // Use the create(String csid, AccountRole accRole) method instead
                throw new UnsupportedOperationException();
        }
 
        @Override
-       public ClientResponse<AbstractCommonList> readList() {
+       public Response readList() {
                throw new UnsupportedOperationException();
        }
 }
index 86161236464283197d40dfe5361bd9763747eb33..8267c38bd1376963cdc6ee47c0c9a5c8cf9316fc 100644 (file)
@@ -39,7 +39,6 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.authorization.AccountRole;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -52,34 +51,34 @@ public interface AccountRoleProxy extends CollectionSpaceProxy<AbstractCommonLis
     //(C)reate
     @POST
     @Path("/{csid}/accountroles")
-    ClientResponse<Response> create(@PathParam("csid") String csid, AccountRole accRole);
+    Response create(@PathParam("csid") String csid, AccountRole accRole);
 
     //(R)ead
     @GET
     @Path("/{csid}/accountroles")
-    ClientResponse<AccountRole> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
 
     //(R)ead
     @GET
     @Path("/{csid}/accountroles/{arcsid}")
-    ClientResponse<AccountRole> read(@PathParam("csid") String csid,
+    Response read(@PathParam("csid") String csid,
             @PathParam("arcsid") String arcsid);
 
     //(D)elete
     @POST
     @Path("/{csid}/accountroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid,
+    Response delete(@PathParam("csid") String csid,
             @QueryParam("_method") String method,
             AccountRole accRole);
 
     //(U)pdate
     @PUT
     @Path("/{csid}/accountroles")
-    ClientResponse<AccountRole> update(@PathParam("csid") String csid, AccountRole role);
+    Response update(@PathParam("csid") String csid, AccountRole role);
     
     //(D)elete
     @Override
        @DELETE
     @Path("/{csid}/accountroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
+    Response delete(@PathParam("csid") String csid);
 }
index a27e6c0998c61bcd04e739b28589e3c4f8587a99..254a901967260627c53c10676e5f6bccb51af8f2 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.account.Tenant;
 import org.collectionspace.services.account.TenantsList;
@@ -69,11 +68,11 @@ public class TenantClient extends AbstractServiceClientImpl<TenantsList, Tenant,
      * @return response
      * @see org.collectionspace.hello.client.TenantProxy#readList()
      */
-    public ClientResponse<TenantsList> readList() {
+    public Response readList() {
         return getProxy().readList();
     }
 
-    public ClientResponse<TenantsList> readSearchList(String name, String disabled) {
+    public Response readSearchList(String name, String disabled) {
         return getProxy().readSearchList(name, disabled);
     }
 
@@ -82,7 +81,7 @@ public class TenantClient extends AbstractServiceClientImpl<TenantsList, Tenant,
      * @return response
      * @see org.collectionspace.hello.client.TenantProxy#getTenant(java.lang.String)
      */
-    public ClientResponse<Tenant> read(String id) {
+    public Response read(String id) {
         return getProxy().read(id);
     }
 
@@ -92,7 +91,7 @@ public class TenantClient extends AbstractServiceClientImpl<TenantsList, Tenant,
      * @return response
      * @see org.collectionspace.hello.client.TenantProxy#create(org.collectionspace.services.account.Tenant)
      */
-    public ClientResponse<Response> create(Tenant multipart) {
+    public Response create(Tenant multipart) {
         return getProxy().create(multipart);
     }
 
@@ -103,7 +102,7 @@ public class TenantClient extends AbstractServiceClientImpl<TenantsList, Tenant,
      * @return response
      * @see org.collectionspace.hello.client.TenantProxy#updateTenant(java.lang.Long, org.collectionspace.services.account.Tenant)
      */
-    public ClientResponse<Tenant> update(String id, Tenant multipart) {
+    public Response update(String id, Tenant multipart) {
         return getProxy().update(id, multipart);
     }
 }
index 43bfbfb66465c633dd1fcaedb51fda09eceff408..1e2530eb0bb2c93145e4802f4691afb827670b94 100644 (file)
@@ -38,7 +38,6 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.account.Tenant;
 import org.collectionspace.services.account.TenantsList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -50,25 +49,25 @@ public interface TenantProxy extends CollectionSpaceProxy<TenantsList> {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<TenantsList> readList();
+    Response readList();
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<TenantsList> readSearchList(
+    Response readSearchList(
                                @QueryParam("name") String name, 
                                @QueryParam("disabled") String disabled);
 
     //(C)reate
     @POST
-    ClientResponse<Response> create(Tenant multipart);
+    Response create(Tenant multipart);
 
     //(R)ead
     @GET
     @Path("/{csid}")
-    ClientResponse<Tenant> read(@PathParam("id") String id);
+    Response read(@PathParam("id") String id);
 
     //(U)pdate
     @PUT
     @Path("/{csid}")
-    ClientResponse<Tenant> update(@PathParam("id") String id, Tenant multipart);    
+    Response update(@PathParam("id") String id, Tenant multipart);    
 }
index 79340c43d970a174b4782a7aba6312cb7a9f2580..c31019d4b0afcbf57767dbfa4e8a7cb58bb7fbd5 100644 (file)
@@ -46,7 +46,6 @@ import org.collectionspace.services.client.test.ServiceRequestType;
 
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 import org.testng.annotations.AfterClass;
@@ -167,7 +166,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
         AccountRole accRole = createAccountRoleInstance(av,
                 roleValues.values(), true, true);
         AccountRoleClient client = new AccountRoleClient();
-        ClientResponse<Response> res = client.create(av.getAccountId(), accRole);
+        Response res = client.create(av.getAccountId(), accRole);
         try {
                assertStatusCode(res, testName);
             knownResourceId = av.getAccountId();
@@ -177,7 +176,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
             }
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
        }
@@ -194,13 +193,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
-        ClientResponse<AccountRole> res = client.read(
+        Response res = client.read(
                 accValues.get("acc-role-user2").getAccountId());
         try {
             // Check the status code of the response: does it match
             // the expected response(s)?
             assertStatusCode(res, testName);
-            AccountRole output = res.getEntity();
+            AccountRole output = res.readEntity(AccountRole.class);
             if(logger.isDebugEnabled()) {
                org.collectionspace.services.authorization.ObjectFactory objectFactory = new org.collectionspace.services.authorization.ObjectFactory();
                String sOutput = objectAsXmlString(objectFactory.createAccountRole(output), AccountRole.class);
@@ -208,7 +207,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
             }
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
     }
@@ -232,12 +231,12 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
                        roleValues.values(), true, true);
                AccountRoleClient client = new AccountRoleClient();
                setupCreate();          
-               ClientResponse<Response> res = client.create(av.getAccountId(), accRole);
+               Response res = client.create(av.getAccountId(), accRole);
                try {
                        assertStatusCode(res, testName);
                } finally {
                        if (res != null) {
-                               res.releaseConnection();
+                               res.close();
                        }
                }
         }
@@ -250,13 +249,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
         
         // Submit the request to the service and store the response.
         setupRead();        
-        ClientResponse<AccountRole> res = roleClient.readRoleAccounts(
+        Response res = roleClient.readRoleAccounts(
                        roleValues.get("ROLE_CO1").getRoleId());
         try {
             // Check the status code of the response: does it match
             // the expected response(s)?
             assertStatusCode(res, testName);
-            AccountRole output = res.getEntity();
+            AccountRole output = res.readEntity(AccountRole.class);
             
             // Now verify that the role has 2 accounts associate to it.
             Assert.assertEquals(output.getAccount().size(), 1);
@@ -266,7 +265,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
             }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }    
@@ -325,27 +324,27 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
         //
         AccountRoleClient client = new AccountRoleClient();
         setupRead();        
-        ClientResponse<AccountRole> readResponse = client.read(
+        Response readResponse = client.read(
                 accValues.get("acc-role-user1").getAccountId());
         AccountRole toDelete = null;
         try {
                assertStatusCode(readResponse, testName);
-               toDelete = readResponse.getEntity();
+               toDelete = readResponse.readEntity(AccountRole.class);
                Assert.assertNotNull(toDelete);
         } finally {
                if (readResponse != null) {
-                       readResponse.releaseConnection();
+                       readResponse.close();
                }
         }
 
         setupDelete();                
-        ClientResponse<Response> res = client.delete(
+        Response res = client.delete(
                 toDelete.getAccount().get(0).getAccountId(), toDelete); // delete form #1
         try {
                assertStatusCode(readResponse, testName);
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
         //
@@ -361,10 +360,10 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
                        accValues.get("acc-role-user1").getAccountId());
         toDelete = null;
         try {
-               toDelete = readResponse.getEntity();
+               toDelete = readResponse.readEntity(AccountRole.class);
         } finally {
                if (readResponse != null) {
-                       readResponse.releaseConnection();
+                       readResponse.close();
                }
         }
 
@@ -498,13 +497,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
         String result = null;
         
         setupCreate();
-        ClientResponse<Response> res = accClient.create(account);
+        Response res = accClient.create(account);
         try {
                assertStatusCode(res, "CreateAccount");
                result = extractId(res);
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
 
@@ -516,11 +515,10 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
        if (prebuiltAdminCSID == null) {
             setupReadList();
             AccountClient client = new AccountClient();
-            ClientResponse<AccountsCommonList> res =
-                    client.readSearchList(null, this.prebuiltAdminUserId, null);
+            Response res = client.readSearchList(null, this.prebuiltAdminUserId, null);
             try {
                    assertStatusCode(res, "findPrebuiltAdminAccount");
-                   AccountsCommonList list = res.getEntity();
+                   AccountsCommonList list = res.readEntity(AccountsCommonList.class);
                    List<AccountListItem> items = list.getAccountListItem();
                    Assert.assertEquals(1, items.size(), "Found more than one Admin account!");
                    AccountListItem item = items.get(0);
@@ -530,7 +528,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
                    }
             } finally {
                 if (res != null) {
-                    res.releaseConnection();
+                    res.close();
                 }              
             }
        }
@@ -568,13 +566,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl<AccountRole,
                        roleName, //the display name
                 "role for " + roleName, true);
         setupCreate();
-        ClientResponse<Response> res = roleClient.create(role);
+        Response res = roleClient.create(role);
         try {
                assertStatusCode(res, "CreateRole");
                result = extractId(res);
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
         
index 2c39ac72b4209137608c84416361f521a0e26be7..4c91ec3e297409f02248ca0c40f2b436dc699f20 100644 (file)
@@ -26,7 +26,6 @@ import java.util.List;
 
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.client.AccountClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.account.AccountsCommon;
@@ -135,14 +134,18 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                 "barney@dinoland.com",
                 client.getTenantId(), true, false, true, true);
 
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -160,15 +163,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "hithere08", "babybop@dinoland.com",
                 client.getTenantId(), true, true, true, true);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -186,15 +193,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "hithere08", "babybop@dinoland.com",
                 client.getTenantId(), true, false, false, true);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -212,15 +223,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "hithere08", "babybop.dinoland.com",
                 client.getTenantId(), true, false, true, true);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -238,15 +253,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "hithere08", "babybop@dinoland.com",
                 client.getTenantId(), false, false, true, true);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -264,15 +283,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "shpswd", "babybop@dinoland.com",
                 client.getTenantId(), true, false, true, true);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -290,15 +313,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account =
                 createAccountInstance("babybop", "babybop", "hithere08", "babybop/dinoland.com",
                 client.getTenantId(), false, true, false, false);
-        ClientResponse<Response> res = client.create(account);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(account);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     //
@@ -312,34 +339,46 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         AccountsCommon account1 =
                 createAccountInstance("curious", "curious", "hithere08", "curious@george.com",
                 client.getTenantId(), true, false, true, true);
-        ClientResponse<Response> res = client.create(account1);
-        int statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        allResourceIdsCreated.add(extractId(res));
+        Response res = client.create(account1);
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               allResourceIdsCreated.add(extractId(res));
+        } finally {
+               res.close();
+        }
 
         AccountsCommon account2 =
                 createAccountInstance("tom", "tom", "hithere09", "tom@jerry.com",
                 client.getTenantId(), true, false, true, true);
         res = client.create(account2);
-        statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        allResourceIdsCreated.add(extractId(res));
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               allResourceIdsCreated.add(extractId(res));
+        } finally {
+               res.close();
+        }
 
         AccountsCommon account3 =
                 createAccountInstance("mj", "mj", "hithere10", "mj@dinoland.com",
                 client.getTenantId(), true, false, true, true);
         res = client.create(account3);
-        statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        allResourceIdsCreated.add(extractId(res));
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               allResourceIdsCreated.add(extractId(res));
+        } finally {
+               res.close();
+        }
     }
 
     //
@@ -386,11 +425,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommonList> res =
+        Response res =
                 client.readSearchList("tom", null, null);
         try {
                assertStatusCode(res, testName);                
-               AccountsCommonList list = res.getEntity();      
+               AccountsCommonList list = res.readEntity(AccountsCommonList.class);     
                Assert.assertEquals(1, list.getAccountListItem().size());
                // Optionally output additional data about list members for debugging.
                boolean iterateThroughList = true;
@@ -399,7 +438,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -423,10 +462,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommonList> res = client.readSearchList(null, "tom", null);
+        Response res = client.readSearchList(null, "tom", null);
         try {
                assertStatusCode(res, testName);                
-               AccountsCommonList list = res.getEntity();
+               AccountsCommonList list = res.readEntity(AccountsCommonList.class);
                Assert.assertEquals(1, list.getAccountListItem().size());
                // Optionally output additional data about list members for debugging.
                boolean iterateThroughList = true;
@@ -435,7 +474,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -453,10 +492,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommonList> res = client.readSearchList(null, null, "dinoland");
+        Response res = client.readSearchList(null, null, "dinoland");
         try {
                assertStatusCode(res, testName);                
-               AccountsCommonList list = res.getEntity();
+               AccountsCommonList list = res.readEntity(AccountsCommonList.class);
                Assert.assertEquals(2, list.getAccountListItem().size());
                // Optionally output additional data about list members for debugging.
                boolean iterateThroughList = true;
@@ -465,7 +504,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -483,10 +522,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommonList> res = client.readSearchList("tom", null, "jerry");
+        Response res = client.readSearchList("tom", null, "jerry");
         try {
                assertStatusCode(res, testName);
-               AccountsCommonList list = res.getEntity();
+               AccountsCommonList list = res.readEntity(AccountsCommonList.class);
                Assert.assertEquals(1, list.getAccountListItem().size());
                // Optionally output additional data about list members for debugging.
                boolean iterateThroughList = true;
@@ -495,7 +534,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -516,18 +555,22 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         setupUpdate();
 
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommon> res = client.read(knownResourceId);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": read status = " + res.getStatus());
-        }
-        Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": got object to update password with ID: " + knownResourceId);
+        Response res = client.read(knownResourceId);
+        AccountsCommon accountFound = null;
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": got object to update password with ID: " + knownResourceId);
+               }
+               accountFound = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountFound);
+        } finally {
+               res.close();
         }
-        AccountsCommon accountFound =
-                (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountFound);
 
         //create a new account object to test partial updates
         AccountsCommon accountToUpdate = new AccountsCommon();
@@ -544,20 +587,24 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         // Submit the request to the service and store the response.
         res = client.update(knownResourceId, accountToUpdate);
         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);
+        try {
+               // Check the status code of the response: does it match the expected response(s)?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               AccountsCommon accountUpdated = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountUpdated);
+       
+//             Assert.assertEquals(accountUpdated.getPassword(),
+//                     accountFound.getPassword(),
+//                     "Data in updated object did not match submitted data.");
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        AccountsCommon accountUpdated = (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountUpdated);
-
-//        Assert.assertEquals(accountUpdated.getPassword(),
-//                accountFound.getPassword(),
-//                "Data in updated object did not match submitted data.");
     }
 
     /**
@@ -584,16 +631,19 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         AccountClient client = new AccountClient();
         // Submit the request to the service and store the response.
-        ClientResponse<AccountsCommon> res = client.update(knownResourceId, accountToUpdate);
-        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);
+        Response res = client.update(knownResourceId, accountToUpdate);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
-
     }
 
     /**
@@ -607,16 +657,21 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         // Perform setup.
         setupUpdate();
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommon> res = client.read(knownResourceId);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": read status = " + res.getStatus());
-        }
-        Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": got object to update password with ID: " + knownResourceId);
+        Response res = client.read(knownResourceId);
+        AccountsCommon accountFound = null;
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": got object to update password with ID: " + knownResourceId);
+               }
+               accountFound = res.readEntity(AccountsCommon.class);
+        } finally {
+               res.close();
         }
-        AccountsCommon accountFound = (AccountsCommon) res.getEntity();
 
         AccountsCommon accountToUpdate = new AccountsCommon();
         accountToUpdate.setCsid(knownResourceId);
@@ -633,14 +688,18 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         res = client.update(knownResourceId, accountToUpdate);
-        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);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
     
     private void findPrebuiltAdminAccount() {
@@ -648,11 +707,10 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
        if (prebuiltAdminCSID == null) {
             setupReadList();
             AccountClient client = new AccountClient();
-            ClientResponse<AccountsCommonList> res =
-                    client.readSearchList(null, this.prebuiltAdminUserId, null);
+            Response res = client.readSearchList(null, this.prebuiltAdminUserId, null);
             try {
                    assertStatusCode(res, "findPrebuiltAdminAccount");
-                   AccountsCommonList list = res.getEntity();
+                   AccountsCommonList list = res.readEntity(AccountsCommonList.class);
                    List<AccountListItem> items = list.getAccountListItem();
                    Assert.assertEquals(1, items.size(), "Found more than one Admin account!");
                    AccountListItem item = items.get(0);
@@ -662,7 +720,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                    }
             } finally {
                if (res != null) {
-                    res.releaseConnection();
+                    res.close();
                 }
             }
        }
@@ -676,18 +734,23 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         setupUpdate();
 
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommon> res = client.read(prebuiltAdminCSID);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": read status = " + res.getStatus());
-        }
-        Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-
-        if (logger.isDebugEnabled()) {
-            logger.debug("Did get on Admin Account to update with ID: " + prebuiltAdminCSID);
+        Response res = client.read(prebuiltAdminCSID);
+        AccountsCommon accountFound = null;
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug("Did get on Admin Account to update with ID: " + prebuiltAdminCSID);
+               }
+               accountFound = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountFound);
+        } finally {
+               res.close();
         }
-        AccountsCommon accountFound = (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountFound);
-
+        
         //create a new account object to test partial updates
         AccountsCommon accountToUpdate = new AccountsCommon();
         accountToUpdate.setCsid(prebuiltAdminCSID);
@@ -702,21 +765,25 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         res = client.update(prebuiltAdminCSID, accountToUpdate);
-        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);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               // Note that the error is not returned, it is just ignored
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               AccountsCommon accountUpdated = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountUpdated);
+       
+               Assert.assertFalse(accountUpdated.getEmail().equals(accountToUpdate.getEmail()),
+                       "Admin Account (with metadata lock) allowed update to change the email!");
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        // Note that the error is not returned, it is just ignored
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        AccountsCommon accountUpdated = (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountUpdated);
-
-       Assert.assertFalse(accountUpdated.getEmail().equals(accountToUpdate.getEmail()),
-               "Admin Account (with metadata lock) allowed update to change the email!");
     }
     
     
@@ -730,7 +797,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                                client.getTenantId(), true, false, true, true);
         account.setMetadataProtection(AccountClient.IMMUTABLE);
         account.setRolesProtection(AccountClient.IMMUTABLE);
-        ClientResponse<Response> res = client.create(account);
+        Response res = client.create(account);
         String testResourceId = null;
         try {
                assertStatusCode(res, testName);
@@ -743,17 +810,17 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
         setupRead();
 
         // Submit the request to the service and store the response.
-        ClientResponse<AccountsCommon> accountRes = client.read(testResourceId);
+        Response accountRes = client.read(testResourceId);
         try {
                assertStatusCode(accountRes, testName);
-               AccountsCommon accountRead = (AccountsCommon) accountRes.getEntity();
+               AccountsCommon accountRead = accountRes.readEntity(AccountsCommon.class);
                Assert.assertNotNull(accountRead);
                String mdProtection = accountRead.getMetadataProtection();
                String rolesProtection = accountRead.getRolesProtection();
@@ -767,7 +834,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                                "Account allowed create to set the perms protection flag.");
         } finally {
                if (accountRes != null) {
-                       accountRes.releaseConnection();
+                       accountRes.close();
             }
         }
         
@@ -782,11 +849,11 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
        accountRes = client.update(testResourceId, accountToUpdate);
        try {
                assertStatusCode(accountRes, testName);
-               AccountsCommon accountUpdated = (AccountsCommon) accountRes.getEntity();
+               AccountsCommon accountUpdated = accountRes.readEntity(AccountsCommon.class);
                Assert.assertNotNull(accountUpdated);
                if (logger.isDebugEnabled()) {
                    logger.debug(testName + "Updated account: ");
-                   logger.debug(objectAsXmlString(accountUpdated,AccountsCommon.class));
+                   logger.debug(objectAsXmlString(accountUpdated, AccountsCommon.class));
                }
                Assert.assertFalse(
                                AccountClient.IMMUTABLE.equalsIgnoreCase(accountUpdated.getMetadataProtection()),
@@ -796,7 +863,7 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
                                "Account allowed update of the roles protection flag.");
        } finally {
                if (accountRes != null) {
-                       accountRes.releaseConnection();
+                       accountRes.close();
             }
        }
     }
@@ -813,17 +880,22 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         setupUpdate();
 
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommon> res = client.read(knownResourceId);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": read status = " + res.getStatus());
-        }
-        Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-
-        if (logger.isDebugEnabled()) {
-            logger.debug("got object to update with ID: " + knownResourceId);
+        Response res = client.read(knownResourceId);
+        AccountsCommon accountFound = null;
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug("got object to update with ID: " + knownResourceId);
+               }
+               accountFound = res.readEntity(AccountsCommon.class);
+        } finally {
+               res.close();
         }
-        AccountsCommon accountFound = (AccountsCommon) res.getEntity();
-
+        
         //create a new account object to test partial updates
         AccountsCommon accountToUpdate = new AccountsCommon();
         accountToUpdate.setCsid(knownResourceId);
@@ -839,21 +911,25 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
 
         // Submit the request to the service and store the response.
         res = client.update(knownResourceId, accountToUpdate);
-        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);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               AccountsCommon accountUpdated = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountUpdated);
+       
+               Assert.assertEquals(accountUpdated.getStatus(),
+                       accountToUpdate.getStatus(),
+                       "Data in updated object did not match submitted data.");
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        AccountsCommon accountUpdated = (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountUpdated);
-
-        Assert.assertEquals(accountUpdated.getStatus(),
-                accountToUpdate.getStatus(),
-                "Data in updated object did not match submitted data.");
     }
 
     // Failure outcomes
@@ -894,21 +970,23 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         // Note: The ID used in this 'create' call may be arbitrary.
         // The only relevant ID may be the one used in updateAccount(), below.
         AccountClient client = new AccountClient();
-        AccountsCommon account =
-                createAccountInstance("simba", "simba", "tiger", "simba@lionking.com",
+        AccountsCommon account = createAccountInstance("simba", "simba", "tiger", "simba@lionking.com",
                 client.getTenantId(), true, false, true, true);
-        ClientResponse<AccountsCommon> res =
-                client.update(NON_EXISTENT_ID, account);
-        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);
+        Response res = client.update(NON_EXISTENT_ID, account);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
     }
 
     /**
@@ -926,18 +1004,22 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         // Note: The ID used in this 'create' call may be arbitrary.
         // The only relevant ID may be the one used in updateAccount(), below.
         AccountClient client = new AccountClient();
-        ClientResponse<AccountsCommon> res = client.read(knownResourceId);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": read status = " + res.getStatus());
-        }
-        Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-
-        if (logger.isDebugEnabled()) {
-            logger.debug("got object to update with ID: " + knownResourceId);
+        Response res = client.read(knownResourceId);
+        AccountsCommon accountToUpdate = null;
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               if (logger.isDebugEnabled()) {
+                   logger.debug("got object to update with ID: " + knownResourceId);
+               }
+               accountToUpdate = res.readEntity(AccountsCommon.class);
+               Assert.assertNotNull(accountToUpdate);
+        } finally {
+               res.close();
         }
-        AccountsCommon accountToUpdate =
-                (AccountsCommon) res.getEntity();
-        Assert.assertNotNull(accountToUpdate);
 
         accountToUpdate.setUserId("barneyFake");
         if (logger.isDebugEnabled()) {
@@ -947,16 +1029,20 @@ public class AccountServiceTest extends AbstractServiceTestImpl<AccountsCommonLi
         }
 
         res = client.update(knownResourceId, accountToUpdate);
-        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);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     // ---------------------------------------------------------------
index d79938806ba268a5d17871e73cfebd0ffb6ed26f..8e70ee2e6c0ca759216d04af190d02872e3cc47a 100644 (file)
@@ -241,7 +241,7 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest<AbstractCommonList>
                        // Check the status code of the response: does it match
                        // the expected response(s)?
                        assertStatusCode(res, testName);
-                       PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                       PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                        acquisition = (AcquisitionsCommon) extractPart(input,
                                        acquisitionClient.getCommonPartName(), AcquisitionsCommon.class);
                        Assert.assertNotNull(acquisition);
@@ -282,11 +282,11 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest<AbstractCommonList>
                //
                // Get the auth refs and check them
                //
-               res =   acquisitionClient.getAuthorityRefs(knownResourceId);
+               res = acquisitionClient.getAuthorityRefs(knownResourceId);
                AuthorityRefList list = null;
                try {
                        assertStatusCode(res, testName);
-                       list = (AuthorityRefList)res.getEntity();
+                       list = res.readEntity(AuthorityRefList.class);
                        Assert.assertNotNull(list);
                } finally {
                        if (res != null) {
index 56fb58711e778882a81292ac5530662ea213e1b8..e8dfa70abd67aad902639d924b0c0a99bd561237 100644 (file)
@@ -302,7 +302,7 @@ public class AcquisitionServiceTest extends AbstractPoxServiceTestImpl<AbstractC
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                res.close();
         }
@@ -415,7 +415,7 @@ public class AcquisitionServiceTest extends AbstractPoxServiceTestImpl<AbstractC
                }
                Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
        
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                res.close();
         }
@@ -446,7 +446,7 @@ public class AcquisitionServiceTest extends AbstractPoxServiceTestImpl<AbstractC
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
                AcquisitionsCommon updatedAcquisition =
                        (AcquisitionsCommon) extractPart(input,
                                client.getCommonPartName(), AcquisitionsCommon.class);
@@ -874,7 +874,7 @@ public class AcquisitionServiceTest extends AbstractPoxServiceTestImpl<AbstractC
                // Check the status code of the response: does it match
                // the expected response(s)?
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
        
                if (logger.isDebugEnabled()) {
                    logger.debug(testName + ": Reading Common part ...");
index ba252373f882f85fcd3ba071042a43079866e60a..5517119dd39ae1950923c38827d0cc09ab8c4962 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.authorization.perms.Permission;
 import org.collectionspace.services.authorization.perms.PermissionsList;
@@ -68,12 +67,12 @@ public class PermissionClient extends AbstractServiceClientImpl<PermissionsList,
      * @return
      * @see org.collectionspace.hello.client.PermissionProxy#readList()
      */
-    public ClientResponse<PermissionsList> readList() {
+    public Response readList() {
         return getProxy().readList();
 
     }
 
-    public ClientResponse<PermissionsList> readSearchList(String resourceName) {
+    public Response readSearchList(String resourceName) {
         return getProxy().readSearchList(resourceName);
 
     }
@@ -83,7 +82,7 @@ public class PermissionClient extends AbstractServiceClientImpl<PermissionsList,
      * @return
      * @see org.collectionspace.hello.client.PermissionProxy#getAccount(java.lang.String)
      */
-    public ClientResponse<Permission> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
 
@@ -92,7 +91,7 @@ public class PermissionClient extends AbstractServiceClientImpl<PermissionsList,
      * @return
      * @see org.collectionspace.hello.client.PermissionProxy#create(org.collectionspace.services.permission.Permission)
      */
-    public ClientResponse<Response> create(Permission permission) {
+    public Response create(Permission permission) {
         return getProxy().create(permission);
     }
 
@@ -102,7 +101,7 @@ public class PermissionClient extends AbstractServiceClientImpl<PermissionsList,
      * @return
      * @see org.collectionspace.hello.client.PermissionProxy#updateAccount(java.lang.Long, org.collectionspace.services.permission.Permission)
      */
-    public ClientResponse<Permission> update(String csid, Permission permission) {
+    public Response update(String csid, Permission permission) {
         return getProxy().update(csid, permission);
     }
 }
index 5621f95a096747aac4e393456907da523132549c..1341263dfad3de730b3fd4c2b274194796a12e39 100644 (file)
@@ -38,7 +38,6 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.authorization.perms.Permission;
 import org.collectionspace.services.authorization.perms.PermissionsList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -50,22 +49,22 @@ public interface PermissionProxy extends CollectionSpaceProxy<PermissionsList> {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<PermissionsList> readList();
+    Response readList();
 
     @GET
-    ClientResponse<PermissionsList> readSearchList(@QueryParam("res") String resourceName);
+    Response readSearchList(@QueryParam("res") String resourceName);
 
     //(C)reate
     @POST
-    ClientResponse<Response> create(Permission permission);
+    Response create(Permission permission);
 
     //(R)ead
     @GET
     @Path("/{csid}")
-    ClientResponse<Permission> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
 
     //(U)pdate
     @PUT
     @Path("/{csid}")
-    ClientResponse<Permission> update(@PathParam("csid") String csid, Permission permission);
+    Response update(@PathParam("csid") String csid, Permission permission);
 }
index 885572ef99294e0936d078a768480e27c5f3bc3b..34aa4d1327c373cf77fc0eb6a5c5d836d170a4e5 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.authorization.PermissionRole;
 
 /**
@@ -66,7 +65,7 @@ public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRo
      * @return the client response
      * @see
      */
-    public ClientResponse<PermissionRole> read(String csid, String prcsid) {
+    public Response read(String csid, String prcsid) {
         return getProxy().read(csid, prcsid);
     }
 
@@ -78,7 +77,7 @@ public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRo
      * @return the client response
      * @see
      */
-    public ClientResponse<PermissionRole> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
 
@@ -90,7 +89,7 @@ public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRo
      * @return the client response
      * @see
      */
-    public ClientResponse<Response> create(String csid, PermissionRole permRole) {
+    public Response create(String csid, PermissionRole permRole) {
         return getProxy().create(csid, permRole);
     }
     
@@ -101,23 +100,23 @@ public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRo
      * @param permRole the perm role
      * @return the client response
      */
-    public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
+    public Response delete(String csid, PermissionRole permRole) {
        return getProxy().delete(csid, "delete", permRole);
     }
 
        @Override
-       public ClientResponse<Response> create(PermissionRole payload) {
+       public Response create(PermissionRole payload) {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 
        @Override
-       public ClientResponse<PermissionRole> update(String csid,
+       public Response update(String csid,
                        PermissionRole payload) {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 
        @Override
-       public ClientResponse<PermissionRole> readList() {
+       public Response readList() {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 }
index bfaa5a316f48d88e0ab37718b66d490f1b81b6f2..615d28820caf8bf9bf8c32f57f956ed258091716 100644 (file)
@@ -36,9 +36,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-
 import org.collectionspace.services.authorization.PermissionRole;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -50,28 +48,28 @@ public interface PermissionRoleProxy extends CollectionSpaceProxy<PermissionRole
     //(C)reate
     @POST
     @Path("/{csid}/permroles")
-    ClientResponse<Response> create(@PathParam("csid") String csid, PermissionRole permRole);
+    Response create(@PathParam("csid") String csid, PermissionRole permRole);
 
     //(R)ead
     @GET
     @Path("/{csid}/permroles")
-    ClientResponse<PermissionRole> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
 
     //(R)ead
     @GET
     @Path("/{csid}/permroles/{prcsid}")
-    ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
+    Response read(@PathParam("csid") String csid,
             @PathParam("prcsid") String prcsid);
 
     //(D)elete
     @DELETE
     @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
+    Response delete(@PathParam("csid") String csid);
     
     //(D)elete - with a payload
     @POST
     @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid,
+    Response delete(@PathParam("csid") String csid,
             @QueryParam("_method") String method,
             PermissionRole permRole);    
 }
index 6f477b8e27344a18e06c3a6dc91a7812cb7d4447..69f8abb96c1656fddd85ba29b7cc41d3d8974f93 100644 (file)
@@ -32,7 +32,6 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.authorization.AccountRole;
 import org.collectionspace.services.authorization.Role;
 import org.collectionspace.services.authorization.RolesList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * A RoleClient.
@@ -59,21 +58,21 @@ public class RoleClient extends AbstractServiceClientImpl<RolesList, Role, Role,
         return SERVICE_PATH_COMPONENT;
     }
 
-    public ClientResponse<RolesList> readList() {
+    public Response readList() {
         return getProxy().readList();
 
     }
 
-    public ClientResponse<RolesList> readSearchList(String roleName) {
+    public Response readSearchList(String roleName) {
         return getProxy().readSearchList(roleName);
 
     }
 
-    public ClientResponse<Role> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
     
-    public ClientResponse<AccountRole> readRoleAccounts(String csid) {
+    public Response readRoleAccounts(String csid) {
        return getProxy().readRoleAccounts(csid);
     }
 
@@ -83,7 +82,7 @@ public class RoleClient extends AbstractServiceClientImpl<RolesList, Role, Role,
      * @param role the role
      * @return the client response
      */
-    public ClientResponse<Response> create(Role role) {
+    public Response create(Role role) {
         return getProxy().create(role);
     }
 
@@ -92,7 +91,7 @@ public class RoleClient extends AbstractServiceClientImpl<RolesList, Role, Role,
      * @param role
      * @return
      */
-    public ClientResponse<Role> update(String csid, Role role) {
+    public Response update(String csid, Role role) {
         return getProxy().update(csid, role);
     }
 
index 2633bca5c507321ffc173a85e0978cdb95b8d896..0064a320396a9a18999637881d5df9a651924e0f 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.authorization.PermissionRole;
 
 // TODO: Auto-generated Javadoc
@@ -66,7 +65,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRo
      * @return the client response
      * @see
      */
-    public ClientResponse<PermissionRole> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
 
@@ -77,7 +76,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRo
      * @param prcsid the prcsid
      * @return the client response
      */
-    public ClientResponse<PermissionRole> read(String csid, String prcsid) {
+    public Response read(String csid, String prcsid) {
         return getProxy().read(csid, prcsid);
     }
 
@@ -89,7 +88,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRo
      * @return the client response
      * @see
      */
-    public ClientResponse<Response> create(String csid, PermissionRole permRole) {
+    public Response create(String csid, PermissionRole permRole) {
         return getProxy().create(csid, permRole);
     }
 
@@ -100,23 +99,23 @@ public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRo
      * @param permRole the perm role
      * @return the client response
      */
-    public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
+    public Response delete(String csid, PermissionRole permRole) {
         return getProxy().delete(csid, "delete", permRole);
     }
 
        @Override
-       public ClientResponse<Response> create(PermissionRole payload) {
+       public Response create(PermissionRole payload) {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 
        @Override
-       public ClientResponse<PermissionRole> update(String csid,
+       public Response update(String csid,
                        PermissionRole payload) {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 
        @Override
-       public ClientResponse<PermissionRole> readList() {
+       public Response readList() {
                throw new UnsupportedOperationException(); //method not supported nor needed
        }
 }
index 08623912f94ef28c626cbf6ffe633faddac38ae9..cd9fea96d28bacff9884cebc71d423278fad11e8 100644 (file)
@@ -38,7 +38,6 @@ import javax.ws.rs.core.Response;
 
 
 import org.collectionspace.services.authorization.PermissionRole;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -51,28 +50,28 @@ public interface RolePermissionProxy extends CollectionSpaceProxy<PermissionRole
     //(C)reate
     @POST
     @Path("/{csid}/permroles")
-    ClientResponse<Response> create(@PathParam("csid") String csid, PermissionRole permRole);
+    Response create(@PathParam("csid") String csid, PermissionRole permRole);
 
     //(R)ead
     @GET
     @Path("/{csid}/permroles")
-    ClientResponse<PermissionRole> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
 
     //(R)ead
     @GET
     @Path("/{csid}/permroles/{prcsid}")
-    ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
+    Response read(@PathParam("csid") String csid,
             @PathParam("prcsid") String prcsid);
 
     //(D)elete
     @DELETE
     @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
+    Response delete(@PathParam("csid") String csid);
     
     //(D)elete - with a payload
     @POST
     @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid, 
+    Response delete(@PathParam("csid") String csid, 
             @QueryParam("_method") String method,
             PermissionRole permRole);
 }
index 176b764f40a562c75bfab40eaedd1674301db82a..62ebe9c3b5b976d4011b6bee1579338d75c976cf 100644 (file)
@@ -36,11 +36,8 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-
-import org.collectionspace.services.authorization.AccountRole;
 import org.collectionspace.services.authorization.Role;
 import org.collectionspace.services.authorization.RolesList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -52,27 +49,27 @@ public interface RoleProxy extends CollectionSpaceProxy<RolesList> {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<RolesList> readList();
+    Response readList();
 
     @GET
-    ClientResponse<RolesList> readSearchList(@QueryParam("r") String roleName);
+    Response readSearchList(@QueryParam("r") String roleName);
 
     //(C)reate
     @POST
-    ClientResponse<Response> create(Role role);
+    Response create(Role role);
 
     //(R)ead
     @GET
     @Path("/{csid}")
-    ClientResponse<Role> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
     
     //(R)ead accounts associate with this role
     @GET
     @Path("{csid}/accountroles")
-    ClientResponse<AccountRole> readRoleAccounts(@PathParam("csid") String csid);
+    Response readRoleAccounts(@PathParam("csid") String csid);
 
     //(U)pdate
     @PUT
     @Path("/{csid}")
-    ClientResponse<Role> update(@PathParam("csid") String csid, Role role);
+    Response update(@PathParam("csid") String csid, Role role);
 }
index 9599b45a58bbd91c50ecc1dca8e4895a1348a944..608e3d215ae20e73ea5a7a160b9b4fb334d77cf9 100644 (file)
@@ -47,8 +47,6 @@ import org.collectionspace.services.client.RoleFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
 import org.collectionspace.services.client.test.ServiceRequestType;
 
-import org.jboss.resteasy.client.ClientResponse;
-
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -189,9 +187,9 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
         PermissionRole permRole = createPermissionRoleInstance(pv,
                 roleValues.values(), true, true);
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<Response> res = null;
+        
+        Response res = client.create(pv.getPermissionId(), permRole);
         try {
-            res = client.create(pv.getPermissionId(), permRole);
             int statusCode = res.getStatus();
 
             if (logger.isDebugEnabled()) {
@@ -266,10 +264,9 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = client.read(
+                permValues.get(TEST_SERVICE_NAME + TEST_MARKER).getPermissionId());
         try {
-            res = client.read(
-                    permValues.get(TEST_SERVICE_NAME + TEST_MARKER).getPermissionId());
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
@@ -281,11 +278,11 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
 
-            PermissionRole output = (PermissionRole) res.getEntity();
+            PermissionRole output = res.readEntity(PermissionRole.class);
             Assert.assertNotNull(output);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -303,7 +300,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = null;
         try {
             res = client.read(NON_EXISTENT_ID);
             int statusCode = res.getStatus();
@@ -318,7 +315,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
             Assert.assertEquals(statusCode, testExpectedStatusCode);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -331,14 +328,14 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
 
         // Submit the request to the service and store the response.
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = null;
         try {
             res = client.read(
                     permValues.get(TEST_SERVICE_NAME + TEST_MARKER + NO_REL_SUFFIX).getPermissionId());
             // Check the status code of the response: does it match
             // the expected response(s)?
             assertStatusCode(res, testName);
-            PermissionRole output = (PermissionRole) res.getEntity();
+            PermissionRole output = res.readEntity(PermissionRole.class);
 
             String sOutput = objectAsXmlString(output, PermissionRole.class);
             if (logger.isDebugEnabled()) {
@@ -346,7 +343,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
             }
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -437,16 +434,16 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
         //
         //
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<PermissionRole> readResponse = client.read(
+        Response readResponse = client.read(
                        permValues.get(TEST_SERVICE_NAME + TEST_MARKER).getPermissionId());
         PermissionRole toDelete = null;
         try {
-               toDelete = readResponse.getEntity();
+               toDelete = readResponse.readEntity(PermissionRole.class);
         } finally {
-               readResponse.releaseConnection();
+               readResponse.close();
         }        
 
-        ClientResponse<Response> res = client.delete(
+        Response res = client.delete(
                        toDelete.getPermission().get(0).getPermissionId(), toDelete);
         try {
             int statusCode = res.getStatus();
@@ -455,7 +452,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
             Assert.assertEquals(statusCode, testExpectedStatusCode);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
@@ -472,9 +469,9 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
                        permValues.get(TEST_SERVICE_NAME + TEST_MARKER).getPermissionId());
         toDelete = null;
         try {
-               toDelete = readResponse.getEntity();
+               toDelete = readResponse.readEntity(PermissionRole.class);
         } finally {
-               readResponse.releaseConnection();
+               readResponse.close();
         }
 
         Response deleteRes = client.delete(toDelete.getPermission().get(0).getPermissionId());
@@ -586,10 +583,8 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
                 "default permissions for " + resName,
                 actions, effect, true, true, true);
         String id = null;
-        ClientResponse<Response> res = null;
+        Response res = permClient.create(permission);
         try {
-            res = permClient.create(permission);
-
             int statusCode = res.getStatus();
             if (logger.isDebugEnabled()) {
                 logger.debug("createPermission: resName=" + resName
@@ -601,7 +596,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
             id = extractId(res);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         return id;
@@ -650,7 +645,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
         Role role = RoleFactory.createRoleInstance(roleName,
                        roleName, //the display name
                 "role for " + roleName, true);
-        ClientResponse<Response> res = null;
+        Response res = null;
         String id = null;
         try {
             res = roleClient.create(role);
@@ -665,7 +660,7 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl<Permissio
 
             id = extractId(res);
         } finally {
-            res.releaseConnection();
+            res.close();
         }
         return id;
     }
index 5fceb11767eefe6dcee9759ee36bf65579698e94..53ff469b71b28e9c15a8035f9da3aa36cec2bc2d 100644 (file)
@@ -36,7 +36,6 @@ import org.collectionspace.services.authorization.perms.PermissionsList;
 import org.collectionspace.services.client.PermissionFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
 import org.collectionspace.services.client.test.ServiceRequestType;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -124,15 +123,19 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
                 true,
                 true);
         PermissionClient client = new PermissionClient();
-        ClientResponse<Response> res = client.create(permission);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(permission);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     /**
@@ -149,10 +152,10 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
 
         // Submit the request to the service and store the response.
         PermissionClient client = new PermissionClient();
-        ClientResponse<PermissionsList> res = client.readSearchList("acquisition");
+        Response res = client.readSearchList("acquisition");
         try {
                assertStatusCode(res, testName);
-               PermissionsList list = res.getEntity(PermissionsList.class);
+               PermissionsList list = res.readEntity(PermissionsList.class);
                int EXPECTED_ITEMS = 2 + 4; //2 seeded base resource permissions and 4 workflow-related permissions
                int actual = list.getPermission().size();
                if (logger.isDebugEnabled()) {
@@ -168,7 +171,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
                Assert.assertEquals(list.getPermission().size(), EXPECTED_ITEMS);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -203,7 +206,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
         }
         PermissionClient client = new PermissionClient();
         // Submit the request to the service and store the response.
-        ClientResponse<Permission> res = client.update(knownResourceId, permToUpdate);
+        Response res = client.update(knownResourceId, permToUpdate);
         int statusCode = res.getStatus();
         // Check the status code of the response: does it match the expected response(s)?
         if (logger.isDebugEnabled()) {
@@ -247,7 +250,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
         }
         PermissionClient client = new PermissionClient();
         // Submit the request to the service and store the response.
-        ClientResponse<Permission> res = client.update(knownResourceId, permToUpdate);
+        Response res = client.update(knownResourceId, permToUpdate);
         int statusCode = res.getStatus();
         // Check the status code of the response: does it match the expected response(s)?
         if (logger.isDebugEnabled()) {
@@ -257,7 +260,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
                 invalidStatusCodeMessage(testRequestType, statusCode));
         Assert.assertEquals(statusCode, testExpectedStatusCode);
 
-        Permission permUpdated = (Permission) res.getEntity();
+        Permission permUpdated = res.readEntity(Permission.class);
         Assert.assertNotNull(permUpdated);
         int updated_actions = permToUpdate.getAction().size();
         if (logger.isDebugEnabled()) {
@@ -292,18 +295,21 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
                 true,
                 true,
                 true);
-        ClientResponse<Permission> res =
-                client.update(NON_EXISTENT_ID, permission);
-        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);
+        Response res = client.update(NON_EXISTENT_ID, permission);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
     }
     
     // ---------------------------------------------------------------
@@ -345,6 +351,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl<PermissionsLi
             logger.debug("to be created, permission");
             logger.debug(objectAsXmlString(permission, Permission.class));
         }
+        
         return permission;
     }
 
index d84730d53fbdfd882381f2d204ede0f666a06d8f..e278b67dbf913cb49e288d030b56e0e26c8d2ad5 100644 (file)
@@ -45,7 +45,6 @@ import org.collectionspace.services.client.RoleClient;
 import org.collectionspace.services.client.RoleFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
 import org.collectionspace.services.client.test.ServiceRequestType;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -175,9 +174,8 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
         PermissionRole permRole = createPermissionRoleInstance(rv,
                 permValues.values(), true, true);
         RolePermissionClient client = new RolePermissionClient();
-        ClientResponse<Response> res = null;
+        Response res = client.create(rv.getRoleId(), permRole);
         try {
-            res = client.create(rv.getRoleId(), permRole);
             int statusCode = res.getStatus();
             if (logger.isDebugEnabled()) {
                 logger.debug(testName + ": status = " + statusCode);
@@ -192,7 +190,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
             }
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -251,9 +249,8 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
 
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = client.read(roleValues.get(getRoleName()).getRoleId());
         try {
-            res = client.read(roleValues.get(getRoleName()).getRoleId());
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
@@ -265,11 +262,11 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
 
-            PermissionRole output = (PermissionRole) res.getEntity();
+            PermissionRole output = res.readEntity(PermissionRole.class);
             Assert.assertNotNull(output);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -286,10 +283,8 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
 
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = client.read(NON_EXISTENT_ID);
         try {
-
-            res = client.read(NON_EXISTENT_ID);
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
@@ -302,7 +297,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
             Assert.assertEquals(statusCode, testExpectedStatusCode);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -312,10 +307,8 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
         setupRead();
         // Submit the request to the service and store the response.
         RolePermissionClient client = new RolePermissionClient();
-        ClientResponse<PermissionRole> res = null;
+        Response res = client.read(roleValues.get(getRoleName() + NO_REL_SUFFIX).getRoleId());
         try {
-
-            res = client.read(roleValues.get(getRoleName() + NO_REL_SUFFIX).getRoleId());
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
@@ -326,7 +319,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, Response.Status.OK.getStatusCode());
-            PermissionRole output = (PermissionRole) res.getEntity();
+            PermissionRole output = res.readEntity(PermissionRole.class);
 
             String sOutput = objectAsXmlString(output, PermissionRole.class);
             if (logger.isDebugEnabled()) {
@@ -334,7 +327,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
             }
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -440,22 +433,24 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
         setupDelete();
         
         rv = roleValues.get(getRoleName());
-        ClientResponse<PermissionRole> readResponse = client.read(rv.getRoleId());
-        PermissionRole toDelete = readResponse.getEntity();
-        readResponse.releaseConnection();        
+        Response readResponse = client.read(rv.getRoleId());
+        PermissionRole toDelete = null;
+        try {
+               toDelete = readResponse.readEntity(PermissionRole.class);
+        } finally {
+               readResponse.close();
+        }
         
         rv = toDelete.getRole().get(0);
-        ClientResponse<Response> res = null;
+        Response res = client.delete(rv.getRoleId(), toDelete);
         try {
-            res = client.delete(
-                    rv.getRoleId(), toDelete);
             int statusCode = res.getStatus();
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -575,7 +570,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
         Permission permission = PermissionFactory.createPermissionInstance(resName,
                 "default permissions for " + resName,
                 actions, effect, true, true, true);
-        ClientResponse<Response> res = null;
+        Response res = null;
         String id = null;
         try {
             res = permClient.create(permission);
@@ -590,7 +585,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
             id = extractId(res);
         } finally {
             if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         return id;
@@ -637,7 +632,7 @@ public class RolePermissionServiceTest extends AbstractServiceTestImpl<Permissio
                        roleName, //the display name
                 "role for " + roleName, true);
         role.setRoleGroup("something");
-        ClientResponse<Response> res = null;
+        Response res = null;
         String id = null;
         try {
             res = roleClient.create(role);
index 25fcdd2230b53a7ed67ad9dbc90670803597dc92..56c4e5cbc6ac6cca58c093daf361d75055f59737 100644 (file)
@@ -32,7 +32,6 @@ import org.collectionspace.services.authorization.Role;
 import org.collectionspace.services.authorization.RolesList;
 import org.collectionspace.services.client.RoleFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -110,7 +109,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         RoleClient client = new RoleClient();
         Role role = createRoleInstance(knownRoleName, "All users are required to be in this role",
                 true);
-        ClientResponse<Response> res = client.create(role);
+        Response res = client.create(role);
         try {
                int statusCode = res.getStatus();
                // Check the status code of the response: does it match
@@ -149,31 +148,33 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
         Role role = createRoleInstance(knownRoleName + "_" + knownRoleDisplayName,
-                "all users are required to be in this role",
-                true);
+                "all users are required to be in this role", true);
         role.setDisplayName(knownRoleDisplayName);
-        ClientResponse<Response> res = client.create(role);
-        int statusCode = res.getStatus();
-
-        // Check the status code of the response: does it match
-        // the expected response(s)?
-        //
-        // Specifically:
-        // Does it fall within the set of valid status codes?
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
-        }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        // Store the ID returned from this create operation
-        // for additional tests below.
-        String csid = extractId(res);
-        allResourceIdsCreated.add(csid);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": csid=" + csid);
+        Response res = client.create(role);
+        try {
+               int statusCode = res.getStatus();
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               //
+               // Specifically:
+               // Does it fall within the set of valid status codes?
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               // Store the ID returned from this create operation
+               // for additional tests below.
+               String csid = extractId(res);
+               allResourceIdsCreated.add(csid);
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": csid=" + csid);
+               }
+        } finally {
+               res.close();
         }
     }
     
@@ -192,20 +193,23 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
         Role role = createRoleInstance(knownRoleName,
-                "role users",
-                true);
-        ClientResponse<Response> res = client.create(role);
-        int statusCode = res.getStatus();
-
-        if (logger.isDebugEnabled()) {
-               logger.debug(testName + ": Role with name \"" +
-                               knownRoleName + "\" should already exist, so this request should fail.");
-            logger.debug(testName + ": status = " + statusCode);
-            logger.debug(testName + ": " + res);
+                "role users", true);
+        Response res = client.create(role);
+        try {
+               int statusCode = res.getStatus();
+       
+               if (logger.isDebugEnabled()) {
+                       logger.debug(testName + ": Role with name \"" +
+                                       knownRoleName + "\" should already exist, so this request should fail.");
+                   logger.debug(testName + ": status = " + statusCode);
+                   logger.debug(testName + ": " + res);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
     
     /**
@@ -225,26 +229,30 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
                 "role users with non-unique display name",
                 true);
         role.setDisplayName(knownRoleDisplayName);
-        ClientResponse<Response> res = client.create(role);
-        int statusCode = res.getStatus();
-
-        if (logger.isDebugEnabled()) {
-               logger.debug(testName + ": Role with name \"" +
-                               knownRoleName + "\" should already exist, so this request should fail.");
-            logger.debug(testName + ": status = " + statusCode);
-            logger.debug(testName + ": " + res);
-        }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        if (statusCode != Response.Status.BAD_REQUEST.getStatusCode()) {
-            // If the test fails then we've just created a Role that we need to delete, so
-            // store the ID returned from this create operation.
-            String csid = extractId(res);
-            allResourceIdsCreated.add(csid);
-            if (logger.isDebugEnabled()) {
-                logger.debug(testName + ": csid=" + csid);
-            }
-               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        Response res = client.create(role);
+        try {
+               int statusCode = res.getStatus();
+       
+               if (logger.isDebugEnabled()) {
+                       logger.debug(testName + ": Role with name \"" +
+                                       knownRoleName + "\" should already exist, so this request should fail.");
+                   logger.debug(testName + ": status = " + statusCode);
+                   logger.debug(testName + ": " + res);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               if (statusCode != Response.Status.BAD_REQUEST.getStatusCode()) {
+                   // If the test fails then we've just created a Role that we need to delete, so
+                   // store the ID returned from this create operation.
+                   String csid = extractId(res);
+                   allResourceIdsCreated.add(csid);
+                   if (logger.isDebugEnabled()) {
+                       logger.debug(testName + ": csid=" + csid);
+                   }
+                       Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+               }
+        } finally {
+               res.close();
         }
     }
 
@@ -264,15 +272,19 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         Role role = createRoleInstance("",
                 "role for users",
                 false);
-        ClientResponse<Response> res = client.create(role);
-        int statusCode = res.getStatus();
-        // Does it exactly match the expected status code?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.create(role);
+        try {
+               int statusCode = res.getStatus();
+               // Does it exactly match the expected status code?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, Response.Status.BAD_REQUEST.getStatusCode());
     }
 
     //to not cause uniqueness violation for role, createList is removed
@@ -290,37 +302,46 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         //create a role with lowercase role name without role prefix
         //the service should make it upper case and add the role prefix
         Role role1 = createRoleInstance(verifyRoleName,
-                "collection manager",
-                true);
-        ClientResponse<Response> res = client.create(role1);
-        int statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        verifyResourceId = extractId(res);
-        allResourceIdsCreated.add(verifyResourceId);
+                "collection manager", true);
+        Response res = client.create(role1);
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               verifyResourceId = extractId(res);
+               allResourceIdsCreated.add(verifyResourceId);
+        } finally {
+               res.close();
+        }
 
         Role role2 = createRoleInstance("ROLE_COLLECTIONS_CURATOR_TEST",
-                "collections curator",
-                true);
+                "collections curator", true);
         res = client.create(role2);
-        statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        allResourceIdsCreated.add(extractId(res));
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               allResourceIdsCreated.add(extractId(res));
+        } finally {
+               res.close();
+        }
 
         Role role3 = createRoleInstance("ROLE_MOVINGIMAGE_ADMIN_TEST",
-                "moving image admin",
-                true);
+                "moving image admin", true);
         res = client.create(role3);
-        statusCode = res.getStatus();
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        allResourceIdsCreated.add(extractId(res));
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+               allResourceIdsCreated.add(extractId(res));
+        } finally {
+               res.close();
+        }
     }
 
     // Failure outcomes
@@ -366,20 +387,24 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
-        ClientResponse<Role> 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);
+        Response res = client.read(knownResourceId);
+        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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               Role output = res.readEntity(Role.class);
+               Assert.assertNotNull(output);
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        Role output = (Role) res.getEntity();
-        Assert.assertNotNull(output);
     }
 
     @Test(dataProvider = "testName",
@@ -390,7 +415,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
-        ClientResponse<Role> res = client.read(verifyResourceId);
+        Response res = client.read(verifyResourceId);
         try {
                int statusCode = res.getStatus();
                
@@ -403,7 +428,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
-               Role output = (Role) res.getEntity();
+               Role output = res.readEntity(Role.class);
                Assert.assertNotNull(output);
        
                //FIXME: Tenant ID of "1" should not be hard coded
@@ -430,7 +455,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
-        ClientResponse<Role> res = client.read(NON_EXISTENT_ID);
+        Response res = client.read(NON_EXISTENT_ID);
         try {
             int statusCode = res.getStatus();
                // Check the status code of the response: does it match
@@ -462,12 +487,12 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
-        ClientResponse<RolesList> res = client.readList();
+        Response res = client.readList();
         try {
                // Check the status code of the response: does it match
                // the expected response(s)?
                assertStatusCode(res, testName);
-               RolesList list = res.getEntity();
+               RolesList list = res.readEntity(RolesList.class);
                // Optionally output additional data about list members for debugging.
                boolean iterateThroughList = true;
                if (iterateThroughList && logger.isDebugEnabled()) {
@@ -494,10 +519,10 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
 
         // Submit the request to the service and store the response.
         RoleClient client = new RoleClient();
-        ClientResponse<RolesList> res = client.readSearchList("movingImage");
+        Response res = client.readSearchList("movingImage");
         try {
                assertStatusCode(res, testName);
-               RolesList list = res.getEntity();
+               RolesList list = res.readEntity(RolesList.class);
                int EXPECTED_ITEMS = 1;
                if (logger.isDebugEnabled()) {
                    logger.debug(testName + ": received = " + list.getRole().size()
@@ -547,7 +572,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         }
         RoleClient client = new RoleClient();
         // Submit the request to the service and store the response.
-        ClientResponse<Role> res = client.update(knownResourceId, roleToUpdate);
+        Response res = client.update(knownResourceId, roleToUpdate);
         try {
                // Check the status code of the response: does it match the expected response(s)?
             int statusCode = res.getStatus();
@@ -559,7 +584,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
        
-               Role roleUpdated = (Role) res.getEntity();
+               Role roleUpdated = res.readEntity(Role.class);
                Assert.assertNotNull(roleUpdated);
        
                Assert.assertEquals(roleUpdated.getDescription(),
@@ -582,7 +607,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         // Submit the create request to the service and store the response.
         //
         RoleClient client = new RoleClient();        
-        ClientResponse<Response> res = client.create(role);
+        Response res = client.create(role);
         String testResourceId = null;
         try {
             int statusCode = res.getStatus();
@@ -603,14 +628,14 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         // Next, read back the role we just created.
         setupRead();
         // Submit the request to the service and store the response.
-        ClientResponse<Role> roleRes = client.read(testResourceId);
+        Response roleRes = client.read(testResourceId);
         try {
             int statusCode = roleRes.getStatus();
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
-               Role roleRead = (Role) roleRes.getEntity();
+               Role roleRead = roleRes.readEntity(Role.class);
                Assert.assertNotNull(roleRead);
                String mdProtection = roleRead.getMetadataProtection();
                String permsProtection = roleRead.getPermsProtection();
@@ -645,7 +670,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
        
-               Role roleUpdated = (Role) roleRes.getEntity();
+               Role roleUpdated = roleRes.readEntity(Role.class);
                Assert.assertNotNull(roleUpdated);
                if (logger.isDebugEnabled()) {
                    logger.debug(testName + "Updated role: ");
@@ -683,7 +708,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         }
         RoleClient client = new RoleClient();
         // Submit the request to the service and store the response.
-        ClientResponse<Role> res = client.update(knownResourceId, roleToUpdate);
+        Response res = client.update(knownResourceId, roleToUpdate);
         try {
                int statusCode = res.getStatus();
                // Check the status code of the response: does it match the expected response(s)?
@@ -744,8 +769,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl<RolesList, Role, Ro
         Role role = createRoleInstance("ROLE_XXX",
                 "xxx",
                 true);
-        ClientResponse<Role> res =
-                client.update(NON_EXISTENT_ID, role);
+        Response res = client.update(NON_EXISTENT_ID, role);
         try {
                int statusCode = res.getStatus();
        
index 392fdd371df47f262000d3d76ecb65f940e5b633..2e5dbd6b81e6ed87b3a7edb0b9305520cf613c1d 100644 (file)
@@ -19,7 +19,6 @@ package org.collectionspace.services.client;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
 /**
@@ -65,19 +64,19 @@ public class BlobClient extends AbstractCommonListPoxServiceClientImpl<BlobProxy
         * Blob proxied service calls
         */
        
-    public ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput) {
+    public Response createBlobFromFormData(MultipartFormDataOutput formDataOutput) {
         return getProxy().createBlobFromFormData(formDataOutput);
     }
     
-    public ClientResponse<Response> createBlobFromURI(String blobUri) {
+    public Response createBlobFromURI(String blobUri) {
         return getProxy().createBlobFromURI("".getBytes(), blobUri);
     }
     
-    public ClientResponse<Response> getBlobContent(String csid) {
+    public Response getBlobContent(String csid) {
        return getProxy().getBlobContent(csid);
     }
     
-    public ClientResponse<Response> getDerivativeContent(
+    public Response getDerivativeContent(
                @PathParam("csid") String csid,
                @PathParam("derivativeTerm") String derivativeTerm) {
        return getProxy().getDerivativeContent(csid, derivativeTerm);
index b1c85d54f2f268e86b17561caeb0fd4233c4085d..0e0c327f71812f8bc4c82badc0950880f03a6931 100644 (file)
@@ -9,7 +9,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
 
@@ -22,21 +21,21 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 public interface BlobProxy extends CollectionSpaceCommonListPoxProxy {
     //(C)reate
     @POST
-    ClientResponse<Response> createBlobFromURI(byte[] xmlPayload, 
+    Response createBlobFromURI(byte[] xmlPayload, 
                @QueryParam(BlobClient.BLOB_URI_PARAM) String blobUri);
 
     //(C)reate
     @POST
     @Consumes("multipart/form-data")
-    ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput);
+    Response createBlobFromFormData(MultipartFormDataOutput formDataOutput);
 
     @GET
     @Path("{csid}/content")
-    ClientResponse<Response> getBlobContent(@PathParam("csid") String csid);
+    Response getBlobContent(@PathParam("csid") String csid);
     
     @GET
     @Path("{csid}/derivatives/{derivativeTerm}/content")
-    public ClientResponse<Response> getDerivativeContent(
+    public Response getDerivativeContent(
                @PathParam("csid") String csid,
                @PathParam("derivativeTerm") String derivativeTerm);    
 }
\ No newline at end of file
index 7c4fbe7f399338768812df63d873b757f36ceea0..14b84c364a9ab60c78132dee076dd75e4156c14f 100644 (file)
@@ -193,7 +193,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         BlobsCommon blob = null;
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                blob = (BlobsCommon) extractPart(input, blobClient.getCommonPartName(), BlobsCommon.class);
                Assert.assertNotNull(blob);
                logger.debug(objectAsXmlString(blob, BlobsCommon.class));
@@ -210,7 +210,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         res = blobClient.getAuthorityRefs(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               AuthorityRefList list = (AuthorityRefList)res.getEntity();
+               AuthorityRefList list = res.readEntity(AuthorityRefList.class);
                List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
                int numAuthRefsFound = items.size();
                logger.debug("Authority references, found " + numAuthRefsFound);
@@ -253,7 +253,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId);
+            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
@@ -263,7 +263,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
             BlobClient blobClient = new BlobClient();
             for (String resourceId : blobIdsCreated) {
                 // Note: Any non-success responses are ignored and not reported.
-                blobClient.delete(resourceId);
+                blobClient.delete(resourceId).close();
             }
         }
     }
index 8e8246946d59b691bc76abea787ba0f8248fe820..b03b84de53d8a4fbccde69a81ef53985cc4aeda8 100644 (file)
@@ -19,7 +19,6 @@ import org.collectionspace.services.client.BlobClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.Profiler;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.Test;
@@ -84,10 +83,14 @@ public class BlobScaleTest extends BaseServiceTest<AbstractCommonList> {
         Thread.sleep(3000); // sleep for 3 seconds
         
         for (int i = 0; i < allGeneratedImages.size(); i++) {
-               ClientResponse<Response> res = client.getDerivativeContent(allGeneratedImages.get(i), "Thumbnail");
-               assertStatusCode(res, testName);
-               logger.debug(String.format("Performed GET operation on Thumbnail derivative of image blob ID = '%s'.", 
-                               allGeneratedImages.get(i)));
+               Response res = client.getDerivativeContent(allGeneratedImages.get(i), "Thumbnail");
+               try {
+                       assertStatusCode(res, testName);
+                       logger.debug(String.format("Performed GET operation on Thumbnail derivative of image blob ID = '%s'.", 
+                                       allGeneratedImages.get(i)));
+               } finally {
+                       res.close();
+               }
         }        
        }
        
@@ -104,7 +107,7 @@ public class BlobScaleTest extends BaseServiceTest<AbstractCommonList> {
                        URL url = jpegFile.toURI().toURL();
                        
                profiler.start();
-                       ClientResponse<Response> res = client.createBlobFromURI("http://farm6.static.flickr.com/5289/5688023100_15e00cde47_o.jpg");//url.toString());
+                       Response res = client.createBlobFromURI("http://farm6.static.flickr.com/5289/5688023100_15e00cde47_o.jpg");//url.toString());
                        try {
                                profiler.stop();
                        assertStatusCode(res, testName);
@@ -123,7 +126,7 @@ public class BlobScaleTest extends BaseServiceTest<AbstractCommonList> {
                        allGeneratedImages.add(csid);
                        } finally {
                                if (res != null) {
-                    res.releaseConnection();
+                    res.close();
                 }
                        }
         }
index 0f8f633eadf0a398596ac4dac1876e959454e952..2f95c99ef68347930227046c48a673a0e9c4917e 100644 (file)
@@ -133,7 +133,7 @@ public class BlobServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonLi
                if (children != null && children.length > 0) {
                        for (File child : children) {
                                if (isBlobbable(child) == true) {
-                                       ClientResponse<Response> res = null;
+                                       Response res = null;
                                        String mimeType = this.getMimeType(child);
                                        logger.debug("Processing file URI: " + child.getAbsolutePath());
                                        logger.debug("MIME type is: " + mimeType);
@@ -187,7 +187,7 @@ public class BlobServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonLi
         // Create the blob
         //
         BlobClient client = new BlobClient();
-               ClientResponse<Response> res = null;
+               Response res = null;
                res = client.createBlobFromURI(uri);
                String blobCsid = null;
                try {
index 80efbc41d04e00ec0cd32ac4723b5531b3c727a0..3a3be105f0730a93192e73665309f45de6b2348c 100644 (file)
                        <artifactId>httpclient</artifactId>
                        <version>4.3.3</version>
         </dependency>
+        <dependency>
+                       <groupId>xerces</groupId>
+                       <artifactId>xercesImpl</artifactId>
+                       <version>2.9.1</version>
+               </dependency>        
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
index 138b871811e543ef49638d0fc0cd58ef30e20051..7202e56542c58491e432b46c29833bffa8243ce2 100644 (file)
@@ -38,7 +38,6 @@ import javax.xml.bind.Unmarshaller;
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.commons.io.FileUtils;
-import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.InputPart;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.slf4j.Logger;
@@ -70,17 +69,6 @@ public class CollectionSpaceClientUtils {
         Response.Status.NOT_FOUND.getStatusCode();
     protected static final int STATUS_OK =
         Response.Status.OK.getStatusCode();
-
-    /**
-     * Extract id.
-     *
-     * @param res the res
-     * @return the string
-     */
-    static public String extractId(ClientResponse<Response> res) {
-        MultivaluedMap<String, Object> mvm = res.getMetadata();
-        return extractIdFromResponseMetadata(mvm);
-    }
  
     /**
      * Extract id.
index 95f2edfd0fe23171fbfe67181b40922471fb6759..0a0b3e91a65f6595e7e044304c811728718b117c 100644 (file)
@@ -16,20 +16,20 @@ public interface CollectionSpaceCommonListPoxProxy extends CollectionSpacePoxPro
     @Override
        @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
+    Response readIncludeDeleted(
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     @Override
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
+    Response keywordSearchIncludeDeleted(
            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     @Override
        @GET
        @Produces({ "application/xml" })
-       ClientResponse<AbstractCommonList> advancedSearchIncludeDeleted(
+       Response advancedSearchIncludeDeleted(
                        @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause,
                        @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 }
index b3eb1d9646f5c5036243369e5590e4c1e67d98e1..58060dc2a3c2894f6b8d321cab9598886af0b305 100644 (file)
@@ -24,7 +24,6 @@ package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
@@ -58,22 +57,22 @@ public final class TestServiceClient extends AbstractServiceClientImpl<AbstractC
        }
 
        @Override
-       public ClientResponse<Response> create(Object payload) {
+       public Response create(Object payload) {
         throw new UnsupportedOperationException();
        }
 
        @Override
-       public ClientResponse<Object> update(String csid, Object payload) {
+       public Response update(String csid, Object payload) {
         throw new UnsupportedOperationException();
        }
 
        @Override
-       public ClientResponse<Object> read(String csid) {
+       public Response read(String csid) {
         throw new UnsupportedOperationException();
        }
 
        @Override
-       public ClientResponse<AbstractCommonList> readList() {
+       public Response readList() {
         throw new UnsupportedOperationException();
        } 
 }
index a47dca1dc8f46014885f5440251bb8bca8aec146..b223797a9f6a9d5a28b6266b153f22df2d223b56 100644 (file)
@@ -173,9 +173,13 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                                invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
+       } finally {
+               res.close();
+       }
        
+       res = client.readItem(knownResourceId, knownItemResourceId);
+       try {
                // Retrieve the updated resource and verify that the parent did not change
-               res = client.readItem(knownResourceId, knownItemResourceId);
                AUTHORITY_ITEM_TYPE updatedVocabularyItem = extractItemCommonPartValue(res);
                Assert.assertNotNull(updatedVocabularyItem);
        
index 16a2564e01c37e884fa02c2c0fc10e797e7faa21..9cde30bf120b787e5802519ffc9fb3ddaec1af0d 100644 (file)
@@ -51,7 +51,6 @@ import org.apache.commons.httpclient.methods.PutMethod;
 import org.apache.commons.httpclient.methods.StringRequestEntity;
 import org.apache.commons.io.FileUtils;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -379,26 +378,6 @@ public abstract class BaseServiceTest<CLT> {
     // FIXME: Move some or all of the methods below to a common client and
     // server utilities package, when this package becomes available.
 
-    /**
-     * Extract id.
-     *
-     * @param res the res
-     * @return the string
-     */
-    static protected String extractId(ClientResponse<Response> res) {
-        MultivaluedMap<String, Object> mvm = res.getMetadata();
-        String uri = (String) ((List<Object>) mvm.get("Location")).get(0);
-        if (logger.isDebugEnabled()) {
-            logger.debug("extractId:uri=" + uri);
-        }
-        String[] segments = uri.split("/");
-        String id = segments[segments.length - 1];
-        if (logger.isDebugEnabled()) {
-            logger.debug("id=" + id);
-        }
-        return id;
-    }
-    
     /**
      * Extract id.
      *
@@ -676,18 +655,6 @@ public abstract class BaseServiceTest<CLT> {
         }
         return className;
     }
-
-    public int assertStatusCode(ClientResponse<?> res, String testName) {
-        int statusCode = res.getStatus();
-        
-        // Check the status code of the response: does it match the expected response(s)?
-        logger.debug(testName + ": status = " + statusCode);
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                       invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        
-        return statusCode;
-    }
     
     public int assertStatusCode(Response res, String testName) {
         int statusCode = res.getStatus();
index 60e0d4435c83cece65dc6c0b4c0f17811fe1b00c..5491864e41feb0a8cb855c7d25d1d062ad85cc03 100644 (file)
 package org.collectionspace.services.client.workflow;
 
 import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.client.AbstractCommonListPoxServiceClientImpl;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * WorkflowClient.java
@@ -84,7 +81,7 @@ public class WorkflowClient extends AbstractCommonListPoxServiceClientImpl<Workf
         */
        
        @Override
-       public ClientResponse<AbstractCommonList> readList() {
+       public Response readList() {
         throw new UnsupportedOperationException();
        }
        
@@ -92,7 +89,7 @@ public class WorkflowClient extends AbstractCommonListPoxServiceClientImpl<Workf
      * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)
      */
     @Override
-       public ClientResponse<Response> delete(String csid) {
+       public Response delete(String csid) {
         throw new UnsupportedOperationException();
     }
        
index e41e3e0de11dbe58d9cc4d772fd304b78c6bde40..842e851715c655d7874367cd77359ab0e7ab47f5 100644 (file)
@@ -26,7 +26,6 @@
  */
 package org.collectionspace.services.client;
 
-import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.core.Response;
 
 // FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
@@ -70,9 +69,9 @@ public class CollectionObjectClient extends AbstractCommonListPoxServiceClientIm
      * @see org.collectionspace.services.client.CollectionObjectProxy#roundtrip()
      * @return the client response< response>
      */
-    public ClientResponse<Response> roundtrip(int ms) {
+    public Response roundtrip(int ms) {
         getLogger().debug(">>>>Roundtrip start.");
-        ClientResponse<Response> result = getProxy().roundtrip(ms);
+        Response result = getProxy().roundtrip(ms);
         getLogger().debug("<<<<Roundtrip stop.");
         return result;
     }
index 76bb3bf4b6f6e380c396f3b468eb40cc4d8466c6..560fc46a5548988b518244f20c9708fa96f00b37 100644 (file)
@@ -32,7 +32,6 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 // FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
 
@@ -56,7 +55,7 @@ public interface CollectionObjectProxy extends CollectionSpaceCommonListPoxProxy
     @GET
     @Path("/{ms}/roundtrip")
     @Produces({"application/xml"})
-    ClientResponse<Response> roundtrip(@PathParam("ms") int ms);
+    Response roundtrip(@PathParam("ms") int ms);
     
     /**
      * Keyword search.
index ec8ede2b8d8fc627a87292b3648eb7a0313812b1..b4f25469880b78351ce16b0099593da8e70810e6 100644 (file)
                        <service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
                        <service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.dimension.nuxeo.DimensionDocumentModelHandler
                        </service:documentHandler>
+                       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
+                               <service:params>
+                                 <service:ListResultsFields>
+                                       <service:ListResultField>
+                                         <service:element>dimension</service:element>
+                                         <service:xpath>dimension</service:xpath>
+                                       </service:ListResultField>
+                                 </service:ListResultsFields>
+                               </service:params>
+                       </service:DocHandlerParams>
                        <service:object xmlns:service="http://collectionspace.org/services/config/service" name="Dimension"
                                version="1.0">
                                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="dimensions-system"
index 5d8df6075adc3ef30a1bb303033a354ef2d3b0d2..589bd07e098542810a2583da5abf553671727b6f 100644 (file)
@@ -215,7 +215,7 @@ public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonLi
         try {
             assertStatusCode(res, testName);
             // Extract the common part from the response.
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             conditioncheckCommon = (ConditionchecksCommon) extractPart(input,
                 conditioncheckClient.getCommonPartName(), ConditionchecksCommon.class);
             Assert.assertNotNull(conditioncheckCommon);
@@ -236,7 +236,7 @@ public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonLi
         AuthorityRefList list = null;
         try {
             assertStatusCode(res2, testName);
-            list = (AuthorityRefList)res2.getEntity();
+            list = res2.readEntity(AuthorityRefList.class);
             Assert.assertNotNull(list);
         } finally {
             if (res2 != null) {
index dff89419e605e0757204415ade45c402ee83fd57..c045f2b05f1292f3999760116ebfd99951b95f05 100644 (file)
@@ -266,7 +266,7 @@ public class ConditioncheckServiceTest extends AbstractPoxServiceTestImpl<Abstra
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
@@ -414,7 +414,7 @@ public class ConditioncheckServiceTest extends AbstractPoxServiceTestImpl<Abstra
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
             if (logger.isDebugEnabled()) {
                 logger.debug("got object to update with ID: " + knownResourceId);
             }
@@ -460,7 +460,7 @@ public class ConditioncheckServiceTest extends AbstractPoxServiceTestImpl<Abstra
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
index 20fed2f854a23fb5dd001d4cb8d9ce9ee8c70f99..8474604182b91bde1d2eef6e0c5697b090c540ff 100644 (file)
@@ -279,7 +279,7 @@ public class ContactServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
         Response res = client.read(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                ContactsCommon contact = (ContactsCommon) extractPart(input,
                        client.getCommonPartName(), ContactsCommon.class);
                Assert.assertNotNull(contact);
@@ -344,7 +344,7 @@ public class ContactServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
                if (logger.isDebugEnabled()) {
                    logger.debug("got object to update with ID: " + knownResourceId);
                }
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                contact = (ContactsCommon) extractPart(input,
                        client.getCommonPartName(), ContactsCommon.class);
                Assert.assertNotNull(contact);
@@ -400,7 +400,7 @@ public class ContactServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
         ContactsCommon updatedContact = null;
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                updatedContact = (ContactsCommon) extractPart(input,
                        client.getCommonPartName(), ContactsCommon.class);
                Assert.assertNotNull(updatedContact);
index c793cd5105fd6a809ccc7dbe0348636e23f2d14a..3fd48d4b9beef37cf32ad0207ff9aa6269ed36b4 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.dimension.DimensionsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-
 /**
  * A DimensionClient.
 
  * @version $Revision:$
  */
-public class DimensionClient extends AbstractPoxServiceClientImpl<DimensionsCommonList, DimensionProxy> {
+public class DimensionClient extends AbstractCommonListPoxServiceClientImpl<DimensionProxy> {
        public static final String SERVICE_NAME = "dimensions";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -56,14 +51,5 @@ public class DimensionClient extends AbstractPoxServiceClientImpl<DimensionsComm
        @Override
        public Class<DimensionProxy> getProxyClass() {
                return DimensionProxy.class;
-       }
-       
-       /*
-        * Proxied service calls
-        */
-       
-    public Response readList() {
-       DimensionProxy proxy = (DimensionProxy)getProxy();
-       return proxy.readList();
-    }  
+       }       
 }
index 64ac3dfeafc520cf5a8562fbb13ff198db285bb5..9d45d5002d8fae3ea6cfa4ad2964283c10ddb449 100644 (file)
@@ -1,15 +1,8 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.dimension.DimensionsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -17,21 +10,6 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/dimensions/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface DimensionProxy extends CollectionSpacePoxProxy<DimensionsCommonList> {
-    @GET
-    @Produces({"application/xml"})
-    Response readList();
-
-       @Override
-       @GET
-    @Produces({"application/xml"})
-    ClientResponse<DimensionsCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);    
-
-    @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<DimensionsCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
+public interface DimensionProxy extends CollectionSpaceCommonListPoxProxy {
+       // Intentionally left blank
 }
index b7c8b226626f23f5e234ca531475775de6dc7677..743c9fd5534da166429c98d7d1f51a9675566c14 100644 (file)
@@ -24,19 +24,16 @@ package org.collectionspace.services.client.test;
 
 //import java.util.ArrayList;
 import java.math.BigDecimal;
-import java.util.List;
 
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.DimensionClient;
 import org.collectionspace.services.client.DimensionFactory;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.dimension.DimensionsCommon;
-import org.collectionspace.services.dimension.DimensionsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.testng.Assert;
-//import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,7 +44,7 @@ import org.slf4j.LoggerFactory;
  * $LastChangedRevision: 917 $
  * $LastChangedDate: 2009-11-06 12:20:28 -0800 (Fri, 06 Nov 2009) $
  */
-public class DimensionServiceTest extends AbstractPoxServiceTestImpl<DimensionsCommonList, DimensionsCommon> {
+public class DimensionServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, DimensionsCommon> {
 
     /** The logger. */
     private final String CLASS_NAME = DimensionServiceTest.class.getName();
@@ -74,33 +71,6 @@ public class DimensionServiceTest extends AbstractPoxServiceTestImpl<DimensionsC
     protected CollectionSpaceClient getClientInstance() {
         return new DimensionClient();
     }
-
-    @Override
-    protected Class<DimensionsCommonList> getCommonListType() {
-       return DimensionsCommonList.class;
-    }
-
-    /*
-     * This method gets called by the parent's method public void readList(String testName)
-     */
-    protected void printList(String testName, DimensionsCommonList list) {
-        // Optionally output additional data about list members for debugging.
-        boolean iterateThroughList = false;
-        if (iterateThroughList && logger.isDebugEnabled()) {
-            List<DimensionsCommonList.DimensionListItem> items =
-                    list.getDimensionListItem();
-            int i = 0;
-            for (DimensionsCommonList.DimensionListItem item : items) {
-                logger.debug(testName + ": list-item[" + i + "] csid="
-                        + item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] objectNumber="
-                        + item.getDimension());
-                logger.debug(testName + ": list-item[" + i + "] URI="
-                        + item.getUri());
-                i++;
-            }
-        }
-    }
     
     protected void compareInstances(DimensionsCommon original, DimensionsCommon updated) throws Exception {
         Assert.assertEquals(original.getValueDate(),
index 6bd499298607d4cd97d3e5f9e37bc46dafff8879..e1b33db454e81ebb45589fb7110d38ca1e5b0ef7 100644 (file)
  */
 package org.collectionspace.services.dimension.nuxeo;
 
-import java.util.Iterator;
-import java.util.List;
-
-import org.collectionspace.services.dimension.DimensionJAXBSchema;
-import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.dimension.DimensionsCommon;
-import org.collectionspace.services.dimension.DimensionsCommonList;
-import org.collectionspace.services.dimension.DimensionsCommonList.DimensionListItem;
-
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
-import org.nuxeo.ecm.core.api.DocumentModel;
-import org.nuxeo.ecm.core.api.DocumentModelList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler;
 
 /**
  * DimensionDocumentModelHandler
@@ -46,94 +33,6 @@ import org.slf4j.LoggerFactory;
  * $LastChangedDate: $
  */
 public class DimensionDocumentModelHandler
-        extends RemoteDocumentModelHandlerImpl<DimensionsCommon, DimensionsCommonList> {
-
-    private final Logger logger = LoggerFactory.getLogger(DimensionDocumentModelHandler.class);
-    /**
-     * dimension is used to stash JAXB object to use when handle is called
-     * for Action.CREATE, Action.UPDATE or Action.GET
-     */
-    private DimensionsCommon dimension;
-    /**
-     * intakeList is stashed when handle is called
-     * for ACTION.GET_ALL
-     */
-    private DimensionsCommonList intakeList;
-
-
-    /**
-     * getCommonPart get associated dimension
-     * @return
-     */
-    @Override
-    public DimensionsCommon getCommonPart() {
-        return dimension;
-    }
-
-    /**
-     * setCommonPart set associated dimension
-     * @param dimension
-     */
-    @Override
-    public void setCommonPart(DimensionsCommon dimension) {
-        this.dimension = dimension;
-    }
-
-    /**
-     * getCommonPartList get associated dimension (for index/GET_ALL)
-     * @return
-     */
-    @Override
-    public DimensionsCommonList getCommonPartList() {
-        return intakeList;
-    }
-
-    @Override
-    public void setCommonPartList(DimensionsCommonList intakeList) {
-        this.intakeList = intakeList;
-    }
-
-    @Override
-    public DimensionsCommon extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc)
-            throws Exception {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void fillCommonPart(DimensionsCommon intakeObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public DimensionsCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
-        DimensionsCommonList coList = extractPagingInfo(new DimensionsCommonList(), wrapDoc) ;
-        AbstractCommonList commonList = (AbstractCommonList) coList;
-        commonList.setFieldsReturned("dimension|uri|csid");
-        List<DimensionsCommonList.DimensionListItem> list = coList.getDimensionListItem();
-        Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();
-        while(iter.hasNext()){
-            DocumentModel docModel = iter.next();
-            DimensionListItem ilistItem = new DimensionListItem();
-            ilistItem.setDimension((String) docModel.getProperty(getServiceContext().getCommonPartLabel(),
-                    DimensionJAXBSchema.DIMENSION));
-            String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());
-            ilistItem.setUri(getServiceContextPath() + id);
-            ilistItem.setCsid(id);
-            list.add(ilistItem);
-        }
-
-        return coList;
-    }
-
-    /**
-     * getQProperty converts the given property to qualified schema property
-     * @param prop
-     * @return
-     */
-    @Override
-    public String getQProperty(String prop) {
-        return DimensionConstants.NUXEO_SCHEMA_NAME + ":" + prop;
-    }
-    
+        extends NuxeoDocumentModelHandler<DimensionsCommon> {
+       
 }
-
index 9a08e4c14427be6565b0f992d81e99fae4fd7254..2fd2135d62fd3308c1d7158f550ff5c4a53441f2 100644 (file)
@@ -256,7 +256,7 @@ public class ExhibitionServiceTest extends AbstractPoxServiceTestImpl<AbstractCo
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
@@ -392,7 +392,7 @@ public class ExhibitionServiceTest extends AbstractPoxServiceTestImpl<AbstractCo
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
             if (logger.isDebugEnabled()) {
                 logger.debug("got object to update with ID: " + knownResourceId);
             }
@@ -438,7 +438,7 @@ public class ExhibitionServiceTest extends AbstractPoxServiceTestImpl<AbstractCo
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
index ad0f0d9ffcc43d82beb3b04ac4b82f562f6c81f1..69528e4ae287d318b5e31f2bfb4c6326e744ea2c 100644 (file)
@@ -37,30 +37,30 @@ public class IdClient extends AbstractServiceClientImpl<String, String, String,
     
     // Operations on ID Generators
     
-    public ClientResponse<Response> create(String xmlPayload) {
+    public Response create(String xmlPayload) {
         return getProxy().create(xmlPayload);
     }
 
-    public ClientResponse<String> read(String csid) {
+    public Response read(String csid) {
         return getProxy().read(csid);
     }
     
-    public ClientResponse<String> readList() {
+    public Response readList() {
         return getProxy().readList();
     }
     
     @Override
-    public ClientResponse<Response> delete(String csid) {
+    public Response delete(String csid) {
         return getProxy().delete(csid);
     }
     
     // Operations on IDs
 
-    public ClientResponse<String> createId(String csid) {
+    public Response createId(String csid) {
         return getProxy().createId(csid);
     }
 
        @Override
-       public ClientResponse<String> update(String csid, String payload) {
+       public Response update(String csid, String payload) {
                throw new UnsupportedOperationException("ID client does not support an update operation.");     }
 }
index 062c413489f73dc293ccb914fc7e21f609934f91..da9e86e23a9c6f2fe995beaeda859e026d13db28 100644 (file)
@@ -8,7 +8,6 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * IDProxy.
@@ -27,30 +26,30 @@ public interface IdProxy extends CollectionSpaceProxy<String> {
     @POST
     @Consumes({"application/xml"})
     @Produces({"*/*"})
-    ClientResponse<Response> create(String xmlPayload);
+    Response create(String xmlPayload);
     
     //(R)ead ID Generator
     @GET
     @Path("/{csid}")
     @Produces({"application/xml"})
-    ClientResponse<String> read(@PathParam("csid") String csid);
+    Response read(@PathParam("csid") String csid);
     
     // Read (L)ist of ID Generators
     @GET
     @Produces({"application/xml"})
-    ClientResponse<String> readList();
+    Response readList();
     
     //(D)elete ID Generator
     @DELETE
     @Path("/{csid}")
     @Override
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
+    Response delete(@PathParam("csid") String csid);
     
     // Operations on IDs
     
     //(C)reate ID
     @POST
     @Path("/{csid}/ids")
-    ClientResponse<String> createId(@PathParam("csid") String csid);
+    Response createId(@PathParam("csid") String csid);
  
 }
index 187b550bad7639ab6827dd1b11956f3839d1aff1..c53664b541d81538ca1e80e5c1d4edb28b6206b6 100644 (file)
@@ -88,7 +88,7 @@ public class IdServiceTest extends BaseServiceTest {
         
         String xmlPayload = getSampleSerializedIdGenerator();
         logger.debug("payload=\n" + xmlPayload);
-        ClientResponse<Response> res = client.create(xmlPayload);
+        Response res = client.create(xmlPayload);
         int statusCode = res.getStatus();
 
         // Check the status code of the response: does it match
@@ -128,11 +128,11 @@ public class IdServiceTest extends BaseServiceTest {
 
         // Submit the request to the service and store the response.
         IdClient client = new IdClient();
-        ClientResponse<String> res = client.createId(knownResourceId);
+        Response res = client.createId(knownResourceId);
         String generatedId = null;
         try {
                assertStatusCode(res, testName);
-               generatedId = res.getEntity();
+               generatedId = res.readEntity(String.class);
                Assert.assertNotNull(generatedId);
                Assert.assertFalse(generatedId.isEmpty());
                if (logger.isDebugEnabled()) {
@@ -140,7 +140,7 @@ public class IdServiceTest extends BaseServiceTest {
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         // Create a second ID.  Verify that it is different from the first.
@@ -149,7 +149,7 @@ public class IdServiceTest extends BaseServiceTest {
         res = client.createId(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               String secondGeneratedId = res.getEntity();
+               String secondGeneratedId = res.readEntity(String.class);
                Assert.assertNotNull(secondGeneratedId);
                Assert.assertFalse(secondGeneratedId.isEmpty());
                Assert.assertFalse(secondGeneratedId.equals(generatedId));
@@ -158,7 +158,7 @@ public class IdServiceTest extends BaseServiceTest {
                }
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
@@ -185,7 +185,7 @@ public class IdServiceTest extends BaseServiceTest {
 
         // Submit the request to the service and store the response.
         IdClient client = new IdClient();
-        ClientResponse<String> res = client.read(knownResourceId);
+        Response res = client.read(knownResourceId);
         int statusCode = res.getStatus();
 
         // Check the status code of the response: does it match
@@ -197,7 +197,7 @@ public class IdServiceTest extends BaseServiceTest {
                 invalidStatusCodeMessage(testRequestType, statusCode));
         Assert.assertEquals(statusCode, testExpectedStatusCode);
 
-        String entity = res.getEntity();
+        String entity = res.readEntity(String.class);
         Assert.assertNotNull(entity);
         if (logger.isDebugEnabled()) {
             logger.debug("entity body=\r" + entity);
@@ -221,33 +221,36 @@ public class IdServiceTest extends BaseServiceTest {
 
         // Submit the request to the service and store the response.
         IdClient client = new IdClient();
-        ClientResponse<String> res = client.readList();
-        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(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
+        Response res = client.readList();
+        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(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               if(logger.isDebugEnabled()){
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               if(logger.isDebugEnabled()){
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);        
 
-        String entity = res.getEntity();
-        Assert.assertNotNull(entity);
-        if (logger.isDebugEnabled()) {
-            logger.debug("entity body=\r" + entity);
+               String entity = res.readEntity(String.class);
+               Assert.assertNotNull(entity);
+               if (logger.isDebugEnabled()) {
+                   logger.debug("entity body=\r" + entity);
+               }
+        } finally {
+               res.close();
         }
-
     }
 
     // Failure outcomes
@@ -261,7 +264,7 @@ public class IdServiceTest extends BaseServiceTest {
 
         // Submit the request to the service and store the response.
         IdClient client = new IdClient();
-        ClientResponse<Response> res = client.delete(knownResourceId);
+        Response res = client.delete(knownResourceId);
         int statusCode = res.getStatus();
 
         // Check the status code of the response: does it match
index beb1e9a8d8a1ca22e8146ecc2d2dc7b70447fc2f..d1eaa709f2442c23b5ef61cacf7ecf05fcd8801b 100644 (file)
@@ -36,4 +36,5 @@ import javax.ws.rs.Produces;
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
 public interface IntakeProxy extends CollectionSpaceCommonListPoxProxy {
+       // Intentionally left blank
 }
index 6c60884fba84825919a48f715cb0a38716faeb18..eaeed2fa584f263bfc7106c5730036cabe2480fd 100644 (file)
@@ -250,7 +250,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         Response res = intakeClient.read(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                IntakesCommon intake = (IntakesCommon) extractPart(input,
                                intakeClient.getCommonPartName(), IntakesCommon.class);
                Assert.assertNotNull(intake);
@@ -269,7 +269,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         AuthorityRefList list = null;
         try {
                assertStatusCode(res, testName);
-               list = (AuthorityRefList)res.getEntity();
+               list = res.readEntity(AuthorityRefList.class);
         } finally {
                if (res != null) {
                        res.close();
index 237e090f0cc6a92511b305369b96622c580e659c..e95c8e67b8991a9e34e3ec7237001106c34889e2 100644 (file)
@@ -41,7 +41,7 @@ import org.collectionspace.services.intake.CurrentLocationGroup;
 import org.collectionspace.services.intake.CurrentLocationGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
+
 import org.testng.Assert;
 import org.testng.annotations.Test;
 import org.slf4j.Logger;
@@ -271,7 +271,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                }
                Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
        
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                res.close();
         }
@@ -326,7 +326,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
            } finally {
                res.close();
            }
index 271d12c8533b9d8416eb28d7f855e61fc1b1f672..5716a4dab76de969ceb0409a2e960a6f4599a540 100644 (file)
@@ -123,7 +123,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         createOrgRefs();
 
         IntakeClient intakeClient = new IntakeClient();
-        PoxPayloadOut multipart = createIntakeInstance(
+        PoxPayloadOut intakePayload = createIntakeInstance(
                 "entryNumber-" + identifier,
                 CURRENT_DATE_UTC,
                 currentOwnerRefName,
@@ -133,7 +133,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
                 insurerRefName,
                 valuerRefName );
 
-        Response res = intakeClient.create(multipart);
+        Response res = intakeClient.create(intakePayload);
         try {
                int statusCode = res.getStatus();
        
@@ -149,22 +149,25 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
+               String newIntakeId = extractId(res);
+            Assert.assertNotNull(newIntakeId, "Could not create a new Intake record.");
+
+               // Store the ID returned from the first resource created
+               // for additional tests below.            
+               if (knownIntakeId == null) {
+                   knownIntakeId = newIntakeId;
+                   if (logger.isDebugEnabled()) {
+                       logger.debug(testName + ": knownIntakeId=" + knownIntakeId);
+                   }
+               }
+               
+               // Store the IDs from every resource created by tests,
+               // so they can be deleted after tests have been run.
+               intakeIdsCreated.add(newIntakeId);
         } finally {
                res.close();
         }
 
-        // Store the ID returned from the first resource created
-        // for additional tests below.
-        if (knownIntakeId == null){
-            knownIntakeId = extractId(res);
-            if (logger.isDebugEnabled()) {
-                logger.debug(testName + ": knownIntakeId=" + knownIntakeId);
-            }
-        }
-        
-        // Store the IDs from every resource created by tests,
-        // so they can be deleted after tests have been run.
-        intakeIdsCreated.add(extractId(res));
     }
     
     /**
@@ -177,12 +180,16 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
                        ORGANIZATION_AUTHORITY_NAME, ORGANIZATION_AUTHORITY_NAME, orgAuthClient.getCommonPartName());
         Response res = orgAuthClient.create(multipart);
-        int statusCode = res.getStatus();
-
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, STATUS_CREATED);
-        orgAuthCSID = extractId(res);
+        try {
+               int statusCode = res.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, STATUS_CREATED);
+               orgAuthCSID = extractId(res);
+               Assert.assertNotNull(orgAuthCSID, "Could not create a new Organization authority record.");
+        } finally {
+               res.close();
+        }
         
                currentOwnerOrgCSID = createOrganization("olivierOwnerCompany", "Olivier Owner Company", "Olivier Owner Company");
         orgIdsCreated.add(currentOwnerOrgCSID);
@@ -211,6 +218,8 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
     }
 
     protected String createOrganization(String shortId, String shortName, String longName) {
+       String result = null;
+       
         OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
         Map<String, String> orgInfo = new HashMap<String,String>();
         orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
@@ -226,12 +235,18 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
                 orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
 
         Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
-        int statusCode = res.getStatus();
-
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, STATUS_CREATED);
-       return extractId(res);
+        try {
+               int statusCode = res.getStatus();
+       
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, STATUS_CREATED);
+               result = extractId(res);
+        } finally {
+               res.close();
+        }
+        
+        return result;
     }
 
     // Success outcomes
@@ -247,7 +262,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
        AuthorityRefDocList list = null;
        try {
           assertStatusCode(refDocListResp, testName);
-          list = (AuthorityRefDocList)refDocListResp.getEntity();
+          list = refDocListResp.readEntity(AuthorityRefDocList.class);
           Assert.assertNotNull(list);
        } finally {
           if (refDocListResp != null) {
index ce1afdfe48d7b639c9cae6e50b3a994e4e26991a..9b80e5b9c80095076613e8c3d40d740f65499dba 100644 (file)
@@ -254,7 +254,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         try {
                assertStatusCode(res, testName);
                // Extract the common part from the response.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                loaninCommon = (LoansinCommon) extractPart(input,
                    loaninClient.getCommonPartName(), LoansinCommon.class);
                Assert.assertNotNull(loaninCommon);
@@ -280,7 +280,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         AuthorityRefList list = null;
         try {
                assertStatusCode(res2, testName);
-               list = (AuthorityRefList)res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
                Assert.assertNotNull(list);
         } finally {
                if (res2 != null) {
index 3bacb0a2dbba34e0939dac1600f881a3e791d36f..6b87d4e1569b4272ad6725c2740b159672c6eef4 100644 (file)
@@ -266,7 +266,7 @@ public class LoaninServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -406,7 +406,7 @@ public class LoaninServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         PoxPayloadIn input = null;
         try {
                assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
                if (logger.isDebugEnabled()) {
                 logger.debug("got object to update with ID: " + knownResourceId);
             }
@@ -449,7 +449,7 @@ public class LoaninServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
index 03e44064974c5d79a1875f86ec7c66b908d6ded4..958962ccb5b0de08e02d58d0d6e243acd21c4b62 100644 (file)
@@ -43,8 +43,6 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanout.LoansoutCommon;
 import org.collectionspace.services.person.PersonTermGroup;
 
-import org.jboss.resteasy.client.ClientResponse;
-
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
@@ -145,6 +143,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
                newId = extractId(res);
+               Assert.assertNotNull(newId, "Could not create a new LoanOut record.");
         } finally {
                res.close();
         }
@@ -249,7 +248,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         try {
                assertStatusCode(res, testName);
                // Extract the common part from the response.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                loanoutCommon = (LoansoutCommon) extractPart(input,
                    loanoutClient.getCommonPartName(), LoansoutCommon.class);
                Assert.assertNotNull(loanoutCommon);
@@ -273,7 +272,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         AuthorityRefList list = null;
         try {
                assertStatusCode(res2, testName);
-               list = (AuthorityRefList)res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
         } finally {
                if (res2 != null) {
                        res2.close();
@@ -337,17 +336,17 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId);
+            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
         if (personAuthCSID != null) {
-               personAuthClient.delete(personAuthCSID);
+               personAuthClient.delete(personAuthCSID).close();
                // Delete Loans In resource(s).
                LoanoutClient loanoutClient = new LoanoutClient();
                for (String resourceId : loanoutIdsCreated) {
                    // Note: Any non-success responses are ignored and not reported.
-                   loanoutClient.delete(resourceId);
+                   loanoutClient.delete(resourceId).close();
                }
         }
     }
index b7397abe610244f277cfa96afaabe3ed5174ab4e..36d00af2afb7c0d919aedc7849800ce815b025eb 100644 (file)
@@ -281,7 +281,7 @@ public class LoanoutServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
         try {
                assertStatusCode(res, testName);
                // Get the common part of the response and verify that it is not null.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
                if (payloadInputPart != null) {
                    loanoutCommon = (LoansoutCommon) payloadInputPart.getBody();
@@ -402,7 +402,7 @@ public class LoanoutServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
         try {
                assertStatusCode(res, testName);
                // Extract the common part from the response.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
                if (payloadInputPart != null) {
                    loanoutCommon = (LoansoutCommon) payloadInputPart.getBody();
@@ -445,7 +445,7 @@ public class LoanoutServiceTest extends AbstractPoxServiceTestImpl<AbstractCommo
         try {
                assertStatusCode(res, testName);
                // Extract the updated common part from the response.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
                if (payloadInputPart != null) {
                    updatedLoanoutCommon = (LoansoutCommon) payloadInputPart.getBody();
index f45f064a1e572f6036d3c75f1ad98852b7db68c3..a1dddb006bf9adb79a03a3d7bef69267997dfe5e 100644 (file)
@@ -172,7 +172,7 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
         LocationsCommon location = null;
         try {
             assertStatusCode(res, testName);        
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                location = (LocationsCommon) extractPart(input,
                        client.getItemCommonPartName(), LocationsCommon.class);
                Assert.assertNotNull(location);
index c639cf44b5b02b479182085b9b86f48ffbff375a..e08972260bfb344234675822ebca78e36e64d180 100644 (file)
@@ -59,7 +59,7 @@ public class MediaClient extends AbstractCommonListPoxServiceClientImpl<MediaPro
      * Creates a new blob resource from the form data and associates it with an existing media resource
      *
      */
-    public ClientResponse<Response> createBlobFromFormData(String csid, // this is the Media resource CSID
+    public Response createBlobFromFormData(String csid, // this is the Media resource CSID
                MultipartFormDataOutput formDataOutput) {
         return getProxy().createBlobFromFormData(csid, formDataOutput);
     }    
@@ -71,14 +71,14 @@ public class MediaClient extends AbstractCommonListPoxServiceClientImpl<MediaPro
      * Creates a new blob
      *
      */
-    public ClientResponse<Response> createBlobFromUri(String csid, String blobUri) {
+    public Response createBlobFromUri(String csid, String blobUri) {
         return getProxy().createBlobFromUri(csid, blobUri, blobUri); //send the URI as both a query param and as content
     }
     
     /*
      * Create both a new media record
      */
-    public ClientResponse<Response> createMediaAndBlobWithUri(PoxPayloadOut xmlPayload, String blobUri, boolean purgeOriginal) {
+    public Response createMediaAndBlobWithUri(PoxPayloadOut xmlPayload, String blobUri, boolean purgeOriginal) {
        return getProxy().createMediaAndBlobWithUri(xmlPayload.getBytes(), blobUri, purgeOriginal);
     }
         
index 9d39f503e7e05e18f64731420d4fda62a67fcd1f..e78c14e5a028a66091e62f5139bb6cffed2712a2 100644 (file)
@@ -1,6 +1,5 @@
 package org.collectionspace.services.client;
 
-import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
 import javax.ws.rs.Consumes;
@@ -24,21 +23,21 @@ public interface MediaProxy extends CollectionSpaceCommonListPoxProxy {
     @POST
     @Path("{csid}")
     @Consumes("multipart/form-data")
-    ClientResponse<Response> createBlobFromFormData(@PathParam("csid") String csid,
+    Response createBlobFromFormData(@PathParam("csid") String csid,
                MultipartFormDataOutput formDataOutput);
             
     @POST
     @Path("{csid}")
        @Produces("application/xml")
        @Consumes("application/xml")
-    ClientResponse<Response>createBlobFromUri(@PathParam("csid") String csid,
+    Response createBlobFromUri(@PathParam("csid") String csid,
                @QueryParam(BlobClient.BLOB_URI_PARAM) String blobUri,
                String emptyXML); //this "emptyXML" param is needed to force RESTEasy to produce a Content-Type header for this POST    
 
     @POST
        @Produces("application/xml")
        @Consumes("application/xml")
-    ClientResponse<Response>createMediaAndBlobWithUri(byte[] xmlPayload,
+    Response createMediaAndBlobWithUri(byte[] xmlPayload,
                @QueryParam(BlobClient.BLOB_URI_PARAM) String blobUri,
                @QueryParam(BlobClient.BLOB_PURGE_ORIGINAL) boolean purgeOriginal);    
 }
index 8e4596d9f7fbba6ab24a3eea757c4fe8334f1b6b..ac26cf8bc6d2eb36295269d6d483d1bd57548cb3 100644 (file)
@@ -196,7 +196,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         MediaCommon media = null;
         try {
                assertStatusCode(res, testName);
-               input = new PoxPayloadIn((String)res.getEntity());
+               input = new PoxPayloadIn(res.readEntity(String.class));
                media = (MediaCommon) extractPart(input, mediaClient.getCommonPartName(), MediaCommon.class);
                Assert.assertNotNull(media);
                logger.debug(objectAsXmlString(media, MediaCommon.class));
@@ -214,7 +214,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         AuthorityRefList list = null;
         try {
                assertStatusCode(res2, testName);
-               list = (AuthorityRefList)res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
         } finally {
                if (res2 != null) {
                        res2.close();
@@ -258,7 +258,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId);
+            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
index 52ec0a60c046c0f9b3b2af9df674c917b4151d8e..b690e1c8665ca43fc730c5b85913c9164bebf33c 100644 (file)
@@ -154,20 +154,18 @@ public class MediaServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
                                //
                                if (blobFile != null) {
                                        client = new MediaClient();
-                                       ClientResponse<Response> res = null;
+                                       Response res = null;
                                        String mimeType = this.getMimeType(blobFile);
                                        logger.debug("Processing file URI: " + blobFile.getAbsolutePath());
                                        logger.debug("MIME type is: " + mimeType);
                                        if (fromUri == true) {
                                                URL childUrl = blobFile.toURI().toURL();
-                                               res = client.createBlobFromUri(mediaCsid,
-                                                               childUrl.toString());
+                                               res = client.createBlobFromUri(mediaCsid, childUrl.toString());
                                        } else {
                                                MultipartFormDataOutput formData = new MultipartFormDataOutput();
                                                OutputPart outputPart = formData.addFormData("file",
                                                                blobFile, MediaType.valueOf(mimeType));
-                                               res = client
-                                                               .createBlobFromFormData(mediaCsid, formData);
+                                               res = client.createBlobFromFormData(mediaCsid, formData);
                                        }
                                        try {
                                                assertStatusCode(res, testName);
@@ -178,7 +176,7 @@ public class MediaServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
                                                }
                                        } finally {
                                                if (res != null) {
-                                                       res.releaseConnection();
+                                                       res.close();
                                                }
                                        }
                                } else {
@@ -206,7 +204,7 @@ public class MediaServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
     public void createMediaAndBlobWithUri(String testName) throws Exception {
                MediaClient client = new MediaClient();
                PoxPayloadOut multipart = createMediaInstance(createIdentifier());
-               ClientResponse<Response> mediaRes = client.createMediaAndBlobWithUri(multipart, PUBLIC_URL_DECK, true); // purge the original
+               Response mediaRes = client.createMediaAndBlobWithUri(multipart, PUBLIC_URL_DECK, true); // purge the original
                String mediaCsid = null;
                try {
                        assertStatusCode(mediaRes, testName);
@@ -214,7 +212,7 @@ public class MediaServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
 //                     allResourceIdsCreated.add(mediaCsid); // Re-enable this and also add code to delete the associated blob
                } finally {
                        if (mediaRes != null) {
-                               mediaRes.releaseConnection();
+                               mediaRes.close();
                        }
                }
     }
@@ -232,7 +230,7 @@ public class MediaServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
 //        setupCreate();
 //        MediaClient client = new MediaClient();
 //        PoxPayloadOut multipart = createMediaInstance(createIdentifier());
-//        ClientResponse<Response> res = client.create(multipart);
+//        Response res = client.create(multipart);
 //        assertStatusCode(res, testName);
 //        String csid = extractId(res);
 //        
index 544d0fcf604a5ed4f444f9280b9e664a8f8ff52f..42d623bbb0062f036f73b726bc9c4920646dbf61 100644 (file)
@@ -17,8 +17,7 @@
 
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
+import javax.ws.rs.core.Response;
 
 /**
  * MovementClient.java
@@ -55,7 +54,7 @@ public class MovementClient extends AbstractCommonListPoxServiceClientImpl<Movem
      * @return
      * @see org.collectionspace.services.client.MovementProxy#readList(java.lang.String)
      */
-    public ClientResponse<AbstractCommonList> readListSortedBy(String sortFieldName) {
+    public Response readListSortedBy(String sortFieldName) {
         return getProxy().readListSortedBy(sortFieldName);
     }
 
@@ -65,7 +64,7 @@ public class MovementClient extends AbstractCommonListPoxServiceClientImpl<Movem
      * @return
      * @see org.collectionspace.services.client.MovementProxy#keywordSearchSortedBy(java.lang.String, java.lang.String)
      */
-    public ClientResponse<AbstractCommonList> keywordSearchSortedBy(String keywords, String sortFieldName) {
+    public Response keywordSearchSortedBy(String keywords, String sortFieldName) {
         return getProxy().keywordSearchSortedBy(keywords, sortFieldName);
     }    
 }
index d5554a5d9fc6f53ad560ef2588be657eb8f45f08..17fd5f5398396b202b68e0bfe6e77e1632beaa11 100644 (file)
 
 package org.collectionspace.services.client;
 
-import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
  * MovementProxy.java
@@ -48,25 +47,25 @@ public interface MovementProxy extends CollectionSpaceCommonListPoxProxy {
     // Sorted list
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readListSortedBy(
+    Response readListSortedBy(
         @QueryParam(IClientQueryParams.ORDER_BY_PARAM) String sortFieldName);
     
     @Override
        @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
+    Response readIncludeDeleted(
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     @Override
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
+    Response keywordSearchIncludeDeleted(
                @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchSortedBy(
+    Response keywordSearchSortedBy(
         @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
         @QueryParam(IClientQueryParams.ORDER_BY_PARAM) String sortFieldName);
 }
index ebcb49a73299400397777d36e8092dd016bf0575..bea5e5446959b73056c9da958020f48b787a13bc 100644 (file)
@@ -226,7 +226,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         try {
                assertStatusCode(res, testName);
                // Extract and return the common part of the record.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                PayloadInputPart payloadInputPart = input.getPart(movementClient.getCommonPartName());
                if (payloadInputPart != null) {
                        movementCommon = (MovementsCommon) payloadInputPart.getBody();
@@ -249,7 +249,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         AuthorityRefList list = null;
         try {
             assertStatusCode(res2, testName);
-               list = (AuthorityRefList)res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
         } finally {
                if (res2 != null) {
                        res2.close();
@@ -313,18 +313,18 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId);
+            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
         if (personAuthCSID != null) {
-               personAuthClient.delete(personAuthCSID);
+               personAuthClient.delete(personAuthCSID).close();
         }
         // Delete Movement resource(s).
         MovementClient movementClient = new MovementClient();
         for (String resourceId : movementIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            movementClient.delete(resourceId);
+            movementClient.delete(resourceId).close();
         }
     }
 
index 2c6e27093c4a857e92b46da8b7af14ead4a0b7f7..eb020ff1148ab81400e42d595a635f4102e9aed5 100644 (file)
@@ -430,13 +430,12 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
         final String EMPTY_SORT_FIELD_NAME = "";
-        ClientResponse<AbstractCommonList> res =
-                client.readListSortedBy(EMPTY_SORT_FIELD_NAME);
+        Response res = client.readListSortedBy(EMPTY_SORT_FIELD_NAME);
         try {
                assertStatusCode(res, testName);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -454,13 +453,12 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
 
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
-        ClientResponse<AbstractCommonList> res =
-                client.readListSortedBy(MovementJAXBSchema.LOCATION_DATE);
+        Response res = client.readListSortedBy(MovementJAXBSchema.LOCATION_DATE);
         try {
                assertStatusCode(res, testName);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -476,14 +474,13 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
         final String INVALID_SORT_ORDER_IDENTIFIER = "NO_DIRECTION";
-        ClientResponse<AbstractCommonList> res =
-                client.readListSortedBy(MovementJAXBSchema.LOCATION_DATE
+        Response res = client.readListSortedBy(MovementJAXBSchema.LOCATION_DATE
                 + " " + INVALID_SORT_ORDER_IDENTIFIER);
         try {
                assertStatusCode(res, testName);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -636,7 +633,7 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
         try {
                assertStatusCode(res, testName);
                // Extract and return the common part of the record.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
                if (payloadInputPart != null) {
                        movementCommon = (MovementsCommon) payloadInputPart.getBody();
@@ -677,11 +674,11 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
 
-        ClientResponse<AbstractCommonList> res = client.readListSortedBy(sortFieldName);
+        Response res = client.readListSortedBy(sortFieldName);
         AbstractCommonList list = null;
         try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
                 res.close();
@@ -702,15 +699,14 @@ public class MovementSortByTest extends BaseServiceTest<AbstractCommonList> {
         // Submit the request to the service and store the response.
         MovementClient client = new MovementClient();
 
-        ClientResponse<AbstractCommonList> res =
-                client.keywordSearchSortedBy(keywords, sortFieldName);
+        Response res = client.keywordSearchSortedBy(keywords, sortFieldName);
         AbstractCommonList list = null;
         try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
index 2445fb38bfeff991642179eb8e1602d448dc30f9..a1997c3c2e63a845fbc41018e7fff376845ab1dc 100644 (file)
@@ -45,8 +45,6 @@ import org.collectionspace.services.objectexit.StructuredDateGroup;
 import org.collectionspace.services.objectexit.ObjectexitCommon;
 import org.collectionspace.services.person.PersonTermGroup;
 
-import org.jboss.resteasy.client.ClientResponse;
-
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
@@ -125,23 +123,28 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
         PoxPayloadOut multipart = createObjectExitInstance(depositorRefName,
                 "exitNumber-" + identifier, CURRENT_DATE_UTC);
         Response res = objectexitClient.create(multipart);
+        String newId = null;
         try {
                assertStatusCode(res, testName);
+               newId = extractId(res);
+               Assert.assertNotNull(newId, "Could not create a new ObjectExit record.");
                if (knownResourceId == null) {// Store the ID returned from the first resource created for additional tests below.
-                   knownResourceId = extractId(res);
+                   knownResourceId = newId;
                }
         } finally {
                if (res != null) {
                 res.close();
             }
         }
-        objectexitIdsCreated.add(extractId(res));// Store the IDs from every resource created; delete on cleanup
+        
+               objectexitIdsCreated.add(newId);// Store the IDs from every resource created; delete on cleanup
     }
 
     protected void createPersonRefs() {
         PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
         // Create a temporary PersonAuthority resource, and its corresponding refName by which it can be identified.
-        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
+        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
+                       PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
         try {
                assertStatusCode(res, "createPersonRefs (not a surefire test)");
@@ -203,7 +206,7 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
         ObjectexitCommon objectexit = null;
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                objectexit = (ObjectexitCommon) extractPart(input, objectexitClient.getCommonPartName(), ObjectexitCommon.class);
                Assert.assertNotNull(objectexit);
                logger.debug(objectAsXmlString(objectexit, ObjectexitCommon.class));
@@ -222,7 +225,7 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
         AuthorityRefList list = null;
         try {
                assertStatusCode(res2, testName);
-               list = (AuthorityRefList)res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
         } finally {
                if (res2 != null) {
                        res2.close();
@@ -265,17 +268,17 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId);
+            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
         if (personAuthCSID != null) {
-            personAuthClient.delete(personAuthCSID);
+            personAuthClient.delete(personAuthCSID).close();
             // Delete Loans In resource(s).
             ObjectExitClient objectexitClient = new ObjectExitClient();
             for (String resourceId : objectexitIdsCreated) {
                 // Note: Any non-success responses are ignored and not reported.
-                objectexitClient.delete(resourceId);
+                objectexitClient.delete(resourceId).close();
             }
         }
     }
index 1543ec943d3a672b28a8f6b8cdc0338ac0141b28..ed9089b84bf7e83b973af558ca9f2904f519f29f 100644 (file)
@@ -34,7 +34,7 @@
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.common</artifactId>
             <optional>true</optional>
-            </dependency>        
+        </dependency>        
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.client</artifactId>
index 53c37e3cd442d47697b8a70d3d2a897476907936..ba52d76fdfe6fa9688c7064b033854d1aa596806 100644 (file)
@@ -92,8 +92,10 @@ public class OrgAuthorityClientUtils {
      * @return
      */
     public static String getOrgRefName(String inAuthority, String csid, OrgAuthorityClient client){
-       if(client==null)
+       if (client == null) {
                client = new OrgAuthorityClient();
+       }
+       
         Response res = client.readItem(inAuthority, csid);
         try {
                int statusCode = res.getStatus();
index db57d8aa7dbb9315dcaa3b57f4bba9b0550d8520..58f7e586651024ee7de90e2f177276ae3b60c4d8 100644 (file)
@@ -302,7 +302,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         OrganizationsCommon organization = null;
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                organization = (OrganizationsCommon) extractPart(input,
                    orgAuthClient.getItemCommonPartName(), OrganizationsCommon.class);
                Assert.assertNotNull(organization);
index b516ac4a8e646685e6c07a12f6e72c439557fac6..add12535fc0fbdf89db24e5b21c270f63793efe2 100644 (file)
@@ -314,7 +314,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
             assertStatusCode(res, testName);           
             //FIXME: remove the following try catch once Aron fixes signatures
             try {
-                PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                 OrgauthoritiesCommon orgAuthority = (OrgauthoritiesCommon) extractPart(input,
                         new OrgAuthorityClient().getCommonPartName(), OrgauthoritiesCommon.class);
                 if (logger.isDebugEnabled()) {
@@ -413,7 +413,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         try {
             assertStatusCode(res, testName);
             // Check whether we've received a organization.
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             OrganizationsCommon organization = (OrganizationsCommon) extractPart(input,
                     client.getItemCommonPartName(), OrganizationsCommon.class);
             Assert.assertNotNull(organization);
@@ -465,7 +465,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         try {
             assertStatusCode(res, testName);           
             // Check whether organization has expected displayName.
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             organization = (OrganizationsCommon) extractPart(input,
                     client.getItemCommonPartName(), OrganizationsCommon.class);
             Assert.assertNotNull(organization);
index 4f52d5746cdbdf64bfcc650163cfd78e9d872dfb..9bd7e4a9a7c80e8d2d2e7d6489209d7716a03643 100644 (file)
@@ -27,7 +27,7 @@
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.jaxb</artifactId>
             <version>${project.version}</version>
-        </dependency>        
+        </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
index cb4fb29898a9d0446d5e4d2ff5c967885f04fe54..16aca218f4f6e2e61608bd82e312834db925eb45 100644 (file)
@@ -43,11 +43,10 @@ import org.collectionspace.services.person.PersonTermGroupList;
 import org.collectionspace.services.person.PersonsCommon;
 import org.collectionspace.services.person.PersonauthoritiesCommon;
 import org.collectionspace.services.person.SchoolOrStyleList;
-import org.jboss.resteasy.client.ClientResponse;
-//import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.collectionspace.services.person.StructuredDateGroup;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.collectionspace.services.person.StructuredDateGroup;
 
 /**
  * The Class PersonAuthorityClientUtils.
@@ -77,7 +76,7 @@ public class PersonAuthorityClientUtils {
                }
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
-                   PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
+                   PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                    PersonauthoritiesCommon personAuthority = 
                        (PersonauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getCommonPartName(), PersonauthoritiesCommon.class);
@@ -111,7 +110,7 @@ public class PersonAuthorityClientUtils {
                }
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
-                   PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
+                   PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                    PersonsCommon person = 
                        (PersonsCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getItemCommonPartName(), PersonsCommon.class);
@@ -382,23 +381,7 @@ public class PersonAuthorityClientUtils {
                logger.debug("id=" + id);
         }
         return id;
-    }
-    
-    public static String extractId(ClientResponse<Response> res) {
-        MultivaluedMap<String, Object> mvm = res.getMetadata();
-        // FIXME: This may throw an NPE if the Location: header isn't present
-        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
-        if(logger.isDebugEnabled()){
-               logger.debug("extractId:uri=" + uri);
-        }
-        String[] segments = uri.split("/");
-        String id = segments[segments.length - 1];
-        if(logger.isDebugEnabled()){
-               logger.debug("id=" + id);
-        }
-        return id;
-    }
-    
+    }    
     
     /**
      * Returns an error message indicating that the status code returned by a
index b47f320656f45184fe89d1fe9a55dee341b154e2..57dfce266b171c3a23c9fd19f175421ec2af379c 100644 (file)
@@ -529,7 +529,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
             assertStatusCode(res, testName);
             //FIXME: remove the following try catch once Aron fixes signatures
             try {
-                PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
                         client.getCommonPartName(), PersonauthoritiesCommon.class);
                 Assert.assertNotNull(personAuthority);
@@ -616,7 +616,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         try {
             assertStatusCode(res, testName);
             // Check whether we've received a person.
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             PersonsCommon person = (PersonsCommon) extractPart(input,
                     client.getItemCommonPartName(), PersonsCommon.class);
             Assert.assertNotNull(person);
@@ -662,7 +662,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -922,7 +922,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
             if (logger.isDebugEnabled()) {
                 logger.debug("got PersonAuthority to update with ID: " + knownResourceId);
             }
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -949,7 +949,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         try {
             assertStatusCode(res, testName);
             // Retrieve the updated resource and verify that its contents exist.
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -989,7 +989,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
                         + knownItemResourceId
                         + " in PersonAuthority: " + knownResourceId);
             }
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -1029,7 +1029,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         try {
             assertStatusCode(res, testName);
             // Retrieve the updated resource and verify that its contents exist.
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
index 0f922e3b95c6428c385fd258921d7c3f08536c69..4846e0218dbdf00a10be1b619730f1e4fa09c53c 100644 (file)
@@ -177,7 +177,7 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
         PlacesCommon place= null;
         try {
             assertStatusCode(res, testName);        
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                place = (PlacesCommon) extractPart(input,
                        client.getItemCommonPartName(), PlacesCommon.class);
                Assert.assertNotNull(place);
index 25fea823225485f78d3ea76dba70fcc99b9dfb8e..6602f48e74b860c4c02a8af7f292e1a70847fac6 100644 (file)
@@ -192,7 +192,7 @@ public class PublicItemServiceTest extends
                PoxPayloadIn input = null;
                try {
                        assertStatusCode(res, testName);
-                       input = new PoxPayloadIn((String)res.getEntity());
+                       input = new PoxPayloadIn(res.readEntity(String.class));
                } finally {
                        if (res != null) {
                                res.close();
@@ -331,7 +331,7 @@ public class PublicItemServiceTest extends
                PoxPayloadIn input = null;
                try {
                        assertStatusCode(res, testName);
-                       input = new PoxPayloadIn((String)res.getEntity());
+                       input = new PoxPayloadIn(res.readEntity(String.class));
                        if (logger.isDebugEnabled()) {
                                logger.debug("got object to update with ID: " + knownResourceId);
                        }
@@ -378,7 +378,7 @@ public class PublicItemServiceTest extends
                        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                                        invalidStatusCodeMessage(testRequestType, statusCode));
                        Assert.assertEquals(statusCode, testExpectedStatusCode);
-                       input = new PoxPayloadIn((String)res.getEntity());
+                       input = new PoxPayloadIn(res.readEntity(String.class));
                } finally {
                        if (res != null) {
                                res.close();
index c070fdf2f872a3b637131aee747e71f4c7c94d1e..e756df276c774a15ae66887919be5125b954dc11 100644 (file)
@@ -26,7 +26,8 @@
  */
 package org.collectionspace.services.client;
 
-import org.jboss.resteasy.client.ClientResponse;
+import javax.ws.rs.core.Response;
+
 import org.collectionspace.services.relation.RelationsCommonList;
 
 /**
@@ -66,7 +67,7 @@ public class RelationClient extends AbstractPoxServiceClientImpl<RelationsCommon
         *
         * @return the client response
         */
-       public ClientResponse<RelationsCommonList> readList() {
+       public Response readList() {
                return getProxy().readList();
        }
 
@@ -80,7 +81,7 @@ public class RelationClient extends AbstractPoxServiceClientImpl<RelationsCommon
         * @param objectType 
         * @return the client response
         */
-       public ClientResponse<RelationsCommonList> readList(String subjectCsid,
+       public Response readList(String subjectCsid,
                        String subjectType,
                        String predicate,
                        String objectCsid,
@@ -88,7 +89,7 @@ public class RelationClient extends AbstractPoxServiceClientImpl<RelationsCommon
                return getProxy().readList(subjectCsid, subjectType, predicate, objectCsid, objectType);
        }
 
-    public ClientResponse<RelationsCommonList> readList(String subjectCsid,
+    public Response readList(String subjectCsid,
             String subjectType,
             String predicate,
             String objectCsid,
index 0ea4d843d95785065fb4fe730a0a2b59057cdc26..d31813795e09b30185d7ef316f722967f4be4d04 100644 (file)
@@ -9,8 +9,8 @@ import org.collectionspace.services.relation.RelationsCommonList;
 import org.collectionspace.services.client.IRelationsManager;
 import org.collectionspace.services.client.workflow.WorkflowClient;
 
-import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
 
 /**
  * @version $Revision:$
@@ -22,24 +22,24 @@ public interface RelationProxy extends CollectionSpacePoxProxy<RelationsCommonLi
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<RelationsCommonList> readList();
+    Response readList();
     
     @Override
        @GET
     @Produces({"application/xml"})
-    ClientResponse<RelationsCommonList> readIncludeDeleted(
+    Response readIncludeDeleted(
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);        
     
     @Override
     @GET
     @Produces({"application/xml"})
-    ClientResponse<RelationsCommonList> keywordSearchIncludeDeleted(
+    Response keywordSearchIncludeDeleted(
                @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<RelationsCommonList> readList(
+    Response readList(
                @QueryParam(IRelationsManager.SUBJECT_QP) String subjectCsid,
                @QueryParam(IRelationsManager.SUBJECT_TYPE_QP) String subjectType,
                @QueryParam(IRelationsManager.PREDICATE_QP) String predicate,
@@ -48,7 +48,7 @@ public interface RelationProxy extends CollectionSpacePoxProxy<RelationsCommonLi
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<RelationsCommonList> readList(
+    Response readList(
                @QueryParam(IRelationsManager.SUBJECT_QP) String subjectCsid,
                @QueryParam(IRelationsManager.SUBJECT_TYPE_QP) String subjectType,
                @QueryParam(IRelationsManager.PREDICATE_QP) String predicate,
index 2ab912ceca08d0c7add5b63c016a157043d974c6..a2bb522803a994dfb127355a298d968beaeff446 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
-
 import org.collectionspace.services.common.invocable.InvocationContext;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * A ReportClient.
@@ -80,12 +76,12 @@ public class ReportClient extends AbstractCommonListPoxServiceClientImpl<ReportP
      * @return
      * @see org.collectionspace.services.client.ReportProxy#getReport()
      */
-    public ClientResponse<AbstractCommonList> readListFiltered(
+    public Response readListFiltered(
                        String docType, String mode) {
         return getProxy().readListFiltered(docType, mode);
     }
     
-    public ClientResponse<Response> publishReport(String csid,
+    public Response publishReport(String csid,
                InvocationContext invContext) {
        return getProxy().publishReport(csid, invContext);
     }
index 8dc0a5886f6a40d08322d05d8bcebb936769e25e..2d20da2cb824ed6b958d94160e71745e5749f35c 100644 (file)
@@ -36,8 +36,6 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.invocable.InvocationContext;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -50,13 +48,13 @@ public interface ReportProxy extends CollectionSpaceCommonListPoxProxy {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readListFiltered(
+    Response readListFiltered(
                @QueryParam(IQueryManager.SEARCH_TYPE_DOCTYPE) String docType,
                @QueryParam(IQueryManager.SEARCH_TYPE_INVOCATION_MODE) String mode);
     
     @POST
     @Path("{csid}/publish")
-    ClientResponse<Response> publishReport(@PathParam("csid") String csid,
+    Response publishReport(@PathParam("csid") String csid,
                InvocationContext invContext);
     
 }
index 03cf451777b8d21d3101e1e7ec56ed559bc61217..e9f753bb543189db76263bf6f6d12e61a70dd677 100644 (file)
@@ -128,21 +128,25 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
        invocationContext.setMode("single");
        invocationContext.setSingleCSID(acquisitionCsid);
        
-        ClientResponse<Response> res = client.publishReport(reportCsid, invocationContext);
-        int statusCode = res.getStatus();
-        setupCreate();
-
-        // Check the status code of the response: does it match
-        // the expected response(s)?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res = client.publishReport(reportCsid, invocationContext);
+        try {
+               int statusCode = res.getStatus();
+               setupCreate();
+       
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               String publicItemCsid = extractId(res);
+               Assert.assertNotNull(publicItemCsid);
+        } finally {
+               res.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        String publicItemCsid = extractId(res);
-        Assert.assertNotNull(publicItemCsid);
     }
     
     /* (non-Javadoc)
@@ -161,16 +165,17 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
 
        // Submit the request to the service and store the response.
        ReportClient client = new ReportClient();
-       ClientResponse<AbstractCommonList> res = client.readListFiltered(testDocType, "single");
+       Response res = client.readListFiltered(testDocType, "single");
        AbstractCommonList list = null;
        try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
        } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
        }
+       
        List<AbstractCommonList.ListItem> items = list.getListItem();
        // We must find the basic one we created
        boolean fFoundBaseItem = false;
@@ -181,7 +186,8 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                                break;
                        }
                }
-               if(!fFoundBaseItem) {
+               
+               if (!fFoundBaseItem) {
                        Assert.fail("readListFiltered failed to return base item");
                }
                
@@ -189,10 +195,10 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
        res = client.readListFiltered("Intake", "single");
        try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
        } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
        }
 
@@ -207,10 +213,10 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
        res = client.readListFiltered(testDocType, "group");
        try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
        } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
        }
 
index 5a76c44793a3d8ec60803412293d1bdc2320a268..acc3774c86ccb6cf0299a0037c94ec10ef800167 100644 (file)
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
         <dependency>
             <groupId>commons-httpclient</groupId>
             <artifactId>commons-httpclient</artifactId>
index 2c74259bbbf78945ddef107be5e6914ffd2ca054..f7e8de43afccc5c9a9747ec6e4548db5f66c94cd 100644 (file)
@@ -110,7 +110,7 @@ public class AuthenticationServiceTest extends BaseServiceTest<AbstractCommonLis
         AccountsCommon account =
                 createAccountInstance("barney", "barney08", "barney@dinoland.com",
                 accountClient.getTenantId(), false);
-        ClientResponse<Response> res = accountClient.create(account);
+        Response res = accountClient.create(account);
         try {
                int statusCode = res.getStatus();
        
@@ -146,23 +146,26 @@ public class AuthenticationServiceTest extends BaseServiceTest<AbstractCommonLis
         AccountsCommon account =
                 createAccountInstance("george", "george08", "george@curiousland.com",
                 accountClient.getTenantId(), false);
-        ClientResponse<Response> res = accountClient.create(account);
-        int statusCode = res.getStatus();
-
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": george status = " + statusCode);
-        }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-
-        // Store the ID returned from this create operation
-        // for additional tests below.
-        georgeAccountId = extractId(res);
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": georgeAccountId=" + georgeAccountId);
+        Response res = accountClient.create(account);
+        try {
+               int statusCode = res.getStatus();
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": george status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               // Store the ID returned from this create operation
+               // for additional tests below.
+               georgeAccountId = extractId(res);
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": georgeAccountId=" + georgeAccountId);
+               }
+        } finally {
+               res.close();
         }
-        res.releaseConnection();
+        
         //deactivate
         setupUpdate();
         account.setStatus(Status.INACTIVE);
@@ -173,16 +176,19 @@ public class AuthenticationServiceTest extends BaseServiceTest<AbstractCommonLis
         }
 
         // Submit the request to the service and store the response.
-        ClientResponse<AccountsCommon> res1 = accountClient.update(georgeAccountId, account);
-        statusCode = res1.getStatus();
-        // Check the status code of the response: does it match the expected response(s)?
-        if (logger.isDebugEnabled()) {
-            logger.debug(testName + ": status = " + statusCode);
+        Response res1 = accountClient.update(georgeAccountId, account);
+        try {
+               int statusCode = res1.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(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               res1.close();
         }
-        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(testRequestType, statusCode));
-        Assert.assertEquals(statusCode, testExpectedStatusCode);
-        res1.releaseConnection();
     }
 
 
index c9f079ec1c342a342aef55121b546c47bb01e7f7..264d0444503451c213bcdd362fe304aee9ccbd9d 100644 (file)
@@ -35,7 +35,6 @@ import java.util.List;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.authorization.AccountRole;
@@ -414,7 +413,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         Response res = client.read(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                DimensionsCommon dimension = (DimensionsCommon) extractPart(input,
                        client.getCommonPartName(), DimensionsCommon.class);
                Assert.assertNotNull(dimension);
@@ -659,7 +658,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         PermissionClient permClient = new PermissionClient();
         Permission permission = PermissionFactory.createPermissionInstance(resName,
                 "default permissions for " + resName, actions, effect, true, true, true);
-        ClientResponse<Response> res = permClient.create(permission);
+        Response res = permClient.create(permission);
         try {
                assertStatusCode(res, "CreatePermission");
                result = extractId(res);
@@ -693,7 +692,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         Role role = RoleFactory.createRoleInstance(roleName,
                        roleName, //the display name
                 "role for " + roleName, true);
-        ClientResponse<Response> res = roleClient.create(role);
+        Response res = roleClient.create(role);
         try {
                assertStatusCode(res, "CreateRole");
                result = extractId(res);
@@ -727,7 +726,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         AccountsCommon account = AccountFactory.createAccountInstance(
                 userName, userName, userName, email, accountClient.getTenantId(),
                 true, false, true, true);
-        ClientResponse<Response> res = accountClient.create(account);
+        Response res = accountClient.create(account);
         try {
                assertStatusCode(res, "CreateAccount");
                result = extractId(res);
@@ -762,7 +761,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         AccountRole accRole = AccountRoleFactory.createAccountRoleInstance(
                 av, rvs, true, true);
         AccountRoleClient client = new AccountRoleClient();
-        ClientResponse<Response> res = client.create(av.getAccountId(), accRole);
+        Response res = client.create(av.getAccountId(), accRole);
         try {
                assertStatusCode(res, "CreateAccountRole");
                result = extractId(res);
@@ -803,7 +802,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         PermissionRole permRole = PermissionRoleFactory.createPermissionRoleInstance(
                 pv, rvls, true, true);
         PermissionRoleClient client = new PermissionRoleClient();
-        ClientResponse<Response> res = client.create(pv.getPermissionId(), permRole);
+        Response res = client.create(pv.getPermissionId(), permRole);
         try {
                assertStatusCode(res, "CreatePermissionRole");
                result = extractId(res);
index 2e28b189a526f9ef657109d4297ad668c2b02d6e..9cfb592b4e5aa302a8544d657ad129272a6a118d 100644 (file)
@@ -33,6 +33,7 @@ import java.util.Date;
 import java.util.Hashtable;
 import java.util.List;
 import javax.ws.rs.core.Response;
+
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.authorization.AccountRole;
 import org.collectionspace.services.authorization.AccountValue;
@@ -64,7 +65,6 @@ import org.collectionspace.services.client.RoleFactory;
 import org.collectionspace.services.client.test.BaseServiceTest;
 import org.collectionspace.services.dimension.DimensionsCommon;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -371,7 +371,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
         Response res = client.read(id);
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                result = (DimensionsCommon) extractPart(input,
                        client.getCommonPartName(), DimensionsCommon.class);
         } finally {
@@ -571,7 +571,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
                 "default permissions for " + resName,
                 actions, effect, true, true, true);
         permission.setTenantId(tenantId);
-        ClientResponse<Response> res = permClient.create(permission);
+        Response res = permClient.create(permission);
         try {
                assertStatusCode(res, "CreatePermission");
                result = extractId(res);
@@ -610,7 +610,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
                        roleName, //the display name
                 "role for " + roleName, true);
         role.setTenantId(tenantId);
-        ClientResponse<Response> res = roleClient.create(role);
+        Response res = roleClient.create(role);
         try {
                assertStatusCode(res, "CreateRole");
                result = extractId(res);
@@ -648,7 +648,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
         AccountsCommon account = AccountFactory.createAccountInstance(
                 userName, userName, userName, email, tenantId,
                 true, false, true, true);
-        ClientResponse<Response> res = accountClient.create(account);
+        Response res = accountClient.create(account);
         try {
                assertStatusCode(res, "CreateAccount");
                result = extractId(res);
@@ -687,7 +687,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
         AccountRoleClient client = new AccountRoleClient();
         UserInfo ui = tenantAdminUsers.get(tenantId);
         client.setAuth(true, ui.userName, true, ui.password, true);
-        ClientResponse<Response> res = client.create(av.getAccountId(), accRole);
+        Response res = client.create(av.getAccountId(), accRole);
         try {
                assertStatusCode(res, "CreateAccountRole");
                result = extractId(res);
@@ -733,7 +733,7 @@ public class MultiTenancyTest extends BaseServiceTest<AbstractCommonList> {
         PermissionRoleClient client = new PermissionRoleClient();
         UserInfo ui = tenantAdminUsers.get(tenantId);
         client.setAuth(true, ui.userName, true, ui.password, true);
-        ClientResponse<Response> res = client.create(pv.getPermissionId(), permRole);
+        Response res = client.create(pv.getPermissionId(), permRole);
         try {
                assertStatusCode(res, "createPermissionRole");
                result = extractId(res);
index 5ec63fdeaf51678f6682020e2cc9ab137432a8ea..5125a8e7d1044f2e945f45b9a8d6a8d832d9893b 100644 (file)
@@ -95,7 +95,7 @@ public class ServiceGroupServiceTest extends BaseServiceTest<AbstractCommonList>
             if (getLogger().isDebugEnabled()) {
                getLogger().debug("Reading part " + partLabel + " ...");
             }
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             PayloadInputPart payloadInputPart = input.getPart(partLabel);
             Assert.assertNotNull(payloadInputPart,
                     "Part " + partLabel + " was unexpectedly null.");
index 49fc0d455f2fa13a9990fcc6e2343f7cadd82b5a..9fda7e04427b00f2886166b1bf0ad3428692d058 100644 (file)
@@ -203,7 +203,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         try {
             assertStatusCode(res, testName);
             // Check whether Taxonomy has expected displayName.
-            PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             taxon = (TaxonCommon) extractPart(input,
                     client.getItemCommonPartName(), TaxonCommon.class);
             Assert.assertNotNull(taxon);
index 7f574aaf293c53c3b83e6beaf01ecee3f2d874d5..2124863141f3dd1a92909dfa1e0d50fdacffbbd7 100644 (file)
@@ -256,7 +256,7 @@ public class ValuationcontrolServiceTest extends AbstractPoxServiceTestImpl<Abst
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
@@ -392,7 +392,7 @@ public class ValuationcontrolServiceTest extends AbstractPoxServiceTestImpl<Abst
         PoxPayloadIn input = null;
         try {
             assertStatusCode(res, testName);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
             if (logger.isDebugEnabled()) {
                 logger.debug("got object to update with ID: " + knownResourceId);
             }
@@ -438,7 +438,7 @@ public class ValuationcontrolServiceTest extends AbstractPoxServiceTestImpl<Abst
             Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                     invalidStatusCodeMessage(testRequestType, statusCode));
             Assert.assertEquals(statusCode, testExpectedStatusCode);
-            input = new PoxPayloadIn((String)res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
             if (res != null) {
                 res.close();
index 8021b52c438325a1c59fdf672c3a97389ee1a904..bad57f61a611282698e9c8efc52ce082f447ecf0 100644 (file)
@@ -149,7 +149,7 @@ public class VocabularyServiceTest extends AbstractAuthorityServiceTest<Vocabula
         try {
                assertStatusCode(res, testName);
                // Check whether Person has expected displayName.
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                vitem = (VocabularyitemsCommon) extractPart(input,
                        client.getItemCommonPartName(), VocabularyitemsCommon.class);
                Assert.assertNotNull(vitem);
index 3a4cd9851e81f640d06a9c46dcf483fd940ff558..dca46a86ce39d5fd393df7eae7e5a429e432ab11 100644 (file)
@@ -181,7 +181,7 @@ public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest<Worka
                WorksCommon work = null;
                try {
                        assertStatusCode(res, testName);
-                       PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                       PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                        work = (WorksCommon) extractPart(input,
                                        client.getItemCommonPartName(), WorksCommon.class);
                        Assert.assertNotNull(work);
index 47b67d9f8c3b508fe7a75f3cd86606b04a8f991d..c1dd0532ed532a3dddc0e051d25a0f50b2efd181 100644 (file)
@@ -83,7 +83,7 @@ public class WorkflowServiceTest extends AbstractPoxServiceTestImpl<AbstractComm
         Response res = client.getWorkflow(knownResourceId);
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                WorkflowCommon workflowsCommon = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class);
                if (logger.isDebugEnabled() == true) {
                        logger.debug("Workflow payload is: " + input.getXmlPayload());