]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-1349, 1422, 1428, 1429, 1469, 1465, 1466, 1468, 1470, 1473:
authorRichard Millet <richard.millet@berkeley.edu>
Sun, 2 May 2010 04:25:09 +0000 (04:25 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Sun, 2 May 2010 04:25:09 +0000 (04:25 +0000)
1. Adding pagination tests to all Nuxeo based services.
2. Updated POM settings to make some dependency declarations more consistent.

109 files changed:
services/IntegrationTests/pom.xml
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/PerformanceTests/pom.xml
services/account/client/.settings/org.eclipse.jdt.core.prefs
services/account/client/pom.xml
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/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/account/service/pom.xml
services/acquisition/client/pom.xml
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionProxy.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/acquisition/service/pom.xml
services/authentication/client/pom.xml
services/authorization-mgt/client/pom.xml
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/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/RoleServiceTest.java
services/authorization-mgt/service/pom.xml
services/client/pom.xml
services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/IClientQueryParams.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/TestServiceClient.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java
services/client/src/main/java/org/collectionspace/services/client/test/BaseServiceTest.java
services/collectionobject/client/.classpath
services/collectionobject/client/pom.xml
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/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java
services/collectionobject/service/pom.xml
services/common/pom.xml
services/common/src/main/java/org/collectionspace/services/common/document/DocumentFilter.java
services/contact/client/pom.xml
services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/ContactProxy.java
services/contact/client/src/test/java/org/collectionspace/services/client/test/ContactServiceTest.java
services/contact/service/pom.xml
services/dimension/client/pom.xml
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/pom.xml
services/id/client/pom.xml
services/id/service/pom.xml
services/id/service/src/test/java/org/collectionspace/services/id/part/test/GregorianDateIDPartTest.java
services/id/service/src/test/java/org/collectionspace/services/id/part/test/NumericIDPartRegexValidatorTest.java
services/intake/client/pom.xml
services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.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/PersonAuthRefDocsTest.java
services/intake/service/pom.xml
services/loanin/client/pom.xml
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninProxy.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/loanin/service/pom.xml
services/loanout/client/pom.xml
services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java
services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutProxy.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/loanout/service/pom.xml
services/organization/client/pom.xml
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityProxy.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/organization/import/pom.xml
services/organization/service/pom.xml
services/person/client/pom.xml
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/person/import/pom.xml
services/person/service/pom.xml
services/pom.xml
services/query/service/pom.xml
services/relation/client/pom.xml
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/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/relation/service/pom.xml
services/security/client/pom.xml
services/security/client/src/test/java/org/collectionspace/services/authentication/client/test/AuthenticationServiceTest.java
services/vocabulary/client/pom.xml
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyProxy.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/vocabulary/import/pom.xml
services/vocabulary/service/pom.xml

index 3ef491151ffb2400f6a47d05739c0e6253d0ac4a..0f70071dd3e17361ae589c3d85128ae296fdf698 100644 (file)
@@ -73,7 +73,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 74ff2a90ebf849abbf3d6481af50648a80e9ddc9..941fd06d09aa9c388ee91d35f4615db977faf8c2 100644 (file)
             <artifactId>commons-io</artifactId>\r
             <version>1.4</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>jaxrs-api</artifactId>\r
+        </dependency>        \r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>junit</groupId>\r
index 3bf763ec3cc71f912d5a60c2de8df09a458d2f3b..562ed9250752a877ea27ad23e71a888243a57b05 100644 (file)
@@ -60,7 +60,7 @@ public class CollectionSpaceJaxRsApplication extends Application {
     private Set<Class<?>> empty = new HashSet<Class<?>>();
 
     public CollectionSpaceJaxRsApplication() {
-        singletons.add(new SecurityInterceptor());
+//        singletons.add(new SecurityInterceptor());
         singletons.add(new AccountResource());
         singletons.add(new RoleResource());
         singletons.add(new PermissionResource());
index 12a80903d9ab102a2035d5a3dd036871e1b3a61c..bad8ee02659305fd057dbdaa10cd4377d64ed6cf 100644 (file)
@@ -68,7 +68,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 31e049bf27313ff64908fb672653541e1fea5573..2316c13b54ac4cba041ffa51534e095a7a0fa418 100644 (file)
@@ -1,5 +1,6 @@
-#Wed Dec 02 09:42:10 PST 2009\r
+#Fri Apr 30 14:56:50 PDT 2010\r
 eclipse.preferences.version=1\r
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
 org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning\r
 org.eclipse.jdt.core.compiler.source=1.6\r
index 3ab03a0d371d7b41751978f954b7d3d71d45e0ae..4d1772f7d9b74c610126068e2d68b125280cc80b 100644 (file)
@@ -64,7 +64,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 552d8b956aea13ddae6185c1b620a00cbe853073..129c89d943af56213e08253b8b4f182057926a82 100644 (file)
@@ -66,6 +66,11 @@ public class AccountClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.accountProxy;
+    }
+    
     /**
      * allow to reset proxy as per security needs
      */
index ce724ff2cb082b9e275306426c6c64f6aa249316..2b53494cd6f64386935f8b10bb5233e644e69fc5 100644 (file)
@@ -50,7 +50,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/accounts/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface AccountProxy {
+public interface AccountProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index 7a9abaded52f8e7c21d550c177872b615761175f..7bb2bcc3b78836321606a092c453fdc6146b59ef 100644 (file)
@@ -65,6 +65,11 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.accountRoleProxy;
+    }
+    
     /**
      * allow to reset proxy as per security needs
      */
index 2b6b3e0f5e29cb210c792126e5f1a11e27874473..d64d9f1a74f3148987a78ac7971ee515b6e79882 100644 (file)
@@ -45,7 +45,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/accounts")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface AccountRoleProxy {
+public interface AccountRoleProxy extends CollectionSpaceProxy {
 
     //(C)reate
     @POST
index 6a6b87860553d8935826382d77ca669e15ebdbfc..0a893e67597297d2c4ae435e26e45d8a651b6f19 100644 (file)
@@ -36,10 +36,12 @@ import org.collectionspace.services.authorization.RoleValue;
 import org.collectionspace.services.client.AccountClient;
 import org.collectionspace.services.client.AccountFactory;
 import org.collectionspace.services.client.AccountRoleClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
 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.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 
@@ -64,7 +66,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
             LoggerFactory.getLogger(AccountRoleServiceTest.class);
     // Instance variables specific to this test.
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
     private Hashtable<String, AccountValue> accValues = new Hashtable<String, AccountValue>();
     private Hashtable<String, RoleValue> roleValues = new Hashtable<String, RoleValue>();
     /*
@@ -117,6 +119,30 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
         roleValues.put(rv2.getRoleName(), rv2);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new AccountRoleClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       throw new UnsupportedOperationException();
+    }
+    
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       }    
+    
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
@@ -159,6 +185,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"create"})
     public void createList(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // Failure outcomes
@@ -166,14 +193,17 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // ---------------------------------------------------------------
@@ -217,7 +247,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
 
         // Submit the request to the service and store the response.
         AccountRoleClient client = new AccountRoleClient();
-        ClientResponse<AccountRole> res = client.read(NON_EXISTENT_ID, "123");
+        ClientResponse<AccountRole> res = client.read(this.NON_EXISTENT_ID, "123");
         int statusCode = res.getStatus();
 
         // Check the status code of the response: does it match
@@ -238,6 +268,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"createList", "read"})
     public void readList(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // Failure outcomes
@@ -250,6 +281,7 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read", "readList", "readNonExistent"})
     public void update(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // Failure outcomes
@@ -257,20 +289,24 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"readNonExistent", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // ---------------------------------------------------------------
@@ -302,6 +338,9 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void deleteNonExistent(String testName) throws Exception {
@@ -341,12 +380,13 @@ public class AccountRoleServiceTest extends AbstractServiceTestImpl {
     // Utility methods used by tests above
     // ---------------------------------------------------------------
     /**
-     * create accRolerole instance
-     * @param accId
-     * @param roleValues array of role ids
-     * @param userPermId
-     * @param useRoleId
-     * @return
+     * Creates the account role instance.
+     *
+     * @param pv the pv
+     * @param rvs the rvs
+     * @param usePermId the use perm id
+     * @param useRoleId the use role id
+     * @return the account role
      */
     static public AccountRole createAccountRoleInstance(AccountValue pv,
             Collection<RoleValue> rvs,
index 25e7ad0ae217d06ee9373235a0f79bbac757fff0..e05d608b6fb2f32384c2b33ff12c3dac1d97e968 100644 (file)
@@ -27,12 +27,14 @@ import java.util.List;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.client.AccountClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.account.AccountsCommonList;
 import org.collectionspace.services.account.Status;
 import org.collectionspace.services.client.AccountFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
 import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
@@ -57,15 +59,42 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     private String knownResourceId = null;
     private List<String> allResourceIdsCreated = new ArrayList();
     static boolean addTenant = true;
+
     /*
      * This method is called only by the parent class, AbstractServiceTestImpl
      */
-
     @Override
     protected String getServicePathComponent() {
         return new AccountClient().getServicePathComponent();
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new AccountClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       throw new UnsupportedOperationException();
+    }
+    
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readPaginatedList(java.lang.String)
+        */
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       }    
+     
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
@@ -310,14 +339,17 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // ---------------------------------------------------------------
@@ -773,14 +805,17 @@ public class AccountServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
index e20edc616bd9c04f64cab9c4d3bc0ce9851c4dea..9672d49fab60587e69544e09d906b4e8f6228615 100644 (file)
@@ -26,7 +26,9 @@
             <artifactId>slf4j-log4j12</artifactId>\r
             <scope>provided</scope>\r
         </dependency>\r
+        \r
         <!-- CollectionSpace Dependencies -->\r
+        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.common</artifactId>\r
@@ -47,7 +49,9 @@
             <artifactId>org.collectionspace.services.account.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        \r
         <!-- External dependencies -->\r
+        \r
         <dependency>\r
             <groupId>junit</groupId>\r
             <artifactId>junit</artifactId>\r
@@ -71,8 +75,8 @@
             <artifactId>commons-logging</artifactId>\r
             <version>1.1</version>\r
         </dependency>\r
-        <!-- javax -->\r
 \r
+        <!-- javax -->\r
 \r
         <dependency>\r
             <groupId>javax.security</groupId>\r
             <scope>provided</scope>\r
         </dependency>\r
 \r
-\r
         <!-- jboss -->\r
 \r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
-\r
-\r
     </dependencies>\r
 \r
     <build>\r
index 57cd847089a04e1c0403d27f6a634adf1302b263..ed6bdb354896f32aa37bf9388f6623677e5ee588 100644 (file)
@@ -56,7 +56,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 5052a18db5a586134305f63c16cbf105a67d51ec..358804ef71b73a9edf2ce0473d39061aaba905f8 100644 (file)
@@ -46,6 +46,11 @@ public class AcquisitionClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.acquisitionProxy;
+    }
+
     /**
      * allow to reset proxy as per security needs
      */
index 233ccad27fce67c83eb9fbd55bec3df990f8f6ca..2a105603d5d26da84b5d0f9893dfccd6074b168a 100644 (file)
@@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/acquisitions/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface AcquisitionProxy {
+public interface AcquisitionProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index 49e0592b0a3d43d77d7998e581f2e24c8e3d90b6..d58348b69c5ee2e368c8d1ff2a6bdafa00ba7153 100644 (file)
@@ -32,9 +32,11 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.AcquisitionClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.acquisition.AcquisitionsCommon;
 import org.collectionspace.services.acquisition.AcquisitionsCommonList;
 
@@ -78,6 +80,23 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest {
     private String fieldCollectorRefName = null;
     private final int NUM_AUTH_REFS_EXPECTED = 3;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 6f817176b040fdc7e8ba9119dc057c355fe6d799..c15786e08f0e7a31acb9b30f4dc4414c8b9fc3dc 100644 (file)
@@ -28,6 +28,8 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.client.AcquisitionClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.collectionspace.services.acquisition.AcquisitionsCommon;
 import org.collectionspace.services.acquisition.AcquisitionsCommonList;
@@ -60,6 +62,23 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
     private String knownResourceId = null;
     private List<String> allResourceIdsCreated = new ArrayList();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new AcquisitionClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(AcquisitionsCommonList.class);
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 6f495d0259d642860f7d2af1514ba25211718eb2..d59eb21689b5e7e6ecaf6ae358eb814e257d10f2 100644 (file)
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.acquisition.jaxb</artifactId>\r
             <version>${project.version}</version>\r
-        </dependency>        \r
-<!--       <dependency>\r
-            <groupId>junit</groupId>\r
-            <artifactId>junit</artifactId>\r
-            <version>4.1</version>\r
-            <scope>test</scope>\r
         </dependency>\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <version>5.6</version>\r
-        </dependency>        \r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>        \r
-        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
-        </dependency>        \r
-        \r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.version.1.5}</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <artifactId>jboss-remoting</artifactId>\r
-                    <groupId>jboss</groupId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.restlet</groupId>\r
-            <artifactId>org.restlet</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.noelios.restlet</groupId>\r
-            <artifactId>com.noelios.restlet.ext.httpclient</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>com.noelios.restlet</groupId>\r
-            <artifactId>com.noelios.restlet</artifactId>\r
-            <version>1.0.7</version>\r
-        </dependency> -->\r
     </dependencies>\r
     \r
     <build>\r
index b5749e5f29851f08d211cc5e2982eb959cf90c0f..2b7adaeefd20c79b048ebf6da790ca47ab9655c4 100644 (file)
             <artifactId>org.collectionspace.services.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
-        <!--\r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <version>5.6</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>commons-httpclient</groupId>\r
-            <artifactId>commons-httpclient</artifactId>\r
-            <version>3.1</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency> -->\r
     </dependencies>\r
 \r
     <build>\r
index d7c21734460d14dce053107c5960c7bface15582..e0554bef54698dfc5377927c26c5579a90f7db62 100644 (file)
@@ -57,7 +57,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index bea5c333b3459ef88444bc11646e8dbc878a8f79..88b01e92ba1b79530483833b2be6b450cb1d37b1 100644 (file)
@@ -66,6 +66,11 @@ public class PermissionClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.permissionProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index f096f824b43888161dbbb1fc636b1463a6864a69..68655d3190ab6c4b321c57bcf7d566537a37b03f 100644 (file)
@@ -48,7 +48,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/authorization/permissions")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface PermissionProxy {
+public interface PermissionProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index d196054877e236c76da4f2c73d52a64cdbd391d7..1406a7ee50e4a5ee5d9a2e0b2ff5dce6ab48e14d 100644 (file)
@@ -65,6 +65,11 @@ public class PermissionRoleClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.permissionRoleProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index 9f9ee1d7451290b3a0a80f2bdfd00faea11f6457..45d389c9bfa2535c19584ea91f2ef52084670aa6 100644 (file)
@@ -45,7 +45,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/authorization/permissions")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface PermissionRoleProxy {
+public interface PermissionRoleProxy extends CollectionSpaceProxy {
 
     //(C)reate
     @POST
index 6ba71c339e1447719b8a6aafc8fd65c0a43a7063..5514859d79ebb6a47ecc8c9657f352d7d1d7595a 100644 (file)
@@ -66,6 +66,11 @@ public class RoleClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.roleProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index a65aab021aa4100f3688256728a79143814a60c6..b87bd448e39adec92fa92cc18a2fa874fc6f1950 100644 (file)
@@ -48,7 +48,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/authorization/roles")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface RoleProxy {
+public interface RoleProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index 3fae6b3cd0bca2e46b79853c3df2d6f45fd632a7..d916765f865e0a8fde1f7e4458164abe93139af1 100644 (file)
@@ -35,6 +35,7 @@ import org.collectionspace.services.authorization.PermissionRole;
 import org.collectionspace.services.authorization.PermissionValue;
 import org.collectionspace.services.authorization.Role;
 import org.collectionspace.services.authorization.RoleValue;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PermissionClient;
 import org.collectionspace.services.client.PermissionFactory;
 import org.collectionspace.services.client.PermissionRoleClient;
@@ -42,6 +43,7 @@ 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.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
@@ -115,6 +117,29 @@ public class PermissionRoleServiceTest extends AbstractServiceTestImpl {
         roleValues.put(rv2.getRoleName(), rv2);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new PermissionRoleClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       throw new UnsupportedOperationException();
+    }
+    
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       }    
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index bd4de6a24771e673e32e22ae2f024656fb3a1b21..bf0c00ae66f73f592c5fdf56f9a8a85cbf95fc7f 100644 (file)
@@ -25,9 +25,10 @@ package org.collectionspace.services.authorization.client.test;
 import java.util.ArrayList;
 import java.util.List;
 import javax.ws.rs.core.Response;
-import org.collectionspace.services.authorization.ActionType;
+//import org.collectionspace.services.authorization.ActionType;
 import org.collectionspace.services.authorization.EffectType;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PermissionClient;
 import org.collectionspace.services.authorization.Permission;
 import org.collectionspace.services.authorization.PermissionAction;
@@ -35,6 +36,7 @@ import org.collectionspace.services.authorization.PermissionsList;
 import org.collectionspace.services.client.PermissionFactory;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
 import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
@@ -57,7 +59,7 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
             LoggerFactory.getLogger(PermissionServiceTest.class);
     // Instance variables specific to this test.
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
     boolean addTenant = true;
     /*
      * This method is called only by the parent class, AbstractServiceTestImpl
@@ -68,7 +70,31 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
         return new PermissionClient().getServicePathComponent();
     }
 
-    // ---------------------------------------------------------------
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new PermissionClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       throw new UnsupportedOperationException();
+    }
+    
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       }    
+
+       // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
@@ -200,14 +226,17 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // ---------------------------------------------------------------
@@ -428,14 +457,17 @@ public class PermissionServiceTest extends AbstractServiceTestImpl {
 
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
index f3874785a6bbd0508cc9a820122c5d93de47064a..292c541c5dfc0ff28a92a10c5e378f0acc850c25 100644 (file)
@@ -26,12 +26,14 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.RoleClient;
 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.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 import org.testng.Assert;
@@ -54,7 +56,7 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
             LoggerFactory.getLogger(RoleServiceTest.class);
     // Instance variables specific to this test.
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
     boolean addTenant = true;
     /*
      * This method is called only by the parent class, AbstractServiceTestImpl
@@ -65,6 +67,30 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
         return new RoleClient().getServicePathComponent();
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new RoleClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       throw new UnsupportedOperationException();
+    }
+    
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+                       //FIXME: http://issues.collectionspace.org/browse/CSPACE-1697
+       }    
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
@@ -199,14 +225,17 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     // ---------------------------------------------------------------
@@ -380,14 +409,17 @@ public class RoleServiceTest extends AbstractServiceTestImpl {
     // See Issue CSPACE-401.
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     @Override
index f33ad5da751e8bba853c1818f6ab637d08f1ed85..6f72ad1b4652e464228e5f54241d66526c840183 100644 (file)
@@ -81,7 +81,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
 \r
         <!-- spring -->\r
index 5e9181e5c6b70676fdc84007521c695b409cf4a9..5635bb6e000ffab20865f342f53b7e38e99d0cbf 100644 (file)
             <version>${project.version}</version>\r
             <optional>true</optional>\r
         </dependency> -->\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        \r
 <!-- External dependencies -->        \r
         <dependency>\r
             <groupId>org.apache.maven.plugins</groupId>\r
@@ -43,7 +49,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <!-- Set TestNG scope to default (compile), rather than test -->\r
         <!-- to allow import(s) in AbstractServiceTest class -->\r
index 4425081cdf33676c2e848f9a3435e97dff412aaf..7755b48aad8830651d5e3bccf6795bf3811bf8c4 100644 (file)
@@ -29,59 +29,102 @@ import java.util.Properties;
 import org.apache.commons.httpclient.HttpClient;\r
 import org.apache.commons.httpclient.UsernamePasswordCredentials;\r
 import org.apache.commons.httpclient.auth.AuthScope;\r
+//import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
 //import org.collectionspace.services.common.context.ServiceContext;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
 /**\r
  * BaseServiceClient is an abstract base client of all service clients\r
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684\r
  */\r
 public abstract class AbstractServiceClientImpl implements CollectionSpaceClient {\r
 \r
+    /** The logger. */\r
     protected final Logger logger = LoggerFactory.getLogger(AbstractServiceClientImpl.class);\r
     \r
     /**\r
      * The character used to separate the words in a part label\r
      */\r
     public static final String PART_LABEL_SEPERATOR = "_";\r
+    \r
+    /** The Constant PART_COMMON_LABEL. */\r
     public static final String PART_COMMON_LABEL = "common";\r
     \r
+    /** The properties. */\r
     private Properties properties = new Properties();\r
+    \r
+    /** The url. */\r
     private URL url;\r
+    \r
+    /** The http client. */\r
     private HttpClient httpClient;\r
 \r
+       /**\r
+        * Gets the common part name.\r
+        *\r
+        * @return the common part name\r
+        */\r
        public String getCommonPartName() {\r
                return getCommonPartName(getServicePathComponent());\r
        }\r
 \r
+       /**\r
+        * Gets the common part name.\r
+        *\r
+        * @param servicePathComponent the service path component\r
+        * @return the common part name\r
+        */\r
        public String getCommonPartName(String servicePathComponent) {\r
                return servicePathComponent\r
                + PART_LABEL_SEPERATOR\r
                + PART_COMMON_LABEL;\r
        }\r
 \r
+       /**\r
+        * Gets the service path component.\r
+        *\r
+        * @return the service path component\r
+        */\r
        abstract public String getServicePathComponent();\r
     \r
+    /**\r
+     * Instantiates a new abstract service client impl.\r
+     */\r
     protected AbstractServiceClientImpl() {\r
         readProperties();\r
         setupHttpClient();\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#getProperty(java.lang.String)\r
+     */\r
     @Override\r
     public String getProperty(String propName) {\r
         return properties.getProperty(propName);\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#setProperty(java.lang.String, java.lang.String)\r
+     */\r
     @Override\r
     public void setProperty(String propName, String value) {\r
         properties.setProperty(propName, value);\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#removeProperty(java.lang.String)\r
+     */\r
     @Override\r
     public Object removeProperty(String propName) {\r
         return properties.remove(propName);\r
     }\r
 \r
+    /**\r
+     * Prints the properties.\r
+     */\r
     public void printProperties() {\r
         for(Object kobj : properties.keySet()){\r
             String key = (String) kobj;\r
@@ -89,22 +132,34 @@ public abstract class AbstractServiceClientImpl implements CollectionSpaceClient
         }\r
     }\r
     \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#getBaseURL()\r
+     */\r
     @Override\r
     public String getBaseURL() {\r
         return properties.getProperty(URL_PROPERTY);\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#getHttpClient()\r
+     */\r
     @Override\r
     public HttpClient getHttpClient() {\r
         return httpClient;\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#useAuth()\r
+     */\r
     @Override\r
     public boolean useAuth() {\r
         String auth = properties.getProperty(AUTH_PROPERTY);\r
         return Boolean.valueOf(auth);\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#useSSL()\r
+     */\r
     @Override\r
     public boolean useSSL() {\r
         String ssl = properties.getProperty(SSL_PROPERTY);\r
@@ -204,8 +259,21 @@ public abstract class AbstractServiceClientImpl implements CollectionSpaceClient
         }\r
     }\r
 \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#isServerSecure()\r
+     */\r
     @Override\r
     public boolean isServerSecure() {\r
         return Boolean.getBoolean("cspace.server.secure");\r
     }\r
+    \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.CollectionSpaceClient#readList(java.lang.String, java.lang.String)\r
+     */\r
+    @Override\r
+    public ClientResponse<AbstractCommonList> readList(String pageSize,\r
+               String pageNumber) {\r
+       return getProxy().readList(pageSize, pageNumber);\r
+    }\r
+    \r
 }\r
index 6d08d1fb8fa0a8eabb04318cad1cda0a4950c20d..59c19888fd401e9f6f9537b20f7c0af236984453 100644 (file)
  */
 package org.collectionspace.services.client;
 import org.apache.commons.httpclient.HttpClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.jboss.resteasy.client.ClientResponse;
 
 /**
  *
  */
 public interface CollectionSpaceClient {
+    
+    /** The AUT h_ property. */
     String AUTH_PROPERTY = "cspace.auth";
+    
+    /** The PASSWOR d_ property. */
     String PASSWORD_PROPERTY = "cspace.password";
+    
+    /** The SS l_ property. */
     String SSL_PROPERTY = "cspace.ssl";
+    
+    /** The UR l_ property. */
     String URL_PROPERTY = "cspace.url";
+    
+    /** The USE r_ property. */
     String USER_PROPERTY = "cspace.user";
 
+    /**
+     * Gets the proxy.
+     *
+     * @return the proxy
+     */
+    CollectionSpaceProxy getProxy();
+    
+    /**
+     * Gets the base url.
+     *
+     * @return the base url
+     */
     String getBaseURL();
 
+    /**
+     * Gets the http client.
+     *
+     * @return the http client
+     */
     HttpClient getHttpClient();
 
+    /**
+     * Gets the property.
+     *
+     * @param propName the prop name
+     * @return the property
+     */
     String getProperty(String propName);
 
+    /**
+     * Removes the property.
+     *
+     * @param propName the prop name
+     * @return the object
+     */
     Object removeProperty(String propName);
 
+    /**
+     * Sets the property.
+     *
+     * @param propName the prop name
+     * @param value the value
+     */
     void setProperty(String propName, String value);
 
     /**
@@ -55,8 +102,18 @@ public interface CollectionSpaceClient {
      */
     void setupHttpClient();
 
+    /**
+     * Use auth.
+     *
+     * @return true, if successful
+     */
     boolean useAuth();
 
+    /**
+     * Use ssl.
+     *
+     * @return true, if successful
+     */
     boolean useSSL();
 
     /**
@@ -64,5 +121,15 @@ public interface CollectionSpaceClient {
      * @return
      */
     boolean isServerSecure();
+    
+    /**
+     * Read list.
+     *
+     * @param pageSize the page size
+     * @param pageNumber the page number
+     * @return the client response
+     */
+    public ClientResponse<AbstractCommonList> readList(String pageSize,
+               String pageNumber);    
 
 }
diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java
new file mode 100644 (file)
index 0000000..90807a7
--- /dev/null
@@ -0,0 +1,54 @@
+/**    \r
+ * CollectionSpaceProxy.java\r
+ *\r
+ * {Purpose of This Class}\r
+ *\r
+ * {Other Notes Relating to This Class (Optional)}\r
+ *\r
+ * $LastChangedBy: $\r
+ * $LastChangedRevision: $\r
+ * $LastChangedDate: $\r
+ *\r
+ * This document is a part of the source code and related artifacts\r
+ * for CollectionSpace, an open source collections management system\r
+ * for museums and related institutions:\r
+ *\r
+ * http://www.collectionspace.org\r
+ * http://wiki.collectionspace.org\r
+ *\r
+ * Copyright Â© 2009 {Contributing Institution}\r
+ *\r
+ * Licensed under the Educational Community License (ECL), Version 2.0.\r
+ * You may not use this file except in compliance with this License.\r
+ *\r
+ * You may obtain a copy of the ECL 2.0 License at\r
+ * https://source.collectionspace.org/collection-space/LICENSE.txt\r
+ */\r
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.QueryParam;\r
+\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+/**\r
+ * The Interface CollectionSpaceProxy.\r
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684\r
+ */\r
+public interface CollectionSpaceProxy {\r
+       \r
+    /**\r
+     * Read list.\r
+     *\r
+     * @param pageSize the page size\r
+     * @param pageNumber the page number\r
+     * @return the client response\r
+     */\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    ClientResponse<AbstractCommonList> readList(\r
+               @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) String pageSize,\r
+               @QueryParam(IClientQueryParams.START_PAGE_PARAM) String pageNumber);\r
+}\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/IClientQueryParams.java b/services/client/src/main/java/org/collectionspace/services/client/IClientQueryParams.java
new file mode 100644 (file)
index 0000000..1aeec0a
--- /dev/null
@@ -0,0 +1,7 @@
+package org.collectionspace.services.client;\r
+\r
+public interface IClientQueryParams {\r
+    public static final String PAGE_SIZE_PARAM = "pgSz";\r
+    public static final String START_PAGE_PARAM = "pgNum";\r
+\r
+}\r
index a9741fbe180d1f595331860970ce4c38ec47d206..379a354975b73711ad57a97846e07752af341eff 100644 (file)
@@ -29,21 +29,19 @@ package org.collectionspace.services.client;
  * @version $Revision:$
  */
 public class TestServiceClient extends AbstractServiceClientImpl {
-    /**
-     *
-     * Default constructor for CollectionObjectClient class.
-     *
-     */
-    public TestServiceClient() {
-    }
-    
     /**
     *
     * Returning NULL since this class is a base-level client, used (only) 
     * to obtain the base service URL.
     *
-    */    
+    */
+       @Override
        public String getServicePathComponent() {
-               return null;
+               throw new UnsupportedOperationException();
+       }
+
+       @Override
+       public CollectionSpaceProxy getProxy() {
+               throw new UnsupportedOperationException();
        }  
 }
index 827db26e69f4f7404068b2b224b64139064de14e..d6da10add7796aca454c8c7473daea5e7a0e9f33 100644 (file)
  */
 package org.collectionspace.services.client.test;
 
+import java.util.List;
+
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.AbstractServiceClientImpl;
+import org.jboss.resteasy.client.ClientResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-
-
-
-
+import org.testng.Assert;
+import org.testng.annotations.Test;
 
 /**
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
  * AbstractServiceTest, abstract base class for the client tests to be performed
  * to test an entity or relation service.
  *
@@ -41,34 +45,73 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class AbstractServiceTestImpl extends BaseServiceTest implements ServiceTest {
 
+       /** The logger. */
        protected final Logger logger = LoggerFactory.getLogger(AbstractServiceTestImpl.class);
-
-    // Success outcomes
-    @Override
-    public void create(String testName) throws Exception {
+       
+       /** The Constant DEFAULT_LIST_SIZE. */
+       static protected final int DEFAULT_LIST_SIZE = 10;
+
+//    // Success outcomes
+//    /* (non-Javadoc)
+//     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+//     */
+//    @Override
+//    public void create(String testName) throws Exception {
+//     //empty?
+//    }
+    
+    /**
+     * Gets the logger.
+     *
+     * @return the logger
+     */
+    private Logger getLogger() {
+       return this.logger;
     }
 
+    /**
+     * Setup create.
+     */
     protected void setupCreate() {
         setupCreate("Create");
     }
 
+    /**
+     * Sets the up create.
+     *
+     * @param label the new up create
+     */
     protected void setupCreate(String label) {
        testSetup(Response.Status.CREATED.getStatusCode(), ServiceRequestType.CREATE, label);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#createList(java.lang.String)
+     */
     @Override
     public abstract void createList(String testName) throws Exception;
 
     // No setup required for createList()
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#createWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public abstract void createWithEmptyEntityBody(String testName)
             throws Exception;
 
+    /**
+     * Setup create with empty entity body.
+     */
     protected void setupCreateWithEmptyEntityBody() {
         setupCreateWithEmptyEntityBody("CreateWithEmptyEntityBody");
     }
 
+    /**
+     * Sets the up create with empty entity body.
+     *
+     * @param label the new up create with empty entity body
+     */
     protected void setupCreateWithEmptyEntityBody(String label) {
         clearSetup();
         EXPECTED_STATUS_CODE = Response.Status.BAD_REQUEST.getStatusCode();
@@ -78,13 +121,24 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#createWithMalformedXml(java.lang.String)
+     */
     @Override
     public abstract void createWithMalformedXml(String testName) throws Exception;
 
+    /**
+     * Setup create with malformed xml.
+     */
     protected void setupCreateWithMalformedXml() {
         setupCreateWithMalformedXml("CreateWithMalformedXml");
     }
 
+    /**
+     * Sets the up create with malformed xml.
+     *
+     * @param label the new up create with malformed xml
+     */
     protected void setupCreateWithMalformedXml(String label) {
         clearSetup();
         // Expected status code: 400 Bad Request
@@ -95,13 +149,24 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#createWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public abstract void createWithWrongXmlSchema(String testName) throws Exception;
 
+    /**
+     * Setup create with wrong xml schema.
+     */
     protected void setupCreateWithWrongXmlSchema() {
         setupCreateWithWrongXmlSchema("CreateWithWrongXmlSchema");
     }
 
+    /**
+     * Sets the up create with wrong xml schema.
+     *
+     * @param label the new up create with wrong xml schema
+     */
     protected void setupCreateWithWrongXmlSchema(String label) {
         clearSetup();
         // Expected status code: 400 Bad Request
@@ -116,41 +181,141 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#read(java.lang.String)
+     */
     @Override
     public abstract void read(String testName) throws Exception;
 
+    /**
+     * Setup read.
+     */
     protected void setupRead() {
         setupRead("Read");
     }
 
+    /**
+     * Sets the up read.
+     *
+     * @param label the new up read
+     */
     protected void setupRead(String label) {
        testSetup(Response.Status.OK.getStatusCode(), ServiceRequestType.READ, label);
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#readNonExistent(java.lang.String)
+     */
     @Override
     public abstract void readNonExistent(String testName) throws Exception;
 
+    /**
+     * Setup read non existent.
+     */
     protected void setupReadNonExistent() {
         setupReadNonExistent("ReadNonExistent");
     }
 
+    /**
+     * Sets the up read non existent.
+     *
+     * @param label the new up read non existent
+     */
     protected void setupReadNonExistent(String label) {
         // Expected status code: 404 Not Found
        testSetup(Response.Status.NOT_FOUND.getStatusCode(), ServiceRequestType.READ, label);
     }
 
-    // ---------------------------------------------------------------
+       /**
+        * Read list.
+        *
+        * @param testName the test name
+        * @param client the client
+        * @param pageSize the page size
+        * @param pageNumber the page number
+        * @return the abstract common list
+        * @throws Exception the exception
+        */
+       private AbstractCommonList readList(String testName,
+                       CollectionSpaceClient client,
+                       long pageSize, long pageNumber) throws Exception {
+               ClientResponse<AbstractCommonList> response =
+                       (ClientResponse<AbstractCommonList>)client.readList(Long.toString(pageSize),
+                                       Long.toString(pageNumber));
+               AbstractCommonList list = this.getAbstractCommonList(response);
+               int statusCode = response.getStatus();
+
+               // Check the status code of the response: does it match
+               // the expected response(s)?
+               if (getLogger().isDebugEnabled()) {
+                       getLogger().debug(testName + ": status = " + statusCode);
+               }
+               Assert.assertTrue(this.REQUEST_TYPE.isValidStatusCode(statusCode),
+                               invalidStatusCodeMessage(this.REQUEST_TYPE, statusCode));
+               Assert.assertEquals(statusCode, this.EXPECTED_STATUS_CODE);
+               
+               return list;
+       }
+
+       /**
+        * Read paginated list.
+        *
+        * @param testName the test name
+        * @throws Exception the exception
+        */
+       @Test(dataProvider = "testName")
+    public void readPaginatedList(String testName) throws Exception {
+
+        // Perform setup.
+        setupReadList(testName);
+        
+        long pageSize = DEFAULT_LIST_SIZE / 3; //create 3 pages to iterate over
+        CollectionSpaceClient client = this.getClientInstance();
+        AbstractCommonList list = this.readList(testName, client, pageSize, 0);
+        long totalItems = list.getTotalItems();        
+        long pagesTotal = totalItems / pageSize;
+        for (int i = 0; i < pagesTotal; i++) {
+               list = this.readList(testName, client, pageSize, i);
+               if (getLogger().isDebugEnabled() == true) {
+                       getLogger().debug(testName + ":" + "page number is " + list.getPageNum());
+                       getLogger().debug(testName + ":" + "page size is " + list.getPageSize());
+                       getLogger().debug(testName + ":" + "total number of items is " + list.getTotalItems());
+               }
+        }
+        
+        long mod = totalItems % pageSize;
+        if (mod != 0) {
+               list = this.readList(testName, client, pageSize, pagesTotal);
+               getLogger().debug(testName + ":" + "page number is " + list.getPageNum());
+               getLogger().debug(testName + ":" + "page size is " + list.getPageSize());
+               getLogger().debug(testName + ":" + "total number of items is " + list.getTotalItems());
+        }
+        
+    }
+
+       // ---------------------------------------------------------------
     // CRUD tests : READ (list, or multiple) tests
     // ---------------------------------------------------------------
     // Success outcomes
-    @Override
+    /* (non-Javadoc)
+        * @see org.collectionspace.services.client.test.ServiceTest#readList(java.lang.String)
+        */
+       @Override
     public abstract void readList(String testName) throws Exception;
 
+    /**
+     * Setup read list.
+     */
     protected void setupReadList() {
         setupReadList("ReadList");
     }
 
+    /**
+     * Sets the up read list.
+     *
+     * @param label the new up read list
+     */
     protected void setupReadList(String label) {
        testSetup(Response.Status.OK.getStatusCode(), ServiceRequestType.READ_LIST, label);
     }
@@ -161,62 +326,117 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
     // CRUD tests : UPDATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#update(java.lang.String)
+     */
     @Override
     public abstract void update(String testName) throws Exception;
 
+    /**
+     * Setup update.
+     */
     protected void setupUpdate() {
         setupUpdate("Update");
     }
 
+    /**
+     * Sets the up update.
+     *
+     * @param label the new up update
+     */
     protected void setupUpdate(String label) {
         // Expected status code: 200 OK
        testSetup(Response.Status.OK.getStatusCode(), ServiceRequestType.UPDATE, label);
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#updateWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public abstract void updateWithEmptyEntityBody(String testName) throws Exception;
 
+    /**
+     * Setup update with empty entity body.
+     */
     protected void setupUpdateWithEmptyEntityBody() {
         setupUpdateWithEmptyEntityBody("UpdateWithEmptyEntityBody");
     }
 
+    /**
+     * Sets the up update with empty entity body.
+     *
+     * @param label the new up update with empty entity body
+     */
     protected void setupUpdateWithEmptyEntityBody(String label) {
         // Expected status code: 400 Bad Request
        testSetup(Response.Status.BAD_REQUEST.getStatusCode(), ServiceRequestType.UPDATE, label);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#updateWithMalformedXml(java.lang.String)
+     */
     @Override
     public abstract void updateWithMalformedXml(String testName) throws Exception;
 
+    /**
+     * Setup update with malformed xml.
+     */
     protected void setupUpdateWithMalformedXml() {
         setupUpdateWithMalformedXml("UpdateWithMalformedXml");
     }
 
+    /**
+     * Sets the up update with malformed xml.
+     *
+     * @param label the new up update with malformed xml
+     */
     protected void setupUpdateWithMalformedXml(String label) {
         // Expected status code: 400 Bad Request
        testSetup(Response.Status.BAD_REQUEST.getStatusCode(), ServiceRequestType.UPDATE, label);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#updateWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public abstract void updateWithWrongXmlSchema(String testName) throws Exception;
 
+    /**
+     * Setup update with wrong xml schema.
+     */
     protected void setupUpdateWithWrongXmlSchema() {
         setupUpdateWithWrongXmlSchema("UpdateWithWrongXmlSchema");
     }
 
+    /**
+     * Sets the up update with wrong xml schema.
+     *
+     * @param label the new up update with wrong xml schema
+     */
     protected void setupUpdateWithWrongXmlSchema(String label) {
         // Expected status code: 400 Bad Request
        testSetup(Response.Status.BAD_REQUEST.getStatusCode(), ServiceRequestType.UPDATE, label);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#updateNonExistent(java.lang.String)
+     */
     @Override
     public abstract void updateNonExistent(String testName) throws Exception;
 
+    /**
+     * Setup update non existent.
+     */
     protected void setupUpdateNonExistent() {
         setupUpdateNonExistent("UpdateNonExistent");
     }
 
+    /**
+     * Sets the up update non existent.
+     *
+     * @param label the new up update non existent
+     */
     protected void setupUpdateNonExistent(String label) {
         // Expected status code: 404 Not Found
        testSetup(Response.Status.NOT_FOUND.getStatusCode(), ServiceRequestType.UPDATE, label);
@@ -226,25 +446,47 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
     // CRUD tests : DELETE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#delete(java.lang.String)
+     */
     @Override
     public abstract void delete(String testName) throws Exception;
 
+    /**
+     * Setup delete.
+     */
     protected void setupDelete() {
         setupDelete("Delete");
     }
 
+    /**
+     * Sets the up delete.
+     *
+     * @param label the new up delete
+     */
     protected void setupDelete(String label) {
        testSetup(Response.Status.OK.getStatusCode(), ServiceRequestType.DELETE, label);
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#deleteNonExistent(java.lang.String)
+     */
     @Override
     public abstract void deleteNonExistent(String testName) throws Exception;
 
+    /**
+     * Setup delete non existent.
+     */
     protected void setupDeleteNonExistent() {
         setupDeleteNonExistent("DeleteNonExistent");
     }
 
+    /**
+     * Sets the up delete non existent.
+     *
+     * @param label the new up delete non existent
+     */
     protected void setupDeleteNonExistent(String label) {
         clearSetup();
         // Expected status code: 404 Not Found
index a85550c4045b90596ad5eb8170eaf451f47b8486..bf87cd4a60dd8e064089da21dfc55258d744525d 100644 (file)
@@ -1,3 +1,29 @@
+/**    \r
+ * BaseServiceTest.java\r
+ *\r
+ * {Purpose of This Class}\r
+ *\r
+ * {Other Notes Relating to This Class (Optional)}\r
+ *\r
+ * $LastChangedBy: $\r
+ * $LastChangedRevision: $\r
+ * $LastChangedDate: $\r
+ *\r
+ * This document is a part of the source code and related artifacts\r
+ * for CollectionSpace, an open source collections management system\r
+ * for museums and related institutions:\r
+ *\r
+ * http://www.collectionspace.org\r
+ * http://wiki.collectionspace.org\r
+ *\r
+ * Copyright Â© 2009 {Contributing Institution}\r
+ *\r
+ * Licensed under the Educational Community License (ECL), Version 2.0.\r
+ * You may not use this file except in compliance with this License.\r
+ *\r
+ * You may obtain a copy of the ECL 2.0 License at\r
+ * https://source.collectionspace.org/collection-space/LICENSE.txt\r
+ */\r
 package org.collectionspace.services.client.test;\r
 \r
 import java.io.ByteArrayInputStream;\r
@@ -31,20 +57,60 @@ import org.slf4j.LoggerFactory;
 import org.testng.annotations.DataProvider;\r
 import org.w3c.dom.Document;\r
 \r
+import org.collectionspace.services.client.CollectionSpaceClient;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+/**\r
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685\r
+ * The Class BaseServiceTest.\r
+ */\r
 public abstract class BaseServiceTest {\r
 \r
+    /** The Constant logger. */\r
     static protected final Logger logger = LoggerFactory.getLogger(BaseServiceTest.class);\r
+    \r
+    /** The Constant serviceClient. */\r
     protected static final TestServiceClient serviceClient = new TestServiceClient();\r
+    \r
+    /** The NO n_ existen t_ id. */\r
     protected final String NON_EXISTENT_ID = createNonExistentIdentifier();\r
+    \r
+    /** The EXPECTE d_ statu s_ code. */\r
     protected int EXPECTED_STATUS_CODE = 0;\r
+    \r
+    /** The REQUES t_ type. */\r
     protected ServiceRequestType REQUEST_TYPE = ServiceRequestType.NON_EXISTENT;\r
+    \r
+    /** The Constant XML_DECLARATION. */\r
     protected static final String XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";\r
+    \r
+    /** The Constant MALFORMED_XML_DATA. */\r
     protected static final String MALFORMED_XML_DATA = XML_DECLARATION\r
             + "<malformed_xml>wrong schema contents</malformed_xml";\r
+    \r
+    /** The WRON g_ xm l_ schem a_ data. */\r
     protected final String WRONG_XML_SCHEMA_DATA = XML_DECLARATION\r
             + "<wrong_schema>wrong schema contents</wrong_schema>";\r
+    \r
+    /** The NUL l_ charset. */\r
     final String NULL_CHARSET = null;\r
 \r
+    /**\r
+     * Gets the client.\r
+     *\r
+     * @return the client\r
+     */\r
+    abstract protected CollectionSpaceClient getClientInstance();\r
+    \r
+       /**\r
+        * Gets the abstract common list.\r
+        *\r
+        * @param response the response\r
+        * @return the abstract common list\r
+        */\r
+       abstract protected AbstractCommonList getAbstractCommonList(\r
+                       ClientResponse<AbstractCommonList> response);    \r
+    \r
     /**\r
      * Returns the name of the currently running test.\r
      *\r
@@ -97,6 +163,9 @@ public abstract class BaseServiceTest {
         }\r
     }\r
 \r
+    /**\r
+     * Instantiates a new base service test.\r
+     */\r
     public BaseServiceTest() {\r
         super();\r
     }\r
@@ -218,6 +287,12 @@ public abstract class BaseServiceTest {
         return statusCode;\r
     }\r
 \r
+    /**\r
+     * Extract id.\r
+     *\r
+     * @param res the res\r
+     * @return the string\r
+     */\r
     static protected String extractId(ClientResponse<Response> res) {\r
         MultivaluedMap mvm = res.getMetadata();\r
         String uri = (String) ((ArrayList) mvm.get("Location")).get(0);\r
@@ -232,15 +307,34 @@ public abstract class BaseServiceTest {
         return id;\r
     }\r
 \r
+    /**\r
+     * Creates the identifier.\r
+     *\r
+     * @return the string\r
+     */\r
     static protected String createIdentifier() {\r
         long identifier = System.currentTimeMillis();\r
         return Long.toString(identifier);\r
     }\r
 \r
+    /**\r
+     * Creates the non existent identifier.\r
+     *\r
+     * @return the string\r
+     */\r
     protected String createNonExistentIdentifier() {\r
         return Long.toString(Long.MAX_VALUE);\r
     }\r
 \r
+    /**\r
+     * Extract part.\r
+     *\r
+     * @param input the input\r
+     * @param label the label\r
+     * @param clazz the clazz\r
+     * @return the object\r
+     * @throws Exception the exception\r
+     */\r
     static protected Object extractPart(MultipartInput input, String label, Class clazz)\r
             throws Exception {\r
         Object obj = null;\r
@@ -292,6 +386,14 @@ public abstract class BaseServiceTest {
         return obj;\r
     }\r
 \r
+    /**\r
+     * Gets the part object.\r
+     *\r
+     * @param partStr the part str\r
+     * @param clazz the clazz\r
+     * @return the part object\r
+     * @throws JAXBException the jAXB exception\r
+     */\r
     static protected Object getPartObject(String partStr, Class clazz)\r
             throws JAXBException {\r
         JAXBContext jc = JAXBContext.newInstance(clazz);\r
@@ -312,6 +414,13 @@ public abstract class BaseServiceTest {
         return obj;\r
     }\r
 \r
+    /**\r
+     * Object as xml string.\r
+     *\r
+     * @param o the o\r
+     * @param clazz the clazz\r
+     * @return the string\r
+     */\r
     static protected String objectAsXmlString(Object o, Class clazz) {\r
         StringWriter sw = new StringWriter();\r
         try {\r
@@ -345,6 +454,13 @@ public abstract class BaseServiceTest {
         return getObjectFromStream(jaxbClass, is);\r
     }\r
 \r
+    /**\r
+     * Gets the xml document.\r
+     *\r
+     * @param fileName the file name\r
+     * @return the xml document\r
+     * @throws Exception the exception\r
+     */\r
     static protected Document getXmlDocument(String fileName) throws Exception {\r
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
         File f = new File(fileName);\r
@@ -355,6 +471,13 @@ public abstract class BaseServiceTest {
         return factory.newDocumentBuilder().parse(f);\r
     }\r
 \r
+    /**\r
+     * Gets the xml document as string.\r
+     *\r
+     * @param fileName the file name\r
+     * @return the xml document as string\r
+     * @throws Exception the exception\r
+     */\r
     static protected String getXmlDocumentAsString(String fileName) throws Exception {\r
         byte[] b = FileUtils.readFileToByteArray(new File(fileName));\r
         return new String(b);\r
@@ -375,6 +498,12 @@ public abstract class BaseServiceTest {
         return jaxbClass.cast(unmarshaller.unmarshal(is));\r
     }\r
 \r
+    /**\r
+     * Map as string.\r
+     *\r
+     * @param map the map\r
+     * @return the string\r
+     */\r
     protected String mapAsString(MultivaluedMap map) {\r
         StringBuffer sb = new StringBuffer();\r
         for (Object entry : map.entrySet()) {\r
@@ -385,6 +514,11 @@ public abstract class BaseServiceTest {
         return sb.toString();\r
     }\r
 \r
+    /**\r
+     * Banner.\r
+     *\r
+     * @param label the label\r
+     */\r
     protected void banner(String label) {\r
         if (logger.isDebugEnabled()) {\r
             logger.debug("===================================================");\r
index 505c7192a516c57aff1e56ee8f44ccc0f9f7b4fd..425cd1620f3d44a6c3d1d8c43488a67552f09765 100644 (file)
@@ -4,7 +4,7 @@
        <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
        <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
        <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
        <classpathentry kind="output" path="target/classes"/>\r
 </classpath>\r
index ad63562c75563393b0bbf70bdb59d5b786719635..f4af6b07b1f4f61adaf18a2c17afb90cda042456 100644 (file)
@@ -61,7 +61,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index bb2b7a17cf5316e434f6d3cde79766526f58f372..f83f37aa2594dee0f739c7b9f1101ec5d1420cd8 100644 (file)
@@ -33,7 +33,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
-
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 //import org.collectionspace.services.common.context.ServiceContext;
@@ -47,6 +47,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * The Class CollectionObjectClient.
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
 public class CollectionObjectClient extends AbstractServiceClientImpl {
 
@@ -56,7 +57,8 @@ public class CollectionObjectClient extends AbstractServiceClientImpl {
        /* (non-Javadoc)
         * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
         */
-       public String getServicePathComponent() {
+       @Override
+    public String getServicePathComponent() {
                return "collectionobjects";
        }
 
@@ -68,6 +70,11 @@ public class CollectionObjectClient extends AbstractServiceClientImpl {
         RegisterBuiltin.register(factory);
         setProxy();
     }
+    
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.collectionObjectProxy;
+    }
 
     /**
      * Sets the proxy.
@@ -92,6 +99,13 @@ public class CollectionObjectClient extends AbstractServiceClientImpl {
         return collectionObjectProxy.readList();
 
     }
+
+    @Override
+    public ClientResponse<AbstractCommonList> readList(String pageSize,
+               String pageNumber) {
+        return collectionObjectProxy.readList(pageSize, pageNumber);
+
+    }
     
     /**
      * Roundtrip.
index d0e0a4dcfb22060007c6f9b0ad76e2e517d3a72e..a454f2279ad626555a017939711543c948baabcd 100644 (file)
@@ -1,3 +1,29 @@
+/**    
+ * CollectionObjectProxy.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright Â© 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
@@ -13,9 +39,13 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.client.IClientQueryParams;
+import org.collectionspace.services.client.CollectionSpaceProxy;
 import org.collectionspace.services.common.query.IQueryManager;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+
 import org.jboss.resteasy.client.ClientResponse;
 
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
@@ -23,21 +53,38 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 
 /**
  * @version $Revision:$
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
 @Path("/collectionobjects/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface CollectionObjectProxy {
+public interface CollectionObjectProxy extends CollectionSpaceProxy {
 
+    /**
+     * Read list.
+     *
+     * @return the client response
+     */
     @GET
     @Produces({"application/xml"})
     ClientResponse<CollectionobjectsCommonList> readList();
 
+    /**
+     * Roundtrip.
+     *
+     * @return the client response
+     */
     @GET
     @Path("/roundtrip")
     @Produces({"application/xml"})
     ClientResponse<Response> roundtrip();
 
+    /**
+     * Keyword search.
+     *
+     * @param keywords the keywords
+     * @return the client response
+     */
     @GET
     @Path("/search")
     @Produces({"application/xml"})
@@ -45,15 +92,33 @@ public interface CollectionObjectProxy {
                @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS) String keywords);
 
     //(C)reate
+    /**
+     * Creates the.
+     *
+     * @param multipart the multipart
+     * @return the client response
+     */
     @POST
     ClientResponse<Response> create(MultipartOutput multipart);
 
     //(R)ead
+    /**
+     * Read.
+     *
+     * @param csid the csid
+     * @return the client response
+     */
     @GET
     @Path("/{csid}")
     ClientResponse<MultipartInput> read(@PathParam("csid") String csid);
     
     // List Authority references
+    /**
+     * Gets the authority refs.
+     *
+     * @param csid the csid
+     * @return the authority refs
+     */
     @GET
     @Produces({"application/xml"})
     @Path("/{csid}/authorityrefs/")
@@ -61,11 +126,24 @@ public interface CollectionObjectProxy {
     
 
     //(U)pdate
+    /**
+     * Update.
+     *
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
     @PUT
     @Path("/{csid}")
     ClientResponse<MultipartInput> update(@PathParam("csid") String csid, MultipartOutput multipart);
 
     //(D)elete
+    /**
+     * Delete.
+     *
+     * @param csid the csid
+     * @return the client response
+     */
     @DELETE
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
index 67ff9059a2000ba7ac6ed25993cdd1ea4063ae9a..ac23ec85473c4db3e1b37539adb11de27a3e07fa 100644 (file)
@@ -32,11 +32,13 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionObjectClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -77,6 +79,23 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest {
     private String inscriberRefName = null;
     private final int NUM_AUTH_REFS_EXPECTED = 4;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 2d91d022706a5abf61ac755bb0175dd874e1e0e6..f1861d2c68d3a82a8c1762f92680b0b0224088ea 100644 (file)
@@ -27,13 +27,16 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.AbstractServiceClientImpl;
 import org.collectionspace.services.client.CollectionObjectClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
 import org.collectionspace.services.collectionobject.domain.naturalhistory.CollectionobjectsNaturalhistory;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
 import org.collectionspace.services.collectionobject.ResponsibleDepartmentList;
-import org.jboss.resteasy.client.ClientResponse;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
+import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
@@ -53,25 +56,60 @@ import org.slf4j.LoggerFactory;
  */
 public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
 
+    /** The logger. */
     private final Logger logger =
             LoggerFactory.getLogger(CollectionObjectServiceTest.class);
     // Instance variables specific to this test.
+    /** The known resource id. */
     private String knownResourceId = null;
+    
+    /** The all resource ids created. */
     private List<String> allResourceIdsCreated = new ArrayList();
+    
+    /** The multivalue. */
     private boolean multivalue; //toggle
 
-    /*
-     * This method is called only by the parent class, AbstractServiceTest
+    /**
+     * Gets the logger.
+     *
+     * @return the logger
+     */
+    private Logger getLogger() {
+       return this.logger;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
      */
     @Override
     protected String getServicePathComponent() {
         return new CollectionObjectClient().getServicePathComponent();
     }
-
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new CollectionObjectClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(CollectionobjectsCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
@@ -121,6 +159,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
      * Tests to diagnose and verify the fixed status of CSPACE-1026,
      * "Whitespace at certain points in payload cause failure"
      */
+    /**
+     * Creates the from xml cambridge.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createFromXmlCambridge(String testName) throws Exception {
@@ -129,6 +173,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         testSubmitRequest(newId);
     }
 
+    /**
+     * Creates the from xml rfw s1.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createFromXmlRFWS1(String testName) throws Exception {
@@ -139,6 +189,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         testSubmitRequest(newId);
     }
 
+    /**
+     * Creates the from xml rfw s2.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createFromXmlRFWS2(String testName) throws Exception {
@@ -149,6 +205,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         testSubmitRequest(newId);
     }
 
+    /**
+     * Creates the from xml rfw s3.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createFromXmlRFWS3(String testName) throws Exception {
@@ -159,6 +221,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         testSubmitRequest(newId);
     }
 
+    /**
+     * Creates the from xml rfw s4.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createFromXmlRFWS4(String testName) throws Exception {
@@ -174,6 +242,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
      * fields, which contain null values, can be successfully created
      * but an error occurs on trying to retrieve those records).
      */
+    /**
+     * Creates the with null value repeatable field.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "testSubmitRequest"})
     public void createWithNullValueRepeatableField(String testName) throws Exception {
@@ -194,7 +268,7 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"create"})
     public void createList(String testName) throws Exception {
-        for (int i = 0; i < 3; i++) {
+        for (int i = 0; i < DEFAULT_LIST_SIZE; i++) {
             create(testName);
         }
     }
@@ -202,6 +276,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createWithEmptyEntityBody(String testName) throws Exception {
@@ -221,6 +298,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         setupCreate(testName);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createWithWrongXmlSchema(String testName) throws Exception {
@@ -378,6 +458,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"create"})
@@ -420,6 +503,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
@@ -443,10 +529,14 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    
     // ---------------------------------------------------------------
     // CRUD tests : READ_LIST tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"createList", "read"})
@@ -496,6 +586,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : UPDATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
@@ -547,6 +640,13 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
 
     }
 
+    /**
+     * Update retrieve.
+     *
+     * @param testName the test name
+     * @param id the id
+     * @return the client response
+     */
     private ClientResponse<MultipartInput> updateRetrieve(String testName, String id) {
         final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
         CollectionObjectClient client = new CollectionObjectClient();
@@ -561,6 +661,14 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         return res;
     }
 
+    /**
+     * Update send.
+     *
+     * @param testName the test name
+     * @param id the id
+     * @param collectionObject the collection object
+     * @return the client response
+     */
     private ClientResponse<MultipartInput> updateSend(String testName, String id,
             CollectionobjectsCommon collectionObject) {
         MultipartOutput output = new MultipartOutput();
@@ -574,6 +682,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
@@ -594,6 +705,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     public void updateWithMalformedXml(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"read"})
@@ -680,7 +794,10 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     }
 */
 
-    @Override
+    /* (non-Javadoc)
+ * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
+ */
+@Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
@@ -768,6 +885,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : DELETE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
@@ -792,6 +912,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
     dependsOnMethods = {"delete"})
@@ -828,6 +951,12 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         testSubmitRequest(knownResourceId);
     }
 
+    /**
+     * Test submit request.
+     *
+     * @param resourceId the resource id
+     * @throws Exception the exception
+     */
     private void testSubmitRequest(String resourceId) throws Exception {
 
         // Expected status code: 200 OK
@@ -881,6 +1010,13 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
+    /**
+     * Creates the collection object instance.
+     *
+     * @param commonPartName the common part name
+     * @param identifier the identifier
+     * @return the multipart output
+     */
     private MultipartOutput createCollectionObjectInstance(String commonPartName,
             String identifier) {
         return createCollectionObjectInstance(commonPartName,
@@ -888,6 +1024,14 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
                 "objectName-" + identifier);
     }
 
+    /**
+     * Creates the collection object instance.
+     *
+     * @param commonPartName the common part name
+     * @param objectNumber the object number
+     * @param objectName the object name
+     * @return the multipart output
+     */
     private MultipartOutput createCollectionObjectInstance(String commonPartName,
             String objectNumber, String objectName) {
         CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
@@ -921,6 +1065,14 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         return multipart;
     }
 
+    /**
+     * Creates the collection object instance.
+     *
+     * @param commonPartName the common part name
+     * @param collectionObject the collection object
+     * @param conh the conh
+     * @return the multipart output
+     */
     private MultipartOutput createCollectionObjectInstance(String commonPartName,
             CollectionobjectsCommon collectionObject, CollectionobjectsNaturalhistory conh) {
 
@@ -1001,10 +1153,24 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
 
     }
 
+    /**
+     * Gets the nH part name.
+     *
+     * @return the nH part name
+     */
     private String getNHPartName() {
         return "collectionobjects_naturalhistory";
     }
 
+    /**
+     * Creates the from xml file.
+     *
+     * @param testName the test name
+     * @param fileName the file name
+     * @param useJaxb the use jaxb
+     * @return the string
+     * @throws Exception the exception
+     */
     private String createFromXmlFile(String testName, String fileName, boolean useJaxb) throws Exception {
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
index 50ea8c6dfb9728eb677949bead8a21e15dfc6ab5..ca713ed1498739b9c1acda8f6cee03e3d290020b 100644 (file)
@@ -93,7 +93,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.1.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index bbabacf5d0e0de1210edabc0466bb5fb575599c3..cfbb94aab7efcaabcedd7c5fb6b5a6d5dcf4a730 100644 (file)
             <artifactId>org.collectionspace.services.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
         </dependency>\r
 \r
         <!-- jboss -->\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>jaxrs-api</artifactId>\r
+        </dependency>        \r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.1.GA</version>\r
         </dependency>\r
 \r
         <dependency>\r
index e1092fcfde94c2eb37e52029dc0814f163649b30..1c4862f89b4da4f3b816c9c5d2e473b1c405e6ab 100644 (file)
@@ -20,6 +20,7 @@ package org.collectionspace.services.common.document;
 import java.util.ArrayList;\r
 import java.util.List;\r
 import javax.ws.rs.core.MultivaluedMap;\r
+import org.collectionspace.services.client.IClientQueryParams;\r
 import org.collectionspace.services.common.query.IQueryManager;\r
 import org.collectionspace.services.common.context.ServiceContext;\r
 \r
@@ -34,11 +35,10 @@ import org.jboss.resteasy.specimpl.MultivaluedMapImpl;
  */\r
 public class DocumentFilter {\r
 \r
-    public static final String PAGE_SIZE_DEFAULT_PROPERTY = "pageSizeDefault";\r
-    public static final String PAGE_SIZE_PARAM = "pgSz";\r
-    public static final String START_PAGE_PARAM = "pgNum";\r
     public static final int DEFAULT_PAGE_SIZE_INIT = 40;\r
+    public static final String PAGE_SIZE_DEFAULT_PROPERTY = "pageSizeDefault";\r
     public static int defaultPageSize = DEFAULT_PAGE_SIZE_INIT;\r
+\r
     protected String whereClause;      // Filtering clause. Omit the "WHERE".\r
     protected int startPage;           // Pagination offset for list results\r
     protected int pageSize;                    // Pagination limit for list results\r
@@ -128,7 +128,7 @@ public class DocumentFilter {
         // Set the page size\r
         //\r
         String pageSizeStr = null;\r
-        List<String> list = queryParams.remove(PAGE_SIZE_PARAM);\r
+        List<String> list = queryParams.remove(IClientQueryParams.PAGE_SIZE_PARAM);\r
         if (list != null) {\r
             pageSizeStr = list.get(0);\r
         }\r
@@ -138,7 +138,7 @@ public class DocumentFilter {
         // Set the start page\r
         //\r
         String startPageStr = null;\r
-        list = queryParams.remove(START_PAGE_PARAM);\r
+        list = queryParams.remove(IClientQueryParams.START_PAGE_PARAM);\r
         if (list != null) {\r
             startPageStr = list.get(0);\r
         }\r
@@ -243,7 +243,8 @@ public class DocumentFilter {
             } catch (NumberFormatException e) {\r
                 //FIXME This should cause a warning in the log file and should result in the\r
                 //FIXME page size being set to the default.  We don't need to throw an exception here.\r
-                throw new NumberFormatException("Bad value for: " + PAGE_SIZE_PARAM);\r
+                throw new NumberFormatException("Bad value for: " +\r
+                               IClientQueryParams.PAGE_SIZE_PARAM);\r
             }\r
         }\r
 \r
@@ -260,7 +261,8 @@ public class DocumentFilter {
             try {\r
                 startPage = Integer.valueOf(startPageStr);\r
             } catch (NumberFormatException e) {\r
-                throw new NumberFormatException("Bad value for: " + START_PAGE_PARAM);\r
+                throw new NumberFormatException("Bad value for: " +\r
+                               IClientQueryParams.START_PAGE_PARAM);\r
             }\r
         }\r
     }\r
index 5d447317626a795977ba984879ad53ecdca9321e..6d85d46e13f5b793639d22bb057a87071914bc36 100644 (file)
@@ -43,7 +43,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.0.2.GA</version>
             <!-- filter out unwanted jars -->
             <exclusions>
                 <exclusion>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>commons-httpclient</groupId>
index dadcbad2dec35263a5ac186e9929aea93907c77a..a5c2da88b8ec8472fe2bdb06eedd5f3be5287588 100644 (file)
@@ -64,6 +64,11 @@ public class ContactClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.contactProxy;
+    }
+    
     /**
      * allow to reset proxy as per security needs
      */
index 99cf4b104ea3c8c6a55f14aacb9c77762f7bd3d6..35ff0fdbddf43abcc7d7d60d0f1e193e6a1d9336 100644 (file)
@@ -21,7 +21,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/contacts/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface ContactProxy {
+public interface ContactProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index c6316ad9d41933a8d70506fae1e0036a662509ba..eed72b171f39f942ba33993e9a3873aefaa01d95 100644 (file)
@@ -27,10 +27,12 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ContactClient;
 import org.collectionspace.services.client.ContactClientUtils;
 import org.collectionspace.services.contact.ContactsCommon;
 import org.collectionspace.services.contact.ContactsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -61,6 +63,23 @@ public class ContactServiceTest extends AbstractServiceTestImpl {
     private String knownResourceId = null;
     private List<String> allResourceIdsCreated = new ArrayList();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new ContactClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(ContactsCommonList.class);
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index bbe6e44b462b5527d2513f7d483def367489f29a..f51f7824f970695161c3d5b0f263ff655a3ca904 100644 (file)
@@ -51,7 +51,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.0.2.GA</version>
             <exclusions>
                 <exclusion>
                     <groupId>tjws</groupId>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         
         <!-- nuxeo -->
index ecd144b2aff7150f9b634196ef347929257eba28..3bc8bcb7089f0b984a63fcf51fb76b5702cd635a 100644 (file)
@@ -46,7 +46,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 3ea07ac21b859324302e1ec8826f0731905370f2..ab26a2e5daf896a2d62bbd1a8a7e420e84973eb4 100644 (file)
@@ -73,6 +73,11 @@ public class DimensionClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.dimensionProxy;
+    }
+
     /**
      * allow to reset proxy as per security needs
      */
index f66872726c6da4aa1db78eaab513f19a71ab0b17..ea71d5aa1f74d50516d66fb5cd758031111d690e 100644 (file)
@@ -21,7 +21,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/dimensions/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface DimensionProxy {
+public interface DimensionProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index 2b150912189314d127b4c04edc49573faa48c404..e0898e7882abb2c0ff4c04f9a0b9d3369fe514ea 100644 (file)
@@ -27,9 +27,11 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.DimensionClient;
 import org.collectionspace.services.dimension.DimensionsCommon;
 import org.collectionspace.services.dimension.DimensionsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -60,6 +62,23 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
     private String knownResourceId = null;
     private List<String> allResourceIdsCreated = new ArrayList();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new DimensionClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(DimensionsCommonList.class);
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 289b15ba7961117155964399c6d7a87acc9be047..57c36c0269603823867e4fc3fa202cd2b1b20ac7 100644 (file)
@@ -58,7 +58,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index 34ad26e9f978a8479df64b9113572e3d55075175..eb6683bea096e5ab67951dab63e67dbb7db77204 100644 (file)
@@ -40,7 +40,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.0.2.GA</version>
             <!-- filter out unwanted jars -->
             <exclusions>
                 <exclusion>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
     </dependencies>
 
index 0b6ab8dd1584862c5f328bc280f541add8148103..1c1179f948e55e490078bb9dc4dce86efcab3552 100644 (file)
   <name>services.id.service</name>
 
   <dependencies>
-
+    <!-- keep slf4j dependencies on the top -->
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
     <!-- Code common to all CollectionSpace services. -->
     <dependency>
       <groupId>org.collectionspace.services</groupId>
     </dependency>
 
     <!-- JBoss RESTEasy, a framework for providing and consuming RESTful services. -->
-    <!-- NOTE: Versions later than 1.0.2.GA - such as 1.1 GA - are available. -->
     <!-- JAX-RS support, a Java specification for RESTful services. -->
     <dependency>
       <groupId>org.jboss.resteasy</groupId>
       <artifactId>resteasy-jaxrs</artifactId>
-      <version>1.0.2.GA</version>
       <exclusions>
         <exclusion>
           <groupId>tjws</groupId>
     <dependency>
       <groupId>org.jboss.resteasy</groupId>
       <artifactId>resteasy-jaxb-provider</artifactId>
-      <version>1.0.2.GA</version>
     </dependency>
     <!-- MIME Multipart messaging support. -->
     <dependency>
       <groupId>org.jboss.resteasy</groupId>
       <artifactId>resteasy-multipart-provider</artifactId>
-      <version>1.0.2.GA</version>
     </dependency>
 
     <!-- Cobertura, a tool for identifying the extent of code coverage in test classes -->
index f341b0e1836e827478704cdb08a11b33139715b0..c377dc5d3dac682e2bcca2642c07d204b847c8e8 100644 (file)
@@ -4,7 +4,7 @@ import org.collectionspace.services.id.part.GregorianDateIDPart;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
-import java.util.Date;
+//import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.Locale;
 
@@ -15,6 +15,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class GregorianDateIDPartTest {
+       
+       public GregorianDateIDPartTest(String inComingString) {
+               System.err.println("GregorianDateIDPartTest constructor invoked!");
+               //empty constructor
+       }
 
     final Logger logger =
         LoggerFactory.getLogger(GregorianDateIDPartTest.class);
@@ -48,6 +53,7 @@ public class GregorianDateIDPartTest {
 
     @Test
     public void format() {
+       //empty?
     }
 
     @Test
index 7a1b28a07eff7931ed96d632873fd6974ff2991a..2504fd2f316a6ba45ab222debb52575f489be8c8 100644 (file)
@@ -9,6 +9,11 @@ public class NumericIDPartRegexValidatorTest {
 
     NumericIDPartRegexValidator validator = new NumericIDPartRegexValidator();
 
+       public NumericIDPartRegexValidatorTest(String inComingString) {
+               System.err.println("NumericIDPartRegexValidatorTest constructor invoked!");
+               //empty constructor
+       }
+    
     @Test
     public void isValid() {
         Assert.assertTrue(validator.isValid("0"));
index e7487b6b6b46b331a3f620b721fc5258d1de644d..09b15d019611027817feca77c06fd8ebaf2b4c9a 100644 (file)
@@ -61,7 +61,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 6c5adba64cb74a63880901c6214f0a80e3642726..cb215bec2bced863462529e1f536b97061ba1b88 100644 (file)
@@ -44,6 +44,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * A IntakeClient.
 
  * @version $Revision:$
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
 public class IntakeClient extends AbstractServiceClientImpl {
 
@@ -73,6 +74,11 @@ public class IntakeClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.intakeProxy;
+    }
+    
     /**
      * allow to reset proxy as per security needs
      */
index 4ac7ca434c18ea084870cbc58c45f2b4252ad8f4..21c8760c7aedad036a226269050a699b28c4cd02 100644 (file)
@@ -1,3 +1,29 @@
+/**    
+ * IntakeProxy.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright Â© 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
@@ -19,36 +45,73 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 
 /**
  * @version $Revision:$
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
 @Path("/intakes/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface IntakeProxy {
+public interface IntakeProxy extends CollectionSpaceProxy {
 
+    /**
+     * Read list.
+     *
+     * @return the client response
+     */
     @GET
     @Produces({"application/xml"})
     ClientResponse<IntakesCommonList> readList();
 
     //(C)reate
+    /**
+     * Creates the.
+     *
+     * @param multipart the multipart
+     * @return the client response
+     */
     @POST
     ClientResponse<Response> create(MultipartOutput multipart);
 
     //(R)ead
+    /**
+     * Read.
+     *
+     * @param csid the csid
+     * @return the client response
+     */
     @GET
     @Path("/{csid}")
     ClientResponse<MultipartInput> read(@PathParam("csid") String csid);
 
     //(U)pdate
+    /**
+     * Update.
+     *
+     * @param csid the csid
+     * @param multipart the multipart
+     * @return the client response
+     */
     @PUT
     @Path("/{csid}")
     ClientResponse<MultipartInput> update(@PathParam("csid") String csid, MultipartOutput multipart);
 
     //(D)elete
+    /**
+     * Delete.
+     *
+     * @param csid the csid
+     * @return the client response
+     */
     @DELETE
     @Path("/{csid}")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
     
     // List Items
+    /**
+     * Gets the authority refs.
+     *
+     * @param csid the csid
+     * @return the authority refs
+     */
     @GET
     @Produces({"application/xml"})
     @Path("/{csid}/authorityrefs/")
index 82812a2be988c21bb5f4d3998d41da7ffeade52e..557706a0e8ff020a7e7edaccef53f10802361e0e 100644 (file)
@@ -31,12 +31,13 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.intake.IntakesCommon;
-import org.collectionspace.services.intake.IntakesCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -79,6 +80,23 @@ public class IntakeAuthRefsTest extends BaseServiceTest {
     private String valuerRefName = null;
     private final int NUM_AUTH_REFS_EXPECTED = 6;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 7c1c1ca637b42a7551634c402266246150e4d526..11433935afbe4f1e8ec83670a111fde211b9e78b 100644 (file)
@@ -27,12 +27,13 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.intake.IntakesCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
-
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
@@ -44,6 +45,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
  * IntakeServiceTest, carries out tests against a
  * deployed and running Intake Service.
  *
@@ -52,18 +54,44 @@ import org.slf4j.LoggerFactory;
  */
 public class IntakeServiceTest extends AbstractServiceTestImpl {
 
+   /** The logger. */
    private final Logger logger =
        LoggerFactory.getLogger(IntakeServiceTest.class);
 
     // Instance variables specific to this test.
+    /** The SERVIC e_ pat h_ component. */
     final String SERVICE_PATH_COMPONENT = "intakes";
+    
+    /** The known resource id. */
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    
+    /** The all resource ids created. */
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new IntakeClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       return response.getEntity(IntakesCommonList.class);
+    }
+    
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
@@ -108,6 +136,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
         allResourceIdsCreated.add(extractId(res));
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create"})
@@ -120,14 +151,23 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
+     */
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -216,6 +256,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create"})
@@ -245,6 +288,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"read"})
@@ -272,6 +318,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ_LIST tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"createList", "read"})
@@ -320,6 +369,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : UPDATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"read"})
@@ -384,12 +436,23 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception{
     }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
+     */
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
     }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -474,6 +537,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     }
      */
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"update", "testSubmitRequest"})
@@ -505,6 +571,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : DELETE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
@@ -529,6 +598,9 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"delete"})
@@ -614,11 +686,20 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+     */
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
+    /**
+     * Creates the intake instance.
+     *
+     * @param identifier the identifier
+     * @return the multipart output
+     */
     private MultipartOutput createIntakeInstance(String identifier) {
         return createIntakeInstance(
                 "entryNumber-" + identifier,
@@ -626,6 +707,14 @@ public class IntakeServiceTest extends AbstractServiceTestImpl {
                 "depositor-" + identifier);
     }
 
+    /**
+     * Creates the intake instance.
+     *
+     * @param entryNumber the entry number
+     * @param entryDate the entry date
+     * @param depositor the depositor
+     * @return the multipart output
+     */
     private MultipartOutput createIntakeInstance(String entryNumber,
                String entryDate,
                String depositor) {
index 1d06f354da24f98db894355ecf60379c332e00cc..7577b9e842b20c9ed89f52e34e9cbbd760e9147f 100644 (file)
@@ -31,12 +31,14 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.intake.IntakesCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -80,6 +82,23 @@ public class PersonAuthRefDocsTest extends BaseServiceTest {
     private String valuerRefName = null;
     private final int NUM_AUTH_REF_DOCS_EXPECTED = 1;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 1ccf374165527ce943b60ca42001c1be2bad06f1..6dbd12b320b7890c6cddd9cc86010aae1195a329 100644 (file)
@@ -63,7 +63,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index b64917c617d2766a0a561881053342075aabb69a..6b2cd8249f4192dceb1d8aef689411db2cdd6f61 100644 (file)
@@ -61,7 +61,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.1.GA</version>
             <!-- filter out unwanted jars -->
             <exclusions>
                 <exclusion>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.1.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.1.GA</version>
         </dependency>
         <dependency>
             <groupId>commons-httpclient</groupId>
index 50a61df329b4c8d67d208e5002d901a9a2cc5882..405448e9b1f9b35c7c595aa02a2e825852e73d48 100644 (file)
@@ -64,6 +64,11 @@ public class LoaninClient extends AbstractServiceClientImpl {
         RegisterBuiltin.register(factory);
         setProxy();
     }
+    
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.loaninProxy;
+    }    
 
     /**
      * allow to reset proxy as per security needs
index f8871bc63b8131b846782d1163a8412b5cc97edf..4c8b641380c332d03021adc8f1ff9b082ed69fff 100644 (file)
@@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/loansin/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface LoaninProxy {
+public interface LoaninProxy extends CollectionSpaceProxy {
 
     //(C)reate
     @POST
index 4dc8fd1fb296d0de9228e003c63906dcba5f2215..db34e6b4f8790501e8816217aa7013a99ef9671d 100644 (file)
@@ -31,11 +31,13 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoaninClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanin.LoansinCommon;
 import org.collectionspace.services.loanin.LoansinCommonList;
 
@@ -79,6 +81,23 @@ public class LoaninAuthRefsTest extends BaseServiceTest {
     // to tenant-bindings.xml
     private final int NUM_AUTH_REFS_EXPECTED = 3;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 8a0f95e79f62aa13711b3e9b1976877ae0b9f867..4b977b6fb5c187bf25cd02846c36a583d8e9e105 100644 (file)
@@ -27,14 +27,14 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoaninClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanin.LoansinCommon;
 import org.collectionspace.services.loanin.LoansinCommonList;
 import org.collectionspace.services.loanin.LenderList;
 
-
 import org.jboss.resteasy.client.ClientResponse;
-
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
@@ -60,8 +60,25 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     // Instance variables specific to this test.
     final String SERVICE_PATH_COMPONENT = "loansin";
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new LoaninClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(LoansinCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 9deb8b93ef95710892fde91c9f875693d9f7e856..9950fd532b0b29643829d670a8045495c518a0a9 100644 (file)
@@ -63,7 +63,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.0.2.GA</version>
             <exclusions>
                 <exclusion>
                     <groupId>tjws</groupId>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         
         <!-- nuxeo -->
index 93f2e0f05b4337e8fa370ae09a91c1f1d33028ca..74ac0fa23f856b0594e666e4f08fe911abba883b 100644 (file)
@@ -61,7 +61,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.1.GA</version>
             <!-- filter out unwanted jars -->
             <exclusions>
                 <exclusion>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.1.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.1.GA</version>
         </dependency>
         <dependency>
             <groupId>commons-httpclient</groupId>
index c78b27af3ca9fe0a80d0d1f357034d014206f2e1..8771e1ae1224f0ac8878091180c3c97c966f92ed 100644 (file)
@@ -65,6 +65,11 @@ public class LoanoutClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.loanoutProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index 51115814212197ddebe3860b30e37e199be6a68d..00a6652d18eba706b22c3ce7cc54dbac0a8efded 100644 (file)
@@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/loansout/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface LoanoutProxy {
+public interface LoanoutProxy extends CollectionSpaceProxy {
 
     //(C)reate
     @POST
index f89481c57e6b3521596b4b7bb9419775f6356b28..ef19f4c5f4eaa2f5cfa9c2fff59982501fb5a948 100644 (file)
@@ -31,11 +31,13 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoanoutClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanout.LoansoutCommon;
 import org.collectionspace.services.loanout.LoansoutCommonList;
 
@@ -81,6 +83,23 @@ public class LoanoutAuthRefsTest extends BaseServiceTest {
     // number of expected authRefs to 4.
     private final int NUM_AUTH_REFS_EXPECTED = 3;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 228a7fc5eaaf5a4c0621dc225dfe8cd182a20245..b19069700461a479186ba6494175547edf1293aa 100644 (file)
@@ -27,7 +27,9 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoanoutClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanout.LoansoutCommon;
 import org.collectionspace.services.loanout.LoansoutCommonList;
 
@@ -52,18 +54,44 @@ import org.slf4j.LoggerFactory;
  */
 public class LoanoutServiceTest extends AbstractServiceTestImpl {
 
+   /** The logger. */
    private final Logger logger =
        LoggerFactory.getLogger(LoanoutServiceTest.class);
 
     // Instance variables specific to this test.
+    /** The SERVIC e_ pat h_ component. */
     final String SERVICE_PATH_COMPONENT = "loansout";
+    
+    /** The known resource id. */
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    
+    /** The all resource ids created. */
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new LoanoutClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(LoansoutCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
@@ -108,6 +136,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
         allResourceIdsCreated.add(extractId(res));
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create"})
@@ -120,14 +151,23 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
+     */
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -216,6 +256,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create"})
@@ -245,6 +288,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"read"})
@@ -272,6 +318,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ_LIST tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"createList", "read"})
@@ -320,6 +369,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : UPDATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"read"})
@@ -383,12 +435,23 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception{
     }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
+     */
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
     }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -473,6 +536,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     }
      */
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"update", "testSubmitRequest"})
@@ -504,6 +570,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : DELETE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
@@ -528,6 +597,9 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"delete"})
@@ -613,17 +685,33 @@ public class LoanoutServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+     */
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
+    /**
+     * Creates the loanout instance.
+     *
+     * @param identifier the identifier
+     * @return the multipart output
+     */
     private MultipartOutput createLoanoutInstance(String identifier) {
         return createLoanoutInstance(
                 "loanoutNumber-" + identifier,
                 "returnDate-" + identifier);
     }
 
+    /**
+     * Creates the loanout instance.
+     *
+     * @param loanOutNumber the loan out number
+     * @param returnDate the return date
+     * @return the multipart output
+     */
     private MultipartOutput createLoanoutInstance(String loanOutNumber,
                String returnDate) {
         LoansoutCommon loanout = new LoansoutCommon();
index 3fd62547fe1d51b1451bab606a95e3145aa3f9ae..a424698f25f4f026b4a5676807397da6992fce97 100644 (file)
@@ -63,7 +63,6 @@
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
-            <version>1.0.2.GA</version>
             <exclusions>
                 <exclusion>
                     <groupId>tjws</groupId>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-multipart-provider</artifactId>
-            <version>1.0.2.GA</version>
         </dependency>
         
         <!-- nuxeo -->
index 39416b42676553c8ed78e6605db478422d8ad827..f260a56d77c7847ecd036fc9f5dfe6263bd00db6 100644 (file)
@@ -55,7 +55,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 3e8ed0a7e8b7de4436607dea6157b31ab882a9cf..95b2195a12629e35a826a193a80cbd93ac144f09 100644 (file)
@@ -53,6 +53,11 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.orgAuthorityProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index 60332c1bc2811a07d7513f53bfb02daa3b8a299d..600e0a6d89413305963056130f77cd78a62687a1 100644 (file)
@@ -24,7 +24,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/orgauthorities/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface OrgAuthorityProxy {
+public interface OrgAuthorityProxy extends CollectionSpaceProxy {
 
     // List OrgAuthorities
     @GET
index 9fb22eb661dc3bb21424830922d8761d1b4f8aaa..1a2ec608f61823598692281d27610ac834fd68d5 100644 (file)
@@ -31,13 +31,13 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList.AuthorityRefItem;
-import org.collectionspace.services.organization.OrgauthoritiesCommon;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.organization.OrganizationsCommon;
 
 import org.jboss.resteasy.client.ClientResponse;
@@ -79,6 +79,23 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
     private String organizationContactPersonRefName = null;
     private final int NUM_AUTH_REFS_EXPECTED = 1;
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 59aaa854bbcf8ff0adf41528cad18b127bff6974..db4d0ac4d7526469d5a150a48af64f132ae6e4e8 100644 (file)
@@ -30,12 +30,14 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.OrganizationJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ContactClient;
 import org.collectionspace.services.client.ContactClientUtils;
 import org.collectionspace.services.contact.ContactsCommon;
 import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommon;
 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
 import org.collectionspace.services.organization.OrganizationsCommon;
@@ -81,6 +83,23 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl {
     private Map<String, String> allContactResourceIdsCreated =
         new HashMap<String, String>();
     
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new OrgAuthorityClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(OrganizationsCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 2e3886da3ef58bfbdff8ecaa0c483286fcccf345..136f7bbac4f433e45899775206c50edf947ae1d8 100644 (file)
             <artifactId>org.collectionspace.services.organization.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
-<!--         \r
-        <dependency>\r
-            <groupId>org.testng</groupId>\r
-            <artifactId>testng</artifactId>\r
-            <version>5.6</version>\r
-        </dependency>\r
- -->        \r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 7cdf7380d527f6e8286a107401651446cade29d0..b0d5251f09470f45cf699b258b6e345217b04b1d 100644 (file)
@@ -84,7 +84,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index d2da2f27a4f69c7be56b40c8138d3f0adc2b3f16..4c7f7d64916da4586a3594ba38a636858810192d 100644 (file)
@@ -59,7 +59,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index af2efcd169b6e630137efaa1e88dc00c7c9066aa..782743bebaa3f8b995b936621cca5693aa8b49cb 100644 (file)
@@ -56,6 +56,11 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.personAuthorityProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index ca8f4e688e51fe6e27006fb7b26512c6a20f3467..6d8c0ac5831aa0b025bf5555a21a04954d6dc845 100644 (file)
@@ -24,7 +24,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/personauthorities/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface PersonAuthorityProxy {
+public interface PersonAuthorityProxy extends CollectionSpaceProxy {
 
     // List Personauthorities
     @GET
index 90358fcd0d25a9c56c26e519608b1105134612ef..3006ad2c31987d0a56b388bdd2cf5b8125fa3ad1 100644 (file)
@@ -30,12 +30,14 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ContactClient;
 import org.collectionspace.services.client.ContactClientUtils;
 import org.collectionspace.services.contact.ContactsCommon;
 import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.person.PersonauthoritiesCommon;
 import org.collectionspace.services.person.PersonauthoritiesCommonList;
 import org.collectionspace.services.person.PersonsCommon;
@@ -59,35 +61,88 @@ import org.testng.annotations.Test;
  */
 public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
+    /** The logger. */
     private final Logger logger =
         LoggerFactory.getLogger(PersonAuthorityServiceTest.class);
 
     // Instance variables specific to this test.
+    /** The SERVIC e_ pat h_ component. */
     final String SERVICE_PATH_COMPONENT = "personauthorities";
+    
+    /** The ITE m_ servic e_ pat h_ component. */
     final String ITEM_SERVICE_PATH_COMPONENT = "items";
+    
+    /** The CONTAC t_ servic e_ pat h_ component. */
     final String CONTACT_SERVICE_PATH_COMPONENT = "contacts";
+    
+    /** The TES t_ for e_ name. */
     final String TEST_FORE_NAME = "John";
+    
+    /** The TES t_ middl e_ name. */
     final String TEST_MIDDLE_NAME = null;
+    
+    /** The TES t_ su r_ name. */
     final String TEST_SUR_NAME = "Wayne";
+    
+    /** The TES t_ birt h_ date. */
     final String TEST_BIRTH_DATE = "May 26, 1907";
+    
+    /** The TES t_ deat h_ date. */
     final String TEST_DEATH_DATE = "June 11, 1979";
  
+    /** The known resource id. */
     private String knownResourceId = null;
+    
+    /** The known resource display name. */
     private String knownResourceDisplayName = null;
+    
+    /** The known resource ref name. */
     private String knownResourceRefName = null;
+    
+    /** The known item resource id. */
     private String knownItemResourceId = null;
+    
+    /** The known contact resource id. */
     private String knownContactResourceId = null;
+    
+    /** The n items to create in list. */
     private int nItemsToCreateInList = 3;
+    
+    /** The all resource ids created. */
     private List<String> allResourceIdsCreated = new ArrayList<String>();
+    
+    /** The all item resource ids created. */
     private Map<String, String> allItemResourceIdsCreated =
         new HashMap<String, String>();
+    
+    /** The all contact resource ids created. */
     private Map<String, String> allContactResourceIdsCreated =
         new HashMap<String, String>();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new PersonAuthorityClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(PersonsCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"})
@@ -119,9 +174,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         if(logger.isDebugEnabled()){
             logger.debug(testName + ": status = " + statusCode);
         }
-        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
-                invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
-        Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+        Assert.assertTrue(this.REQUEST_TYPE.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(this.REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, this.EXPECTED_STATUS_CODE);
 
         // Store the refname from the first resource created
         // for additional tests below.
@@ -142,6 +197,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         allResourceIdsCreated.add(newID);
     }
 
+    /**
+     * Creates the item.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"create"})
     public void createItem(String testName) {
@@ -149,6 +209,13 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         String newID = createItemInAuthority(knownResourceId, knownResourceRefName);
     }
 
+    /**
+     * Creates the item in authority.
+     *
+     * @param vcsid the vcsid
+     * @param authRefName the auth ref name
+     * @return the string
+     */
     private String createItemInAuthority(String vcsid, String authRefName) {
 
         final String testName = "createItemInAuthority";
@@ -206,6 +273,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         return newID;
     }
 
+    /**
+     * Creates the contact.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"create"}, dependsOnMethods = {"createItem"})
     public void createContact(String testName) {
@@ -213,6 +285,13 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         String newID = createContactInItem(knownResourceId, knownItemResourceId);
     }
 
+   /**
+    * Creates the contact in item.
+    *
+    * @param parentcsid the parentcsid
+    * @param itemcsid the itemcsid
+    * @return the string
+    */
    private String createContactInItem(String parentcsid, String itemcsid) {
 
         final String testName = "createContactInItem";
@@ -262,14 +341,23 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
+     */
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -358,7 +446,10 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : CREATE LIST tests
     // ---------------------------------------------------------------
     // Success outcomes
-    @Override
+    /* (non-Javadoc)
+ * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
+ */
+@Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"createList"}, dependsOnGroups = {"create"})
     public void createList(String testName) throws Exception {
@@ -367,6 +458,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         }
     }
 
+    /**
+     * Creates the item list.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"createList"}, dependsOnMethods = {"createList"})
     public void createItemList(String testName) throws Exception {
@@ -376,6 +473,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         }
     }
 
+    /**
+     * Creates the contact list.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"createList"}, dependsOnMethods = {"createItemList"})
     public void createContactList(String testName) throws Exception {
@@ -389,6 +492,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnGroups = {"create"})
@@ -421,6 +527,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         }
     }
 
+    /**
+     * Read by name.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
             groups = {"read"}, dependsOnGroups = {"create"})
         public void readByName(String testName) throws Exception {
@@ -484,7 +596,13 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     }
 */
 
-    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
+    /**
+ * Read item.
+ *
+ * @param testName the test name
+ * @throws Exception the exception
+ */
+@Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"read"})
     public void readItem(String testName) throws Exception {
 
@@ -519,6 +637,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
     }
 
+    /**
+     * Verify item display name.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         dependsOnMethods = {"readItem", "updateItem"})
     public void verifyItemDisplayName(String testName) throws Exception {
@@ -627,6 +751,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
                 "Updated DisplayName (not computed) in Person not stored.");
     }
 
+    /**
+     * Verify illegal item display name.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
             dependsOnMethods = {"verifyItemDisplayName"})
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
@@ -673,6 +803,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
     
+    /**
+     * Read contact.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readContact(String testName) throws Exception {
@@ -712,6 +848,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"read"})
@@ -735,6 +874,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Read item non existent.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"readItem"})
     public void readItemNonExistent(String testName) {
@@ -757,6 +901,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Read contact non existent.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"read"}, dependsOnMethods = {"readContact"})
     public void readContactNonExistent(String testName) {
@@ -785,6 +934,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     // Success outcomes
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"readList"}, dependsOnGroups = {"createList", "read"})
@@ -828,15 +980,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         }
     }
 
+    /**
+     * Read item list.
+     */
     @Test(groups = {"readList"}, dependsOnMethods = {"readList"})
     public void readItemList() {
         readItemList(knownResourceId, null);
     }
 
+    /**
+     * Read item list by authority name.
+     */
     @Test(groups = {"readList"}, dependsOnMethods = {"readItemList"})
     public void readItemListByAuthorityName() {
         readItemList(null, knownResourceDisplayName);
     }
+    
+    /**
+     * Read item list.
+     *
+     * @param vcsid the vcsid
+     * @param name the name
+     */
     private void readItemList(String vcsid, String name) {
 
         final String testName = "readItemList";
@@ -902,11 +1067,20 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         }
     }
 
+    /**
+     * Read contact list.
+     */
     @Test(groups = {"readList"}, dependsOnMethods = {"readItemList"})
     public void readContactList() {
         readContactList(knownResourceId, knownItemResourceId);
     }
 
+    /**
+     * Read contact list.
+     *
+     * @param parentcsid the parentcsid
+     * @param itemcsid the itemcsid
+     */
     private void readContactList(String parentcsid, String itemcsid) {
         final String testName = "readContactList";
 
@@ -968,6 +1142,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // CRUD tests : UPDATE tests
     // ---------------------------------------------------------------
     // Success outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnGroups = {"read", "readList"})
@@ -1029,6 +1206,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
                 "Data in updated object did not match submitted data.");
     }
 
+    /**
+     * Update item.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"update"})
     public void updateItem(String testName) throws Exception {
@@ -1092,6 +1275,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
                 "Data in updated Person did not match submitted data.");
     }
 
+    /**
+     * Update contact.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"updateItem"})
     public void updateContact(String testName) throws Exception {
@@ -1158,14 +1347,23 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // Failure outcomes
     // Placeholders until the three tests below can be uncommented.
     // See Issue CSPACE-401.
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
+     */
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
+     */
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
+     */
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
     }
@@ -1250,7 +1448,10 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     }
 */
 
-    @Override
+    /* (non-Javadoc)
+ * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
+ */
+@Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"update", "testSubmitRequest"})
     public void updateNonExistent(String testName) throws Exception {
@@ -1280,6 +1481,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Update non existent item.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"updateItem", "testItemSubmitRequest"})
     public void updateNonExistentItem(String testName) throws Exception {
@@ -1313,6 +1520,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Update non existent contact.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"update"}, dependsOnMethods = {"updateContact", "testContactSubmitRequest"})
     public void updateNonExistentContact(String testName) throws Exception {
@@ -1327,6 +1540,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // Note: delete sub-resources in ascending hierarchical order,
     // before deleting their parents.
 
+    /**
+     * Delete contact.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class, 
         groups = {"delete"}, dependsOnGroups = {"create", "read", "readList", "update"})
     public void deleteContact(String testName) throws Exception {
@@ -1356,6 +1575,12 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+   /**
+    * Delete item.
+    *
+    * @param testName the test name
+    * @throws Exception the exception
+    */
    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteItem(String testName) throws Exception {
@@ -1383,6 +1608,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
@@ -1411,6 +1639,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     }
 
     // Failure outcomes
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
     @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"delete"}, dependsOnMethods = {"delete"})
@@ -1434,6 +1665,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Delete non existent item.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"delete"}, dependsOnMethods = {"deleteItem"})
     public void deleteNonExistentItem(String testName) {
@@ -1456,6 +1692,11 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
     }
 
+    /**
+     * Delete non existent contact.
+     *
+     * @param testName the test name
+     */
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"delete"}, dependsOnMethods = {"deleteContact"})
     public void deleteNonExistentContact(String testName) {
@@ -1507,6 +1748,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
     }
 
+    /**
+     * Test item submit request.
+     */
     @Test(dependsOnMethods = {"createItem", "readItem", "testSubmitRequest"})
     public void testItemSubmitRequest() {
 
@@ -1528,6 +1772,9 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
 
     }
 
+    /**
+     * Test contact submit request.
+     */
     @Test(dependsOnMethods = {"createContact", "readContact", "testItemSubmitRequest"})
     public void testContactSubmitRequest() {
 
@@ -1610,15 +1857,28 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl {
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+     */
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
+    /**
+     * Gets the item service path component.
+     *
+     * @return the item service path component
+     */
     public String getItemServicePathComponent() {
         return ITEM_SERVICE_PATH_COMPONENT;
     }
 
+    /**
+     * Gets the contact service path component.
+     *
+     * @return the contact service path component
+     */
     public String getContactServicePathComponent() {
         return CONTACT_SERVICE_PATH_COMPONENT;
     }
index 70a687d2af9522f07d34ea770ef3df170ae0c7a1..13b28b703c39baf81a440387e1b3d4c1c6250c23 100644 (file)
@@ -51,7 +51,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 3e6c73fa6f8ba7f5af7952e66bf674e65bc63987..d4e49fcd3a546931e9b0198eb35f36096c0b8f1e 100644 (file)
@@ -84,7 +84,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index 607685dd752e3fa1018c5c9f61dbc5e0bf82b5ab..758598c56e43cc85341f10f30b930b56924f6e79 100644 (file)
     </reporting>
     <dependencyManagement>
         <dependencies>
-<!--            <dependency>
-                <groupId>net.java.dev.jaxb2-commons</groupId>
-                <artifactId>jaxb-fluent-api</artifactId>
-                <version>2.0.1</version>
-            </dependency> -->
             <dependency>
                 <groupId>net.java.dev.jaxb2-commons</groupId>
                 <artifactId>jaxb-fluent-api</artifactId>
                 <scope>test</scope>
                 <classifier>jdk15</classifier>
             </dependency>
-            <dependency>
-                <groupId>org.jboss.resteasy</groupId>
-                <artifactId>jaxrs-api</artifactId>
-                <version>1.1.GA</version>
-            </dependency>
             <dependency>
                 <groupId>org.jvnet.jaxb2_commons</groupId>
                 <artifactId>basic</artifactId>
                 <artifactId>runtime</artifactId>
                 <version>0.4.1.4</version>
             </dependency>
+            <dependency>
+                <groupId>org.jboss.resteasy</groupId>
+                <artifactId>jaxrs-api</artifactId>
+                <version>1.2.GA</version>
+            </dependency>
             <dependency>
                 <groupId>org.jboss.resteasy</groupId>
                 <artifactId>resteasy-jaxrs</artifactId>
-                <version>1.1.GA</version>
+                <version>1.2.GA</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jboss.resteasy</groupId>
+                <artifactId>resteasy-jaxb-provider</artifactId>
+                <version>1.2.GA</version>
             </dependency>
+            <dependency>
+                <groupId>org.jboss.resteasy</groupId>
+                <artifactId>resteasy-multipart-provider</artifactId>
+                <version>1.2.GA</version>
+            </dependency>            
             <dependency>
                 <groupId>commons-httpclient</groupId>
                 <artifactId>commons-httpclient</artifactId>
index 116deeca6c05ad8f1e972f344f7386c882ea509a..830b2e951fb6c4e9b60926e549068d11d6cab1b2 100644 (file)
@@ -74,7 +74,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index 672a7943bcfd5d2556bd931c3e2a14f536fa94a0..2025575620d2a9dcb92b0a675974fa0b94d359f4 100644 (file)
@@ -45,7 +45,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 9bbc015be4054c13816af8fc60ab3d7a521812b4..836bf938214d905058640d663d6335bc749fcf53 100644 (file)
@@ -1,3 +1,29 @@
+/**    
+ * RelationClient.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright Â© 2009 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
@@ -13,96 +39,120 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
- * A RelationClient.
-
- * @version $Revision:$
+ * The Class RelationClient.
  */
-public class RelationClient extends AbstractServiceClientImpl implements RelationProxy {
+public class RelationClient extends AbstractServiceClientImpl {
 
-       /* (non-Javadoc)
-        * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.collectionspace.services.client.BaseServiceClient#getServicePathComponent
+        * ()
         */
+       @Override
        public String getServicePathComponent() {
                return "relations";
        }
-       
-    /**
-     *
-     */
-    private RelationProxy relationProxy;
 
-    /**
-    *
-    * Default constructor for CollectionObjectClient class.
-    *
-    */
-   public RelationClient() {
-       ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-       RegisterBuiltin.register(factory);
-       setProxy();
-   }
-    
-   /**
-    * allow to reset proxy as per security needs
-    */
-   public void setProxy() {
-       if(useAuth()){
-           relationProxy = ProxyFactory.create(RelationProxy.class,
-                   getBaseURL(), getHttpClient());
-       }else{
-          relationProxy = ProxyFactory.create(RelationProxy.class,
-                   getBaseURL());
-       }
-   }
+       /** The relation proxy. */
+       private RelationProxy relationProxy;
 
-    /**
-     * @return
-     * @see org.collectionspace.hello.client.RelationProxy#getRelation()
-     */
-    public ClientResponse<RelationsCommonList> readList() {
-        return relationProxy.readList();
-    }
-    
-    public ClientResponse<RelationsCommonList> readList_SPO(String subjectCsid,
-                       String predicate,
-                       String objectCsid) {
-       return relationProxy.readList_SPO(subjectCsid, predicate, objectCsid);
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.hello.client.RelationProxy#getRelation(java.lang.String)
-     */
-    public ClientResponse<MultipartInput> read(String csid) {
-        return relationProxy.read(csid);
-    }
+       /**
+        * Instantiates a new relation client.
+        */
+       public RelationClient() {
+               ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+               RegisterBuiltin.register(factory);
+               setProxy();
+       }
 
-    /**
-     * @param relation
-     * @return
-     * @see org.collectionspace.hello.client.RelationProxy#createRelation(org.collectionspace.hello.Relation)
-     */
-    public ClientResponse<Response> create(MultipartOutput multipart) {
-        return relationProxy.create(multipart);
-    }
+//     /* (non-Javadoc)
+//      * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
+//      */
+//     @Override
+//     public CollectionSpaceProxy getProxy() {
+//             return this.relationProxy;
+//     }
 
-    /**
-     * @param csid
-     * @param relation
-     * @return
-     * @see org.collectionspace.hello.client.RelationProxy#updateRelation(java.lang.Long, org.collectionspace.hello.Relation)
-     */
-    public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
-        return relationProxy.update(csid, multipart);
+    public CollectionSpaceProxy getProxy() {
+       return this.relationProxy;
     }
 
     /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.hello.client.RelationProxy#deleteRelation(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return relationProxy.delete(csid);
-    }
+        * Sets the proxy.
+        */
+       public void setProxy() {
+               if (useAuth()) {
+                       relationProxy = ProxyFactory.create(RelationProxy.class,
+                                       getBaseURL(), getHttpClient());
+               } else {
+                       relationProxy = ProxyFactory.create(RelationProxy.class,
+                                       getBaseURL());
+               }
+       }
+
+       /**
+        * Read list.
+        *
+        * @return the client response
+        */
+       public ClientResponse<RelationsCommonList> readList() {
+               return relationProxy.readList();
+       }
+
+       /**
+        * Read list_ spo.
+        *
+        * @param subjectCsid the subject csid
+        * @param predicate the predicate
+        * @param objectCsid the object csid
+        * @return the client response
+        */
+       public ClientResponse<RelationsCommonList> readList_SPO(String subjectCsid,
+                       String predicate, String objectCsid) {
+               return relationProxy.readList_SPO(subjectCsid, predicate, objectCsid);
+       }
+
+       /**
+        * Read.
+        *
+        * @param csid the csid
+        * @return the client response
+        */
+       public ClientResponse<MultipartInput> read(String csid) {
+               return relationProxy.read(csid);
+       }
+
+       /**
+        * Creates the.
+        *
+        * @param multipart the multipart
+        * @return the client response
+        */
+       public ClientResponse<Response> create(MultipartOutput multipart) {
+               return relationProxy.create(multipart);
+       }
+
+       /**
+        * Update.
+        *
+        * @param csid the csid
+        * @param multipart the multipart
+        * @return the client response
+        */
+       public ClientResponse<MultipartInput> update(String csid,
+                       MultipartOutput multipart) {
+               return relationProxy.update(csid, multipart);
+       }
+
+       /**
+        * Delete.
+        *
+        * @param csid the csid
+        * @return the client response
+        */
+       public ClientResponse<Response> delete(String csid) {
+               return relationProxy.delete(csid);
+       }
 }
index d6e75f97734327f276fbce797374bade55b6ff76..352f4f3b808c5a43c446280bb5c4db2e0b97d520 100644 (file)
@@ -21,7 +21,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/relations/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface RelationProxy {
+public interface RelationProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
index 551a2ff00ac494be4f30f17b21309111d5197431..13f158366eaea393b32d895976c541ee9d7cb118 100644 (file)
@@ -27,7 +27,9 @@ import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.RelationClient;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.relation.RelationsCommon;
 import org.collectionspace.services.relation.RelationsCommonList;
 import org.collectionspace.services.relation.RelationshipType;
@@ -58,14 +60,31 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
 
     final String SERVICE_PATH_COMPONENT = "relations";
     private String knownResourceId = null;
-    private List<String> allResourceIdsCreated = new ArrayList();
+    private List<String> allResourceIdsCreated = new ArrayList<String>();
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new RelationClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(RelationsCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
     // Success outcomes
-    @Override
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
+    @Override
     public void create(String testName) throws Exception {
 
         // Perform setup, such as initializing the type of service request
index d000ae1e1286bf9a569cc6115947b2e9b4e00915..4c63612e6ddd4a5cb6fd9f2f754e2b7d33bbfb71 100644 (file)
@@ -59,7 +59,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r
index 69fa3cb165e87c63d198b974880cb4aeca7f7eb0..fded08294cb8895f1961eb001d0cd648495b93eb 100644 (file)
@@ -56,7 +56,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index d7e695b9cfa2aaec7ab40fb4f0489901419bc05e..7b12a296322daeaa5acabff5abf376e6229a2c93 100644 (file)
@@ -24,22 +24,28 @@ package org.collectionspace.services.authentication.client.test;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
-import org.apache.commons.codec.binary.Base64;
-import org.collectionspace.services.account.AccountTenant;
-import org.collectionspace.services.client.AccountClient;
-import org.collectionspace.services.account.AccountsCommon;
+
+//import org.apache.commons.codec.binary.Base64;
 import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
+import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import org.collectionspace.services.account.AccountTenant;
+import org.collectionspace.services.client.AccountClient;
+import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
 import org.collectionspace.services.client.CollectionObjectClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.test.AbstractServiceTestImpl;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
+import org.collectionspace.services.client.test.BaseServiceTest;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,7 +75,30 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
         return null;
     }
 
-    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new AccountClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+       throw new UnsupportedOperationException(); //Since this test does not support lists, this method is not needed.
+    }
+    
+       @Test(dataProvider = "testName")
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               // Test not supported.
+       }    
+
+       @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void createAccounts(String testName) throws Exception {
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
@@ -126,7 +155,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void create(String testName) {
         setupCreate(testName);
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -161,7 +190,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void createWithoutPassword() {
         banner("createWithoutPassword");
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -191,7 +220,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void createWithUnknownUser() {
         banner("createWithUnknownUser");
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -222,7 +251,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void createWithIncorrectPassword() {
         banner("createWithIncorrectPassword");
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -253,7 +282,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void createWithIncorrectUserPassword() {
         banner("createWithIncorrectUserPassword");
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -285,7 +314,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
     public void createWithoutTenant() {
         banner("createWithoutTenant");
         CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
-        String identifier = this.createIdentifier();
+        String identifier = BaseServiceTest.createIdentifier();
         MultipartOutput multipart = createCollectionObjectInstance(
                 collectionObjectClient.getCommonPartName(), identifier);
 
@@ -449,6 +478,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void createList(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -456,6 +486,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void createWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -463,6 +494,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void createWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -470,6 +502,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void createWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -477,6 +510,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void read(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -484,6 +518,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void readNonExistent(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -491,6 +526,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void readList(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -498,6 +534,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void update(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -505,6 +542,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void updateWithEmptyEntityBody(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -512,6 +550,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void updateWithMalformedXml(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -519,6 +558,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void updateWithWrongXmlSchema(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -526,6 +566,7 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void updateNonExistent(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 
     /* (non-Javadoc)
@@ -533,5 +574,6 @@ public class AuthenticationServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public void deleteNonExistent(String testName) throws Exception {
+       //FIXME: Should this test really be empty?  If so, please comment accordingly.
     }
 }
index f4722277c1eae787cfbd0dbd968935584d0b98f2..a026cb9fbe8ca58ace263c318819cb774d3e1319 100644 (file)
@@ -44,7 +44,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 8befd392b2b51da8c0a94be67b801abb10a51413..94d9af7558ddef4eebc2a1191bad6375b5f89830 100644 (file)
@@ -51,6 +51,11 @@ public class VocabularyClient extends AbstractServiceClientImpl {
         setProxy();
     }
 
+    @Override
+    public CollectionSpaceProxy getProxy() {
+       return this.vocabularyProxy;
+    }    
+
     /**
      * allow to reset proxy as per security needs
      */
index 066e1f7cbbe913a3c5073d1e7f21266d7d664a1b..171f7328955ecd2b1bffcbea7913519c85415608 100644 (file)
@@ -22,7 +22,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 @Path("/vocabularies/")
 @Produces({"multipart/mixed"})
 @Consumes({"multipart/mixed"})
-public interface VocabularyProxy {
+public interface VocabularyProxy extends CollectionSpaceProxy {
 
     // List Vocabularies
     @GET
index 82cec283ab74b4e34d0bf593ca9671977aa76e07..02c2f3225d895898726e1df83b4ebf70423fe29d 100644 (file)
@@ -30,8 +30,10 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.VocabularyItemJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.VocabularyClient;
 import org.collectionspace.services.client.VocabularyClientUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.vocabulary.VocabulariesCommon;
 import org.collectionspace.services.vocabulary.VocabulariesCommonList;
 import org.collectionspace.services.vocabulary.VocabularyitemsCommon;
@@ -75,6 +77,23 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
        knownResourceRefName = refName;
     }
 
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new VocabularyClient();
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+       protected AbstractCommonList getAbstractCommonList(
+                       ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(VocabulariesCommonList.class);
+    }
     // ---------------------------------------------------------------
     // CRUD tests : CREATE tests
     // ---------------------------------------------------------------
index 7ab80d45e777116f7a7875aecddfb0e9318cafc5..2339a75d95f2d7ac84dc5ddae232bd9ab4a15014 100644 (file)
@@ -49,7 +49,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <!-- filter out unwanted jars -->\r
             <exclusions>\r
                 <exclusion>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>commons-httpclient</groupId>\r
index 25c28669c5f260bbdb48b0f45c9575d998298055..baa49e02b8512093c4b5a1feb1909a49ee0b862e 100644 (file)
@@ -79,7 +79,6 @@
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxrs</artifactId>\r
-            <version>1.0.2.GA</version>\r
             <exclusions>\r
                 <exclusion>\r
                     <groupId>tjws</groupId>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-jaxb-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.jboss.resteasy</groupId>\r
             <artifactId>resteasy-multipart-provider</artifactId>\r
-            <version>1.0.2.GA</version>\r
         </dependency>\r
         \r
         <!-- nuxeo -->\r