]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6770: All tests for CollectionObject passing.
authorremillet <remillet@yahoo.com>
Tue, 11 Aug 2015 17:08:38 +0000 (10:08 -0700)
committerremillet <remillet@yahoo.com>
Tue, 11 Aug 2015 17:08:38 +0000 (10:08 -0700)
24 files changed:
services/citation/client/src/test/java/org/collectionspace/services/client/test/CitationAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java
services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsProxy.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
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/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthoritySearchTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServicePerfTest.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/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java
services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java

index 98f99d3f20af84d3e29a7c3956b146fc3b8c0852..827e74ab2ac9efbfdb21e79ad6ad6415d383795b 100644 (file)
@@ -23,6 +23,9 @@ package org.collectionspace.services.client.test;
 
 import java.util.List;
 import java.util.Map;
+
+import javax.ws.rs.core.Response;
+
 import org.collectionspace.services.CitationJAXBSchema;
 import org.collectionspace.services.citation.CitationTermGroup;
 import org.collectionspace.services.citation.CitationTermGroupList;
@@ -168,7 +171,7 @@ public class CitationAuthorityServiceTest extends AbstractAuthorityServiceTest<C
 
         // Submit the request to the service and store the response.
         CitationAuthorityClient client = new CitationAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (shortId != null) {
@@ -179,9 +182,9 @@ public class CitationAuthorityServiceTest extends AbstractAuthorityServiceTest<C
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
-            res.releaseConnection();
+            res.close();
         }
         List<AbstractCommonList.ListItem> items =
                 list.getListItem();
index 85596a5cea77740b581c797f7ca2611bd8ec508d..f492bdd9c02afbbe40f359fb4c81983440f08c47 100644 (file)
@@ -37,16 +37,16 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
     Response readItem(String vcsid, String csid);
     
     //(R)ead Item
-    ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted);    
+    Response readItem(String vcsid, String csid, Boolean includeDeleted);    
 
     //(U)pdate Item
-    ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
+    Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
 
     //(D)elete Item
     Response deleteItem(String vcsid, String csid);
     
     // Get a list of objects that
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(
+    Response getReferencingObjects(
             String parentcsid,
             String itemcsid);
     /**
@@ -58,15 +58,15 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      * @return
      * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
      */
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid);    
+    public Response getItemAuthorityRefs(String parentcsid, String itemcsid);    
     
     /*
      * 
      */
     
-    ClientResponse<String> readByName(String name);
+    Response readByName(String name);
     
-    ClientResponse<String> readByName(String name, Boolean includeDeleted);
+    Response readByName(String name, Boolean includeDeleted);
     
     /*
      * Item subresource methods
@@ -79,9 +79,9 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      * @param shortId the shortIdentifier
      * @return the client response
      */
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId);
+    public Response readNamedItem(String vcsid, String shortId);
 
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted);
+    public Response readNamedItem(String vcsid, String shortId, Boolean includeDeleted);
 
     /**
      * Read item in Named Authority.
@@ -90,9 +90,9 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);
+    public Response readItemInNamedAuthority(String authShortId, String csid);
 
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);
+    public Response readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted);
 
     /**
      * Read named item in Named Authority.
@@ -101,9 +101,9 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      * @param itemShortId the shortIdentifier for the item
      * @return the client response
      */
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);
+    public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId);
     
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);
+    public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted);
     
     /**
      * Read item list, filtering by partial term match, or keywords. Only one of
@@ -117,9 +117,9 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords);
+    public Response readItemList(String inAuthority, String partialTerm, String keywords);
     
-    public ClientResponse<AbstractCommonList> readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);
+    public Response readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted);
     
     /**
      * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
@@ -133,10 +133,10 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      *     which will filter list results to return only matched resources.
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, 
+    public Response readItemListForNamedAuthority(String specifier, 
                String partialTerm, String keywords);
     
-    public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(String specifier, 
+    public Response readItemListForNamedAuthority(String specifier, 
                String partialTerm, 
                String keywords,
                Boolean includeDeleted);
@@ -145,7 +145,7 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
      * Workflow related methods
      */
     
-    public ClientResponse<String> readItemWorkflow(String vcsid, String csid);
+    public Response readItemWorkflow(String vcsid, String csid);
     
-    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);
+    public Response updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition);
 }
index d8e1d3de72b937ff6826d03cfa722d76dfc59f17..2024c7110b996c9b87e6f641403c0a22b424a30b 100644 (file)
@@ -32,13 +32,13 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
     }
     
     @Override
-    public ClientResponse<String> readItem(String vcsid, String csid, Boolean includeDeleted) {
+    public Response readItem(String vcsid, String csid, Boolean includeDeleted) {
        return getProxy().readItem(vcsid, csid, includeDeleted.toString());
     }
 
     //(U)pdate Item
     @Override
-       public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
+       public Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
        return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());
     }
 
@@ -49,7 +49,7 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
     }
     
     @Override
