]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6797: Fix claim tests.
authorRay Lee <rhlee@berkeley.edu>
Wed, 24 May 2017 21:02:39 +0000 (14:02 -0700)
committerRay Lee <rhlee@berkeley.edu>
Wed, 24 May 2017 21:02:39 +0000 (14:02 -0700)
services/claim/3rdparty/nuxeo-platform-cs-claim/src/main/resources/schemas/claims_common.xsd
services/claim/client/src/test/java/org/collectionspace/services/client/test/ClaimAuthRefsTest.java
services/claim/client/src/test/java/org/collectionspace/services/client/test/ClaimServiceTest.java
services/claim/jaxb/src/main/resources/claims-common.xsd

index 631197dd0ea3ba645a1107be7a3f1256e86814aa..bba5e15caf54cb41eb165518bf92d552fc76b79a 100644 (file)
        
        <xs:element name="claimNumber" type="xs:string"/>
        
-       <xs:element name="responsibleDepartments"> <!-- CORE: Responsible department -->
-               <xs:complexType>
-                       <xs:sequence>
-                               <xs:element name="responsibleDepartment" type="xs:string"
-                                       minOccurs="0" maxOccurs="unbounded"/>
-                       </xs:sequence>
-               </xs:complexType>
-       </xs:element>
+       <xs:element name="claimantGroupList" type="claimantGroupList"/>
+       <xs:element name="claimReceivedGroupList" type="claimReceivedGroupList"/>
        
-       <xs:element name="claimClaimantGroupList" type="claimClaimantGroupList"/> <!-- CORE: Filed by; On behalf of -->
-       <xs:element name="claimReceivedGroupList" type="claimReceivedGroupList"/> <!-- CORE: Date filed -->
-       
-       <xs:complexType name="claimClaimantGroupList"> <!-- CORE: Filed by; On behalf of -->
+       <xs:complexType name="claimantGroupList">
                <xs:sequence>
-                       <xs:element name="claimClaimantGroup" type="claimClaimantGroup" minOccurs="0" maxOccurs="unbounded"/>
+                       <xs:element name="claimantGroup" type="claimantGroup" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
        </xs:complexType>
-       <xs:complexType name="claimClaimantGroup"> <!-- CORE: Filed by; On behalf of -->
+       <xs:complexType name="claimantGroup">
                <xs:sequence>
-                       <xs:element name="filedBy" type="xs:string"/> <!-- CORE: Filed by -->
-                       <xs:element name="filedOnBehalfOf" type="xs:string"/> <!-- CORE: On behalf of -->
-                       <xs:element name="claimantNote" type="xs:string"/> <!-- SUGGESTED CORE -->
+                       <xs:element name="claimFiledBy" type="xs:string"/>
+                       <xs:element name="claimFiledOnBehalfOf" type="xs:string"/>
+                       <xs:element name="claimantNote" type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
        
-       <xs:complexType name="claimReceivedGroupList"> <!-- CORE: Date filed -->
+       <xs:complexType name="claimReceivedGroupList">
                <xs:sequence>
                        <xs:element name="claimReceivedGroup" type="claimReceivedGroup" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
        </xs:complexType>
-       <xs:complexType name="claimReceivedGroup"> <!-- CORE: Date filed -->
+       <xs:complexType name="claimReceivedGroup">
                <xs:sequence>
-                       <xs:element name="claimReceivedDate" type="xs:date"/> <!-- CORE: Date filed -->
-                       <xs:element name="claimReceivedNote" type="xs:string"/> <!-- SUGGESTED CORE -->
+                       <xs:element name="claimReceivedDate" type="xs:date"/>
+                       <xs:element name="claimReceivedNote" type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
 </xs:schema>
\ No newline at end of file
index b132ad1fe83a869b373ad65248088aa40b6d300b..8cc3ba40c87cb03235f7d5d45a01ae298ad6df9a 100644 (file)
@@ -41,8 +41,8 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.claim.ClaimsCommon;
-import org.collectionspace.services.claim.ClaimClaimantGroupList;
-import org.collectionspace.services.claim.ClaimClaimantGroup;
+import org.collectionspace.services.claim.ClaimantGroupList;
+import org.collectionspace.services.claim.ClaimantGroup;
 import org.collectionspace.services.person.PersonTermGroup;
 
 import org.testng.Assert;
@@ -207,8 +207,8 @@ public class ClaimAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                    logger.debug(objectAsXmlString(claimCommon, ClaimsCommon.class));
                }
                // Check a couple of fields