-       public ClientResponse<AuthorityRefDocList> getReferencingObjects(
+       public Response getReferencingObjects( // ClientResponse<AuthorityRefDocList>
             String parentcsid,
             String itemcsid) {
        return getProxy().getReferencingObjects(parentcsid, itemcsid, Boolean.TRUE.toString());
@@ -63,7 +63,7 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      * @return the item authority refs
      */
     @Override
-       public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
+       public Response getItemAuthorityRefs(String parentcsid, String csid) {
         return getProxy().getItemAuthorityRefs(parentcsid, csid);
     }
     
@@ -72,12 +72,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      */
     
     @Override
-       public ClientResponse<String> readByName(String name) {
+       public Response readByName(String name) {
        return getProxy().readByName(name, INCLUDE_DELETE_TRUE);
     }
     
     @Override
-       public ClientResponse<String> readByName(String name, Boolean includeDeleted) {
+       public Response readByName(String name, Boolean includeDeleted) {
        return getProxy().readByName(name, includeDeleted.toString());
     }
     
@@ -93,12 +93,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
+       public Response readNamedItem(String vcsid, String shortId) {
         return getProxy().readNamedItem(vcsid, shortId, INCLUDE_DELETE_TRUE);
     }
 
     @Override
-       public ClientResponse<String> readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {
+       public Response readNamedItem(String vcsid, String shortId, Boolean includeDeleted) {
         return getProxy().readNamedItem(vcsid, shortId, includeDeleted.toString());
     }
 
@@ -110,12 +110,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
+       public Response readItemInNamedAuthority(String authShortId, String csid) {
         return getProxy().readItemInNamedAuthority(authShortId, csid, INCLUDE_DELETE_TRUE);
     }
 
     @Override
-       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {
+       public Response readItemInNamedAuthority(String authShortId, String csid, Boolean includeDeleted) {
         return getProxy().readItemInNamedAuthority(authShortId, csid, includeDeleted.toString());
     }
 
@@ -127,12 +127,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
+       public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
         return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, INCLUDE_DELETE_TRUE);
     }
 
     @Override
-       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {
+       public Response readNamedItemInNamedAuthority(String authShortId, String itemShortId, Boolean includeDeleted) {
         return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId, includeDeleted.toString());
     }
 
@@ -149,14 +149,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      * @return the client response
      */
     @Override
-    public ClientResponse<AbstractCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords) {
+    public Response readItemList(String inAuthority, String partialTerm, String keywords) {
         return getProxy().readItemList(inAuthority, partialTerm, keywords, INCLUDE_DELETE_TRUE);
     }
 
     @Override
-    public ClientResponse<AbstractCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {
+    public Response readItemList(String inAuthority, String partialTerm, String keywords, Boolean includeDeleted) {
         return getProxy().readItemList(inAuthority, partialTerm, keywords, includeDeleted.toString());
     }
 
@@ -174,13 +172,13 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
      */
 
        @Override
-       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+       public Response readItemListForNamedAuthority(
                        String specifier, String partialTerm, String keywords) {
         return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords, INCLUDE_DELETE_TRUE);
        }
 
        @Override
-       public ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+       public Response readItemListForNamedAuthority(
                        String specifier, 
                        String partialTerm, 
                        String keywords,
@@ -193,12 +191,12 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
         */
        
        @Override
-    public ClientResponse<String> readItemWorkflow(String vcsid, String csid) {
+    public Response readItemWorkflow(String vcsid, String csid) {
        return getProxy().readItemWorkflow(vcsid, csid);
     }
     
        @Override
-    public ClientResponse<String> updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {
+    public Response updateItemWorkflowWithTransition(String vcsid, String csid, String workflowTransition) {
        return getProxy().updateItemWorkflowWithTransition(vcsid, csid, workflowTransition);
     }
        
index 0d9ccdf12b81c6dc1623fce47d9f9ccf706d618b..f541478d2cb2fc123e19b7af384850e6819d976a 100644 (file)
@@ -30,19 +30,19 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     //(C)reate Item
     @POST
     @Path("/{vcsid}/items/")
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
+    Response createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
 
     //(R)ead Item
     @GET
     @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid,
+    Response readItem(@PathParam("vcsid") String vcsid,
                @PathParam("csid") String csid,
                @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
     
     //(U)pdate Item
     @PUT
     @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
+    Response updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
 
     //(D)elete Item
     @DELETE
@@ -61,7 +61,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @GET
     @Path("{csid}/items/{itemcsid}/refObjs")
     @Produces("application/xml")
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(
+    Response getReferencingObjects( // ClientResponse<AuthorityRefDocList>
             @PathParam("csid") String parentcsid,
             @PathParam("itemcsid") String itemcsid,
             @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
@@ -70,7 +70,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @GET
     @Produces({"application/xml"})
     @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(
+    public Response getItemAuthorityRefs( // public ClientResponse<AuthorityRefList>
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid);
     
@@ -81,7 +81,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     //(R)ead by name
     @GET
     @Path("/urn:cspace:name({name})")
-    ClientResponse<String> readByName(@PathParam("name") String name,
+    Response readByName(@PathParam("name") String name,
                @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
     
     /*
@@ -91,21 +91,21 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     //(R)ead Named Item
     @GET
     @Path("/{vcsid}/items/urn:cspace:name({specifier})")
-    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid,
+    Response readNamedItem(@PathParam("vcsid") String vcsid,
                @PathParam("specifier") String specifier,
                @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     //(R)ead Item In Named Authority
     @GET
     @Path("/urn:cspace:name({specifier})/items/{csid}")
-    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier,
+    Response readItemInNamedAuthority(@PathParam("specifier") String specifier,
                @PathParam("csid") String csid,
                @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
 
     //(R)ead Named Item In Named Authority
     @GET
     @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
-    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, 
+    Response readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, 
                @PathParam("itemspecifier") String itemspecifier,
                @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState);
     
@@ -117,7 +117,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @GET
     @Produces({"application/xml"})
     @Path("/{csid}/items/")
-    ClientResponse<AbstractCommonList> readItemList(
+    Response readItemList(
                @PathParam("csid") String vcsid,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@@ -127,7 +127,7 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
-    ClientResponse<AbstractCommonList> readItemListForNamedAuthority(
+    Response readItemListForNamedAuthority( // ClientResponse<AbstractCommonList>
                @PathParam("specifier") String specifier,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@@ -143,13 +143,13 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @Produces({"application/xml"})
     @Consumes({"application/xml"})    
     @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH)
-    ClientResponse<String> readItemWorkflow(@PathParam("vcsid") String vcsid,
+    Response readItemWorkflow(@PathParam("vcsid") String vcsid,
                @PathParam("csid") String csid);
             
     //(U)pdate Item workflow
     @PUT
     @Path("/{vcsid}/items/{csid}" + WorkflowClient.SERVICE_PATH + "/{transition}")
-    ClientResponse<String> updateItemWorkflowWithTransition(
+    Response updateItemWorkflowWithTransition(
                @PathParam("vcsid") String vcsid,
                @PathParam("csid") String csid,
                @PathParam("transition") String transition);
index 6fa4eebd9e0e760ce96cc271dcb2e6a46026093e..e3d48c2f0620c61cfcf75b4e40cdfa94c7dc0124 100644 (file)
@@ -56,7 +56,7 @@ public interface CollectionSpaceProxy<CLT> {
     @GET
     @Produces({"application/xml"})
     @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
+    Response getAuthorityRefs(@PathParam("csid") String csid); //ClientResponse<AuthorityRefList>
     
     @GET
     @Produces({"application/xml"})
index 7bd15d44c8957150b8a25b90b841b8a79b172ac4..a47dca1dc8f46014885f5440251bb8bca8aec146 100644 (file)
@@ -228,8 +228,9 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         setupRead();
 
         // Submit the request to the service and store the response.
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
-        ClientResponse<String> res = client.readByName(getKnowResourceIdentifier());
+        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
+                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        Response res = client.readByName(getKnowResourceIdentifier());
         try {
                int statusCode = res.getStatus();
        
@@ -362,7 +363,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
 
         // Submit the request to the service and store the response.
         AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (shortId != null) {
@@ -370,29 +371,33 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         } else {
             Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
         }
-        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);
-
-        AbstractCommonList list = res.getEntity();
-        List<AbstractCommonList.ListItem> items = list.getListItem();
-        int nItemsReturned = items.size();
-        long nItemsTotal = list.getTotalItems();
-        if (logger.isDebugEnabled()) {
-            logger.debug("  " + testName + ": Expected "
-                    + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
-        }
-        Assert.assertEquals(nItemsTotal, nItemsToCreateInList);
-
-        if(logger.isTraceEnabled()){
-               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+        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);
+       
+               AbstractCommonList list = res.readEntity(AbstractCommonList.class);
+               List<AbstractCommonList.ListItem> items = list.getListItem();
+               int nItemsReturned = items.size();
+               long nItemsTotal = list.getTotalItems();
+               if (logger.isDebugEnabled()) {
+                   logger.debug("  " + testName + ": Expected "
+                           + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
+               }
+               Assert.assertEquals(nItemsTotal, nItemsToCreateInList);
+       
+               if(logger.isTraceEnabled()){
+                       AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+               }
+        } finally {
+               res.close();
         }
     }
     
@@ -531,8 +536,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
                        (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
        PoxPayloadOut multipart = createNonExistenceItemInstance(client.getItemCommonPartName(), NON_EXISTENT_ID);
-       ClientResponse<String> res =
-                       client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
+       Response res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
        try {
                int statusCode = res.getStatus();
        
@@ -545,7 +549,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
                                invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
        } finally {
-               res.releaseConnection();
+               res.close();
        }
     }
         
index de2e72d0ab97ddacbf7e31eb94f6d57da6c58cc8..f1f6931643ea128399f2089d5f682afe00080bd4 100644 (file)
@@ -1016,13 +1016,13 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
         // Ask for a list of all resources filtered by the incoming 'includeDeleted' workflow param
         //
         AuthorityClient client = (AuthorityClient) this.getClientInstance();
-        ClientResponse<AbstractCommonList> res = client.readItemList(parentCsid,
+        Response res = client.readItemList(parentCsid,
                 null, /* partial terms */
                 null, /* keywords */
                 includeDeleted);
         try {
                assertStatusCode(res, testName);
-               AbstractCommonList list = res.getEntity();
+               AbstractCommonList list = res.readEntity(AbstractCommonList.class);
                result = list.getTotalItems();
         } finally {
                if (res != null) {
@@ -1146,7 +1146,7 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
                 // Next, test that a GET with WorkflowClient.WORKFLOWSTATE_DELETED query param set to 'false' returns a 404
                 //
                 AuthorityClient client = (AuthorityClient) this.getClientInstance();
-                ClientResponse<String> res = client.readItem(parentCsid, csid, Boolean.FALSE);
+                Response res = client.readItem(parentCsid, csid, Boolean.FALSE);
                 try {
                        int result = res.getStatus();
                        Assert.assertEquals(result, STATUS_NOT_FOUND);
@@ -1167,18 +1167,18 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
         // Read the existing object
         //
         AuthorityClient client = (AuthorityClient) this.getClientInstance();
-        ClientResponse<String> res = client.readItemWorkflow(parentCsid, itemCsid);
+        Response res = client.readItemWorkflow(parentCsid, itemCsid);
         WorkflowCommon workflowCommons = null;
         try {
                assertStatusCode(res, testName);
                logger.debug("Got object to update life cycle state with ID: " + itemCsid);
-               PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                workflowCommons = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class);
                Assert.assertNotNull(workflowCommons);
                logger.debug("Current workflow state:" + objectAsXmlString(workflowCommons, WorkflowCommon.class));
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         //
@@ -1199,7 +1199,7 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
                Assert.assertNotNull(updatedWorkflowCommons);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
@@ -1214,7 +1214,7 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
                        assertStatusCode(res, testName);
                        logger.debug(
                                "Got workflow state of updated object with ID: " + itemCsid);
-                       PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+                       PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                        updatedWorkflowCommons = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class);
                        Assert.assertNotNull(workflowCommons);
                        String currentState = updatedWorkflowCommons.getCurrentLifeCycleState();
@@ -1226,7 +1226,7 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
                                        currentState);
                } finally {
                        if (res != null) {
-                    res.releaseConnection();
+                    res.close();
                 }
                }
                trials++;
index a4e8a655defddd975b9e450e26c3d1ec49ad8956..6cfecef6fc483a39dd2c153cb266f5a0b0b28a4c 100644 (file)
@@ -435,7 +435,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         CollectionobjectsCommon collectionObject = null;
         try {
                assertStatusCode(res, testName);
-               PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
                collectionObject = (CollectionobjectsCommon) extractPart(input,
                                collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
                Assert.assertNotNull(collectionObject);
@@ -451,7 +451,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         AuthorityRefList list = null;
         try {
                assertStatusCode(res, testName);        
-               list = (AuthorityRefList)res.getEntity();
+               list = (AuthorityRefList)res.readEntity(AuthorityRefList.class);
         } finally {
                if (res != null) {
                        res.close();
index ad5361596a547bcd2b94376108684c39b9ab2103..78265f95b71b2eb16ece4f71d1bad90f86665233 100644 (file)
@@ -24,6 +24,9 @@ package org.collectionspace.services.client.test;
 
 import java.util.List;
 import java.util.Map;
+
+import javax.ws.rs.core.Response;
+
 import org.collectionspace.services.ConceptJAXBSchema;
 import org.collectionspace.services.client.AbstractCommonListUtils;
 import org.collectionspace.services.client.AuthorityClient;
@@ -172,7 +175,7 @@ public class ConceptAuthorityServiceTest extends AbstractAuthorityServiceTest<Co
         
         // Submit the request to the service and store the response.
         ConceptAuthorityClient client = new ConceptAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if(vcsid!= null) {
                res = client.readItemList(vcsid, null, null);
         } else if(shortId!= null) {
@@ -183,9 +186,9 @@ public class ConceptAuthorityServiceTest extends AbstractAuthorityServiceTest<Co
                AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AbstractCommonList.class);
            } finally {
-               res.releaseConnection();
+               res.close();
            }
         List<AbstractCommonList.ListItem> items =
             list.getListItem();
index c927d5dba3f01b9c0b2a43b682ccc46e62ce5486..55b87c584c675e599c90733a79b894980f0242f5 100644 (file)
@@ -20,7 +20,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart the multipart
      * @return the client response
      */
-    public ClientResponse<Response> createContact(String parentcsid,
+    public Response createContact(String parentcsid,
             String itemcsid, PoxPayloadOut xmlPayload);
     
     /**
@@ -31,7 +31,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart
      * @return the client response
      */
-    public ClientResponse<Response> createContactForNamedItem(
+    public Response createContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                PoxPayloadOut xmlPayload);
@@ -44,7 +44,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart
      * @return the client response
      */
-    public ClientResponse<Response> createContactForItemInNamedAuthority(
+    public Response createContactForItemInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                PoxPayloadOut xmlPayload);
@@ -57,7 +57,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart
      * @return the client response
      */
-    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+    public Response createContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                PoxPayloadOut xmlPayload);
@@ -70,7 +70,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<String> readContact(String parentcsid,
+    public Response readContact(String parentcsid,
             String itemcsid, String csid);
     
     /**
@@ -81,7 +81,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid
      * @return the client response
      */
-    public ClientResponse<String> readContactForNamedItem(
+    public Response readContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid);
@@ -94,7 +94,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid
      * @return the client response
      */
-    public ClientResponse<String> readContactInNamedAuthority(
+    public Response readContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid);
@@ -107,7 +107,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid
      * @return the client response
      */
-    public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+    public Response readContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid);
@@ -120,7 +120,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param itemcsid the itemcsid
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+    public Response readContactList(String parentcsid,
             String itemcsid);
     
     /**
@@ -130,7 +130,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param itemspecifier (shortIdentifier)
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+    public Response readContactListForNamedItem(
                String parentcsid,
                String itemspecifier);
 
@@ -141,7 +141,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param itemcsid
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+    public Response readContactListForItemInNamedAuthority(
                String parentspecifier,
                String itemcsid);
 
@@ -152,7 +152,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param itemspecifier (shortIdentifier)
      * @return the client response
      */
-    public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+    public Response readContactListForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier);
 
@@ -165,7 +165,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart the multipart
      * @return the client response
      */
-    public ClientResponse<String> updateContact(String parentcsid,
+    public Response updateContact(String parentcsid,
             String itemcsid, String csid, PoxPayloadOut xmlPayload);
     
     /**
@@ -177,7 +177,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart the multipart
      * @return the client response
      */
-    public ClientResponse<String> updateContactForNamedItem(
+    public Response updateContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid,
@@ -192,7 +192,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart the multipart
      * @return the client response
      */
-    public ClientResponse<String> updateContactInNamedAuthority(
+    public Response updateContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid,
@@ -207,7 +207,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param multipart the multipart
      * @return the client response
      */
-    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+    public Response updateContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid,
@@ -221,7 +221,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<Response> deleteContact(String parentcsid,
+    public Response deleteContact(String parentcsid,
         String itemcsid, String csid);
     
     /**
@@ -232,7 +232,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<Response> deleteContactForNamedItem(
+    public Response deleteContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid);
@@ -245,7 +245,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<Response> deleteContactInNamedAuthority(
+    public Response deleteContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid);
@@ -258,7 +258,7 @@ public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends Auth
      * @param csid the csid
      * @return the client response
      */
-    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+    public Response deleteContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid);
index c90004b997e48bb1c52402dcebbbb11446546828..46b01c68a53cbaba1a3da7fe169912bff1e72a1e 100644 (file)
@@ -15,7 +15,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
        implements AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P> {
        
        @Override
-    public ClientResponse<Response> createContact(String parentcsid,
+    public Response createContact(String parentcsid,
             String itemcsid, PoxPayloadOut xmlPayload) {
         return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());
     }
@@ -29,7 +29,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> createContactForNamedItem(
+       public Response createContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                PoxPayloadOut xmlPayload) {
@@ -44,7 +44,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> createContactForItemInNamedAuthority(
+       public Response createContactForItemInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                PoxPayloadOut xmlPayload) {
@@ -60,7 +60,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+       public Response createContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                PoxPayloadOut xmlPayload) {
@@ -77,7 +77,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readContact(String parentcsid,
+       public Response readContact(String parentcsid,
             String itemcsid, String csid) {
         return getProxy().readContact(parentcsid, itemcsid, csid);
     }
@@ -91,7 +91,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readContactForNamedItem(
+       public Response readContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid){
@@ -107,7 +107,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readContactInNamedAuthority(
+       public Response readContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid){
@@ -123,7 +123,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> readContactForNamedItemInNamedAuthority(
+       public Response readContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid){
@@ -139,7 +139,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<AbstractCommonList> readContactList(String parentcsid,
+       public Response readContactList(String parentcsid,
             String itemcsid) {
         return getProxy().readContactList(parentcsid, itemcsid);
     }
@@ -152,7 +152,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<AbstractCommonList> readContactListForNamedItem(
+       public Response readContactListForNamedItem(
                String parentcsid,
                String itemspecifier){
        return getProxy().readContactList(parentcsid, itemspecifier);
@@ -166,7 +166,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+       public Response readContactListForItemInNamedAuthority(
                String parentspecifier,
                String itemcsid){
        return getProxy().readContactList(parentspecifier, itemcsid);
@@ -180,7 +180,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+       public Response readContactListForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier){
        return getProxy().readContactList(parentspecifier, itemspecifier);
@@ -196,7 +196,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> updateContact(String parentcsid,
+       public Response updateContact(String parentcsid,
             String itemcsid, String csid, PoxPayloadOut xmlPayload) {
         return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
     }
@@ -211,7 +211,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> updateContactForNamedItem(
+       public Response updateContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid,
@@ -229,7 +229,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> updateContactInNamedAuthority(
+       public Response updateContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid,
@@ -247,7 +247,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+       public Response updateContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid,
@@ -265,7 +265,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> deleteContact(String parentcsid,
+       public Response deleteContact(String parentcsid,
         String itemcsid, String csid) {
         return getProxy().deleteContact(parentcsid,
             itemcsid, csid);
@@ -280,7 +280,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> deleteContactForNamedItem(
+       public Response deleteContactForNamedItem(
                String parentcsid,
                String itemspecifier,
                String csid) {
@@ -297,7 +297,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> deleteContactInNamedAuthority(
+       public Response deleteContactInNamedAuthority(
                String parentspecifier,
                String itemcsid,
                String csid) {
@@ -314,7 +314,7 @@ public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P ext
      * @return the client response
      */
     @Override
-       public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+       public Response deleteContactForNamedItemInNamedAuthority(
                String parentspecifier,
                String itemspecifier,
                String csid) {
index 98e8eec0508661eb5bb16fc9def2b00eead946cd..89db736db4d139868c250dbe76f7543f24941abe 100644 (file)
@@ -20,52 +20,52 @@ public interface AuthorityWithContactsProxy extends AuthorityProxy {
     @GET
     @Produces({"application/xml"})
     @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    public ClientResponse<AbstractCommonList> readContactList(
+    public Response readContactList(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid);
 
     @GET
     @Produces({"application/xml"})
     @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<AbstractCommonList> readContactListForNamedItem(
+    Response readContactListForNamedItem(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemspecifier") String itemspecifier);
     
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<AbstractCommonList> readContactListForItemInNamedAuthority(
+    Response readContactListForItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemcsid") String itemcsid);
     @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<AbstractCommonList> readContactListForNamedItemInNamedAuthority(
+    Response readContactListForNamedItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemspecifier") String itemspecifier);
 
     //(C)reate Contact
     @POST
     @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContact(
+    Response createContact(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid,
             byte[] xmlPayload);
     @POST
     @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItem(
+    Response createContactForNamedItem(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemspecifier") String itemspecifier,
             byte[] xmlPayload);
     @POST
     @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContactForItemInNamedAuthority(
+    Response createContactForItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemcsid") String itemcsid,
             byte[] xmlPayload);
     @POST
     @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItemInNamedAuthority(
+    Response createContactForNamedItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemspecifier") String itemspecifier,
             byte[] xmlPayload);
@@ -73,25 +73,25 @@ public interface AuthorityWithContactsProxy extends AuthorityProxy {
      //(R)ead Contact
     @GET
     @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContact(
+    Response readContact(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid);
     @GET
     @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItem(
+    Response readContactForNamedItem(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid);
     @GET
     @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContactInNamedAuthority(
+    Response readContactInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid);
     @GET
     @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItemInNamedAuthority(
+    Response readContactForNamedItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid);
@@ -99,28 +99,28 @@ public interface AuthorityWithContactsProxy extends AuthorityProxy {
     //(U)pdate Contact
     @PUT
     @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContact(
+    Response updateContact(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid,
             byte[] xmlPayload);
     @PUT
     @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItem(
+    Response updateContactForNamedItem(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid,
             byte[] xmlPayload);
     @PUT
     @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContactInNamedAuthority(
+    Response updateContactInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid,
             byte[] xmlPayload);
     @PUT
     @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItemInNamedAuthority(
+    Response updateContactForNamedItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid,
@@ -129,27 +129,27 @@ public interface AuthorityWithContactsProxy extends AuthorityProxy {
     //(D)elete Contact
     @DELETE
     @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContact(
+    Response deleteContact(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid);
     
     @DELETE
     @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItem(
+    Response deleteContactForNamedItem(
             @PathParam("parentcsid") String parentcsid,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid);
     @DELETE
     @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContactInNamedAuthority(
+    Response deleteContactInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemcsid") String itemcsid,
             @PathParam("csid") String csid);
     
     @DELETE
     @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
+    Response deleteContactForNamedItemInNamedAuthority(
             @PathParam("parentspecifier") String parentspecifier,
             @PathParam("itemspecifier") String itemspecifier,
             @PathParam("csid") String csid);
index f041f85a0641db41b8e626776b998fcab7745d7d..270db3e91562288464559f86d4e6d2f51b31fb39 100644 (file)
@@ -265,12 +265,11 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         // Get the auth ref docs and check them
 
         PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
-        ClientResponse<AuthorityRefDocList> res =
-                personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID);
+        Response res = personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID);
         AuthorityRefDocList list = null;
         try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AuthorityRefDocList.class);
         } finally {
                if (res != null) {
                 res.close();
@@ -309,10 +308,10 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         res = personAuthClient.getReferencingObjects(personAuthCSID, depositorPersonCSID);
         try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AuthorityRefDocList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
@@ -357,15 +356,14 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
 
         // Single scalar field
         PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
-        ClientResponse<AuthorityRefDocList> res =
-                personAuthClient.getReferencingObjects(personAuthCSID, insurerPersonCSID);
+        Response res = personAuthClient.getReferencingObjects(personAuthCSID, insurerPersonCSID);
         AuthorityRefDocList list = null;
         try {
                assertStatusCode(res, testName);
-               list = res.getEntity();
+               list = res.readEntity(AuthorityRefDocList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
         
index 896f9bcda721a166f425819b2700fbecf0482e50..f45f064a1e572f6036d3c75f1ad98852b7db68c3 100644 (file)
@@ -243,7 +243,7 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
 
                // Submit the request to the service and store the response.
                LocationAuthorityClient client = new LocationAuthorityClient();
-               ClientResponse<AbstractCommonList> res = null;
+               Response res = null;
                if (vcsid != null) {
                        res = client.readItemList(vcsid, null, null);
                } else if (shortId != null) {
@@ -255,7 +255,7 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
                AbstractCommonList list = null;
                try {
                        assertStatusCode(res, testName);
-                       list = res.getEntity();
+                       list = res.readEntity(AbstractCommonList.class);
                } finally {
                        if (res != null) {
                 res.close();
index 8c755b6784698848ae20928ee403ba4081ce9b65..53c37e3cd442d47697b8a70d3d2a897476907936 100644 (file)
@@ -57,18 +57,19 @@ public class OrgAuthorityClientUtils {
      * @return
      */
     public static String getAuthorityRefName(String csid, OrgAuthorityClient client){
-       if(client==null)
+       if (client==null) {
                client = new OrgAuthorityClient();
+       }
+       
         Response res = client.read(csid);
         try {
                int statusCode = res.getStatus();
-               if(!READ_REQ.isValidStatusCode(statusCode)
-                       ||(statusCode != CollectionSpaceClientUtils.STATUS_OK)) {
+               if (!READ_REQ.isValidStatusCode(statusCode) || statusCode != CollectionSpaceClientUtils.STATUS_OK) {
                        throw new RuntimeException("Invalid status code returned: "+statusCode);
                }
                //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) CollectionSpaceClientUtils.extractPart(input,
                            client.getCommonPartName(), OrgauthoritiesCommon.class);
@@ -102,7 +103,7 @@ public class OrgAuthorityClientUtils {
                }
                //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));
                    OrganizationsCommon org = 
                        (OrganizationsCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getItemCommonPartName(), OrganizationsCommon.class);
index f4c6431ec63a57fc8756def959ecfbe841a38ac5..db57d8aa7dbb9315dcaa3b57f4bba9b0550d8520 100644 (file)
@@ -325,12 +325,11 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         // Get the auth refs and check them
         // FIXME - need to create this method in the client
         // and get the ID for the organization item
-        ClientResponse<AuthorityRefList> res2 =
-           orgAuthClient.getItemAuthorityRefs(knownResourceId, knownItemResourceId);
+        Response res2 = orgAuthClient.getItemAuthorityRefs(knownResourceId, knownItemResourceId);
         AuthorityRefList list = null;
         try {
                assertStatusCode(res2, testName);
-               list = res2.getEntity();
+               list = res2.readEntity(AuthorityRefList.class);
         } finally {
                if (res2 != null) {
                        res2.close();
index cdda42991e19f59e1cb70db0417337dd4e31b926..b516ac4a8e646685e6c07a12f6e72c439557fac6 100644 (file)
@@ -228,14 +228,13 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
                 itemcsid, identifier, new ContactClient().getCommonPartName());
 
         String newID = null;
-        ClientResponse<Response> res =
-                client.createContact(parentcsid, itemcsid, multipart);
+        Response res = client.createContact(parentcsid, itemcsid, multipart);
         try {
             assertStatusCode(res, testName);
             newID = OrgAuthorityClientUtils.extractId(res);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -516,13 +515,12 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<String> res =
-                client.readContact(knownResourceId, knownItemResourceId,
+        Response res =client.readContact(knownResourceId, knownItemResourceId,
                 knownContactResourceId);
         try {
             assertStatusCode(res, testName);           
             // Check whether we've received a contact.
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             ContactsCommon contact = (ContactsCommon) extractPart(input,
                     new ContactClient().getCommonPartName(), ContactsCommon.class);
             Assert.assertNotNull(contact);
@@ -553,8 +551,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<String> res =
-                client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+        Response res = client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
             int statusCode = res.getStatus();
 
@@ -606,7 +603,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (name != null) {
@@ -618,7 +615,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);           
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
                 res.close();
@@ -672,12 +669,11 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<AbstractCommonList> res =
-                client.readContactList(parentcsid, itemcsid);
+        Response res = client.readContactList(parentcsid, itemcsid);
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
                 res.close();
@@ -721,8 +717,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Retrieve the contents of a resource to update.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<String> res =
-                client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+        Response res = client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
         ContactsCommon contact = null;
         try {
             assertStatusCode(res, testName);           
@@ -732,7 +727,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
                         + " in item: " + knownItemResourceId
                         + " in parent: " + knownResourceId);
             }
-            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             contact = (ContactsCommon) extractPart(input,
                     new ContactClient().getCommonPartName(), ContactsCommon.class);
             Assert.assertNotNull(contact);
@@ -769,7 +764,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         try {
                assertStatusCode(res, testName);
                // Retrieve the updated resource and verify that its contents exist.
-               PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+               PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                ContactsCommon updatedContact =
                        (ContactsCommon) extractPart(input,
                        new ContactClient().getCommonPartName(), ContactsCommon.class);
@@ -824,8 +819,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<Response> res =
-                client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+        Response res = client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
         try {
             assertStatusCode(res, testName);
         } finally {
@@ -870,8 +864,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
         // Submit the request to the service and store the response.
         OrgAuthorityClient client = new OrgAuthorityClient();
-        ClientResponse<Response> res =
-                client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+        Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
             assertStatusCode(res, testName);
         } finally {
index da32fafc7ceec5e3f6268023b875e90da40a1b2c..cb4fb29898a9d0446d5e4d2ff5c967885f04fe54 100644 (file)
@@ -77,7 +77,7 @@ public class PersonAuthorityClientUtils {
                }
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
-                   PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                   PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
                    PersonauthoritiesCommon personAuthority = 
                        (PersonauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getCommonPartName(), PersonauthoritiesCommon.class);
@@ -111,7 +111,7 @@ public class PersonAuthorityClientUtils {
                }
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
-                   PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
+                   PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
                    PersonsCommon person = 
                        (PersonsCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getItemCommonPartName(), PersonsCommon.class);
index e5a5f0c429308186031b5beb0649878b037d92e3..1bf6b0581f40d4e0a3f874df37d7e5c4acb6e8a0 100644 (file)
@@ -461,7 +461,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (authorityCsid != null) {
                res = client.readItemList(authorityCsid, partialTerm, keywords);
         } else {
@@ -470,10 +470,10 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
index e4e6663566d977373116c9bfeb60b9c0a28eb1ee..d6f80434730e8113ac37e93cf08e2bd445f45c42 100644 (file)
@@ -303,7 +303,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (authorityCsid != null) {
                res = client.readItemList(authorityCsid, partialTerm, keywords);
         } else {
@@ -312,10 +312,10 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
index 7ca29cfe11bea5ed6cca8ad3f5f2843867f8a221..b47f320656f45184fe89d1fe9a55dee341b154e2 100644 (file)
@@ -349,15 +349,14 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
                 itemcsid, identifier, new ContactClient().getCommonPartName());
 
         setupCreate();
-        ClientResponse<Response> res =
-                client.createContact(parentcsid, itemcsid, multipart);
+        Response res = client.createContact(parentcsid, itemcsid, multipart);
         String newID = null;
         try {
                assertStatusCode(res, testName);
             newID = PersonAuthorityClientUtils.extractId(res);
         } finally {
                if (res != null) {
-                       res.releaseConnection();
+                       res.close();
                }
         }
 
@@ -713,16 +712,15 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
         PoxPayloadIn input = null;
-        ClientResponse<String> res =
-                client.readContact(knownResourceId, knownItemResourceId,
+        Response res = client.readContact(knownResourceId, knownItemResourceId,
                 knownContactResourceId);
         try {
             assertStatusCode(res, testName);
             // Check whether we've received a contact.
-            input = new PoxPayloadIn(res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -752,13 +750,13 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
-        ClientResponse<String> res =
-                client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+        Response res = client.readContact(knownResourceId, knownItemResourceId,
+                       NON_EXISTENT_ID);
         try {
             assertStatusCode(res, testName);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
     }
@@ -797,7 +795,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupReadList();
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (name != null) {
@@ -808,10 +806,10 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -868,14 +866,13 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
         AbstractCommonList list = null;
-        ClientResponse<AbstractCommonList> res =
-                client.readContactList(parentcsid, itemcsid);
+        Response res = client.readContactList(parentcsid, itemcsid);
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
-                res.releaseConnection();
+                res.close();
             }
         }
 
@@ -1074,7 +1071,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         PersonAuthorityClient client = new PersonAuthorityClient();
         PoxPayloadIn input = null;
         setupRead();
-        ClientResponse<String> res = client.readContact(knownResourceId, knownItemResourceId,
+        Response res = client.readContact(knownResourceId, knownItemResourceId,
                        knownContactResourceId);
         try {
             assertStatusCode(res, testName);
@@ -1084,7 +1081,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
                         + " in item: " + knownItemResourceId
                         + " in parent: " + knownResourceId);
             }
-            input = new PoxPayloadIn(res.getEntity());
+            input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                if (res != null) {
                 res.close();
@@ -1121,7 +1118,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         try {
             assertStatusCode(res, testName);
             // Retrieve the updated resource and verify that its contents exist.
-            input = new PoxPayloadIn(res.getEntity());;
+            input = new PoxPayloadIn(res.readEntity(String.class));;
         } finally {
                if (res != null) {
                 res.close();
@@ -1173,8 +1170,8 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
         setupDelete();
-        ClientResponse<Response> res =
-                client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
+        Response res = client.deleteContact(knownResourceId, knownItemResourceId, 
+                       knownContactResourceId);
         try {
                assertStatusCode(res, testName);
         } finally {
@@ -1217,8 +1214,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         // Submit the request to the service and store the response.
         PersonAuthorityClient client = new PersonAuthorityClient();
         setupDeleteNonExistent();
-        ClientResponse<Response> res =
-                client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
+        Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
                assertStatusCode(res, testName);
         } finally {
@@ -1289,8 +1285,8 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
             itemResourceId = entry.getValue();
             // Note: Any non-success responses from the delete operation
             // below are ignored and not reported.
-            ClientResponse<Response> res =
-                    client.deleteContact(parentResourceId, itemResourceId, contactResourceId);
+            Response res = client.deleteContact(parentResourceId, itemResourceId,
+                       contactResourceId);
             res.close();
         }
         // Clean up item resources.
index f5ee57955bfba0e835c5ad5710cda75a58d2ae91..0f922e3b95c6428c385fd258921d7c3f08536c69 100644 (file)
@@ -248,7 +248,7 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
 
                // Submit the request to the service and store the response.
                PlaceAuthorityClient client = new PlaceAuthorityClient();
-               ClientResponse<AbstractCommonList> res = null;
+               Response res = null;
                if (vcsid != null) {
                        res = client.readItemList(vcsid, null, null);
                } else if (shortId != null) {
@@ -260,7 +260,7 @@ public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<Plac
                AbstractCommonList list = null;
                try {
                        assertStatusCode(res, testName);
-                       list = res.getEntity();
+                       list = res.readEntity(AbstractCommonList.class);
                } finally {
                        if (res != null) {
                 res.close();
index 6b25f32601c966c9b1aa9b6e91031ea410db27ec..49fc0d455f2fa13a9990fcc6e2343f7cadd82b5a 100644 (file)
@@ -266,7 +266,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
 
         // Submit the request to the service and store the response.
         TaxonomyAuthorityClient client = new TaxonomyAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (shortId != null) {
@@ -276,7 +276,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         }
         try {
             assertStatusCode(res, testName);
-            AbstractCommonList list = res.getEntity();
+            AbstractCommonList list = res.readEntity(AbstractCommonList.class);
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
index 096fc7265c34b462694531f32ce5b93ae7875219..3a4cd9851e81f640d06a9c46dcf483fd940ff558 100644 (file)
@@ -254,7 +254,7 @@ public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest<Worka
 
         // Submit the request to the service and store the response.
         WorkAuthorityClient client = new WorkAuthorityClient();
-        ClientResponse<AbstractCommonList> res = null;
+        Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (shortId != null) {
@@ -266,7 +266,7 @@ public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest<Worka
         AbstractCommonList list = null;
         try {
             assertStatusCode(res, testName);
-            list = res.getEntity();
+            list = res.readEntity(AbstractCommonList.class);
         } finally {
             if (res != null) {
                 res.close();