-               Assert.assertEquals(claimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getFiledBy(), claimFilerRefName);
-               Assert.assertEquals(claimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getFiledOnBehalfOf(), claimOnBehalfOfRefName);
+               Assert.assertEquals(claimCommon.getClaimantGroupList().getClaimantGroup().get(0).getClaimFiledBy(), claimFilerRefName);
+               Assert.assertEquals(claimCommon.getClaimantGroupList().getClaimantGroup().get(0).getClaimFiledOnBehalfOf(), claimOnBehalfOfRefName);
         } finally {
                if (res != null) {
                 res.close();
@@ -322,12 +322,12 @@ public class ClaimAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
             String claimFiledOnBehalfOf) throws Exception {
         ClaimsCommon claimCommon = new ClaimsCommon();
         claimCommon.setClaimNumber(claimNumber);
-        ClaimClaimantGroupList claimClaimantGroupList = new ClaimClaimantGroupList();
-        ClaimClaimantGroup claimClaimantGroup = new ClaimClaimantGroup();
-        claimClaimantGroup.setFiledBy(claimFiler);
-        claimClaimantGroup.setFiledOnBehalfOf(claimFiledOnBehalfOf);
-        claimClaimantGroupList.getClaimClaimantGroup().add(claimClaimantGroup);
-        claimCommon.setClaimClaimantGroupList(claimClaimantGroupList);
+        ClaimantGroupList claimantGroupList = new ClaimantGroupList();
+        ClaimantGroup claimantGroup = new ClaimantGroup();
+        claimantGroup.setClaimFiledBy(claimFiler);
+        claimantGroup.setClaimFiledOnBehalfOf(claimFiledOnBehalfOf);
+        claimantGroupList.getClaimantGroup().add(claimantGroup);
+        claimCommon.setClaimantGroupList(claimantGroupList);
 
         PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
         PayloadOutputPart commonPart =
index d1f999fb6e37f7884e46495d66c815e851c2572c..cf572d911c6f16321c542b2727826316fbfb0890 100644 (file)
@@ -30,8 +30,8 @@ import org.collectionspace.services.client.ClaimClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.claim.ClaimsCommon;
 import org.collectionspace.services.claim.ResponsibleDepartmentsList;
-import org.collectionspace.services.claim.ClaimClaimantGroupList;
-import org.collectionspace.services.claim.ClaimClaimantGroup;
+import org.collectionspace.services.claim.ClaimantGroupList;
+import org.collectionspace.services.claim.ClaimantGroup;
 import org.collectionspace.services.claim.ClaimReceivedGroupList;
 import org.collectionspace.services.claim.ClaimReceivedGroup;
 
@@ -112,12 +112,12 @@ public class ClaimServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
         responsibleDepartments.add("First Responsible Department-" + identifier);
         responsibleDepartments.add("Second Responsible Department-" + identifier);
 
-        ClaimClaimantGroupList claimClaimantGroupList = new ClaimClaimantGroupList();
-        ClaimClaimantGroup claimClaimantGroup = new ClaimClaimantGroup();
-        claimClaimantGroup.setFiledBy("urn:cspace:core.collectionspace.org:personauthorities:name(TestPersonAuth):item:name(carrieClaimFiler)'Carrie ClaimFiler'");
-        claimClaimantGroup.setFiledOnBehalfOf("urn:cspace:core.collectionspace.org:personauthorities:name(TestPersonAuth):item:name(benBehalfOf)'Ben BehalfOf'");
-        claimClaimantGroup.setClaimantNote(getUTF8DataFragment());
-        claimClaimantGroupList.getClaimClaimantGroup().add(claimClaimantGroup);
+        ClaimantGroupList claimantGroupList = new ClaimantGroupList();
+        ClaimantGroup claimantGroup = new ClaimantGroup();
+        claimantGroup.setClaimFiledBy("urn:cspace:core.collectionspace.org:personauthorities:name(TestPersonAuth):item:name(carrieClaimFiler)'Carrie ClaimFiler'");
+        claimantGroup.setClaimFiledOnBehalfOf("urn:cspace:core.collectionspace.org:personauthorities:name(TestPersonAuth):item:name(benBehalfOf)'Ben BehalfOf'");
+        claimantGroup.setClaimantNote(getUTF8DataFragment());
+        claimantGroupList.getClaimantGroup().add(claimantGroup);
 
         ClaimReceivedGroupList claimReceivedGroupList = new ClaimReceivedGroupList();
         ClaimReceivedGroup claimReceivedGroup = new ClaimReceivedGroup();
@@ -126,7 +126,7 @@ public class ClaimServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
         claimReceivedGroupList.getClaimReceivedGroup().add(claimReceivedGroup);
 
         claimCommon.setResponsibleDepartments(responsibleDepartmentsList);
-        claimCommon.setClaimClaimantGroupList(claimClaimantGroupList);
+        claimCommon.setClaimantGroupList(claimantGroupList);
         claimCommon.setClaimReceivedGroupList(claimReceivedGroupList);
         claimCommon.setClaimNumber(claimNumber);
 
@@ -162,10 +162,8 @@ public class ClaimServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
            // Update its content.
            claimCommon.setClaimNumber(""); // Test deletion of existing string value
        
-           String claimNote = claimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getClaimantNote();
-           claimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).setClaimantNote("updated claim note-" + claimNote);
-       
-           claimCommon.getResponsibleDepartments().getResponsibleDepartment().remove(0); // Test removing a value from a list
+           String claimNote = claimCommon.getClaimantGroupList().getClaimantGroup().get(0).getClaimantNote();
+           claimCommon.getClaimantGroupList().getClaimantGroup().get(0).setClaimantNote("updated claim note-" + claimNote);
        
            String currentTimestamp = GregorianCalendarDateTimeUtils.timestampUTC();
            claimCommon.getClaimReceivedGroupList().getClaimReceivedGroup().get(0).setClaimReceivedDate(currentTimestamp);
@@ -188,7 +186,7 @@ public class ClaimServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
         Assert.assertTrue(receivedDate.equals(CURRENT_DATE_UTC));
         
         // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
-        String claimNote = fromRead.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getClaimantNote();
+        String claimNote = fromRead.getClaimantGroupList().getClaimantGroup().get(0).getClaimantNote();
         
         if(logger.isDebugEnabled()){
             logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
@@ -201,21 +199,12 @@ public class ClaimServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonL
        
        @Override
        protected void compareUpdatedInstances(ClaimsCommon claimCommon, ClaimsCommon updatedClaimCommon) throws Exception {
-               String originalClaimNote = claimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getClaimantNote();
-        String updatedClaimNote = updatedClaimCommon.getClaimClaimantGroupList().getClaimClaimantGroup().get(0).getClaimantNote();
+               String originalClaimNote = claimCommon.getClaimantGroupList().getClaimantGroup().get(0).getClaimantNote();
+        String updatedClaimNote = updatedClaimCommon.getClaimantGroupList().getClaimantGroup().get(0).getClaimantNote();
 
         Assert.assertEquals(updatedClaimNote, originalClaimNote,
             "Data in updated object did not match submitted data.");
 
-        List<String> updatedResponsibleDepartments = updatedClaimCommon.getResponsibleDepartments().getResponsibleDepartment();
-        Assert.assertEquals(1,
-            updatedResponsibleDepartments.size(),
-            "Data in updated object did not match submitted data.");
-
-        Assert.assertEquals(updatedResponsibleDepartments.get(0),
-            claimCommon.getResponsibleDepartments().getResponsibleDepartment().get(0),
-            "Data in updated object did not match submitted data.");
-
         Assert.assertNotSame(claimCommon.getClaimReceivedGroupList().getClaimReceivedGroup().get(0).getClaimReceivedDate(),
                        updatedClaimCommon.getClaimReceivedGroupList().getClaimReceivedGroup().get(0).getClaimReceivedDate(),
             "Data in updated object did not match submitted data.");
index 5dff7e85decca31b12d74819350b1cf6664461d9..41577046ecf2c1496d0dbb213f616257f7ab2c01 100644 (file)
@@ -31,7 +31,7 @@
                        <xs:sequence>
                                <xs:element name="claimNumber" type="xs:string"/>
                                <xs:element name="responsibleDepartments" type="responsibleDepartmentsList"/>
-                               <xs:element name="claimClaimantGroupList" type="claimClaimantGroupList"/>
+                               <xs:element name="claimantGroupList" type="claimantGroupList"/>
                                <xs:element name="claimReceivedGroupList" type="claimReceivedGroupList"/>
                        </xs:sequence>
                </xs:complexType>
                </xs:sequence>
        </xs:complexType>
        
-       <xs:complexType name="claimClaimantGroupList">
+       <xs:complexType name="claimantGroupList">
                <xs:sequence>
-                       <xs:element name="claimClaimantGroup" type="claimClaimantGroup" minOccurs="0" maxOccurs="unbounded"/>
+                       <xs:element name="claimantGroup" type="claimantGroup" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
        </xs:complexType>
-       <xs:complexType name="claimClaimantGroup">
+       <xs:complexType name="claimantGroup">
                <xs:sequence>
-                       <xs:element name="filedBy" type="xs:string"/>
-                       <xs:element name="filedOnBehalfOf" type="xs:string"/>
+                       <xs:element name="claimFiledBy" type="xs:string"/>
+                       <xs:element name="claimFiledOnBehalfOf" type="xs:string"/>
                        <xs:element name="claimantNote" type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
@@ -69,4 +69,3 @@
                </xs:sequence>
        </xs:complexType> 
 </xs:schema>
-